Add Bluefruit LE Friend kit to Chameleon

BluefruitLE should be minimally-equivalent to RN42, with the caveats
mentioned in the class docstring. (The Bluefruit LE Friend has a
higher-level AT command set, with fewer features.) This patch allows the
BluefruitLE kit to be used in tests for pairing, but does not yet add
full keyboard, mouse, or gamepad support.

Note that this kit is not currently hooked up to anything.

Note also that some of the less-sensical API changes in the refactor
were rolled back, and inconsistencies were addressed. In general,
failures should fail loudly now, using exceptions. Hopefully, this will
help diagnose flakes.

TEST=First, locate the source for chameleond on a Chameleon board, cd
there, and run the self-test with only a Bluefruit LE kit attached:
$ IFS="^^^";export PS1=`echo $PS1|sed s/w/W/`;unset IFS
$ cd \
$ python utils/
Check that it doesn't crash, prints sensible results.

Second, test that current functionality is not broken:
Run this code on the Chameleon board, with only RN-42 attached:
$ make && make remote-install CHAMELEON_HOST=$CHAMELEON_IP
Execute the non-flaky non-stress tests that use this code,
see that the tests pass:
$ test_that --board ${BOARD} --args "chameleon_host=${CHAMELEON_IP}" \
${DUT_IP} bluetooth_AdapterPairing.mouse \
bluetooth_AdapterPairing.mouse.pairing_twice \

Third, test that this actually WAI with future patches:
Apply CL:611780, CL:602900, and CL:639850 to your chroot.
Execute the non-flaky non-stress tests that use this code,
see that things work as much as possible without Autotest adjustments.
Note that only the Bluefruit LE Friend should be attached.
$ test_that --board ${BOARD} --args "chameleon_host=${CHAMELEON_IP}" \
${DUT_IP} bluetooth_AdapterPairing.le.mouse \
bluetooth_AdapterPairing.le.mouse.pairing_twice \

Change-Id: Ie651cf1d35609b7421cc3d02bce75306cae4ba91
Commit-Ready: Alexander Lent <>
Tested-by: Alexander Lent <>
Reviewed-by: Wai-Hong Tam <>
4 files changed