Includes:
1. HID Host implementation - hid.py
2. HID application to test Host with 3rd party HID Device application - run_hid_host.py
3. HID supporting files for testing - hid_report_parser.py & hid_key_map.py
Commands to run the application:
Default application:
python run_hid_host.py classic1.json usb:0 <device bd-addr>
Menu options for testing (Get/Set):
python run_hid_host.py classic1.json usb:0 <device bd-addr> test-mode
CuttleFish:tcp-client:127.0.0.1:7300
Application used for testing as Device : Bluetooth Keyboard & Mouse-5.3.0.apk
Note: Change in sdp.py file while testing hid profile,
TEXT_STRING: lambda x: DataElement(DataElement.TEXT_STRING, x.decode('utf8')) changed to
TEXT_STRING: lambda x: DataElement(DataElement.TEXT_STRING, x)
as we were facing error "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 4: invalid start byte" while fetching sdp records.
The other data elements have a space, so I'm guessing that RSSI
is intended to as well. Perhaps there's some subtle reason why
it should have a space, though, in which case feel free to
close this.
Output now looks like this:
```
>>> 58:D3:49:E7:40:DA/P [PUBLIC]:
RSSI: -67
[Flags]: LE General,BR/EDR C,BR/EDR H
[TX Power Level]: 4
[Manufacturer Specific Data]: company=Apple, Inc., data=0f08c00af4392b00040c10020f04
```
[85542e0] fix test
[3748781] add ASAH sink example
[e782e29] add app
[83daa30] wip
[7f138a0] add test
[f732108] allow different address syntax
[9d0bbf8] rename deprecated methods
[eb303d5] add LE CoC support
* Connection implements async context manager to disconnect when
context is left
* The Connection only calls disconnect if the context manager exits
without an exception
* Peer implements async context manager to discover when entering the
context
* Device.connect_as_gatt implements an async context manager to nest the
connection and peer context managers
* Added HCI_StatusError that can be raised when a HCI Command Status
event is received that doesn't show "PENDING" as status
* Added Connection.sustain to wait for a timeout or disconnect
* Peer.sustain also maps to Connectin.sustain
* Updated battery_client.py to use .connect_as_gatt and .sustain
* Updated heart_rate_client.py to use .connect_as_gatt and .sustain