`get_characteristics_by_uuid()` now allows a UUID to be passed to the
service param. This allows for users to easily query for a service uuid
and characteristic uuid with one API.
This PR adds a way to display the local gatt characteristics/descriptors values
If no connections, it shows the value of every characteristic/descriptor.
When there's a connection, it shows the value for each specific connection - CCCDs are connection specific
This screen auto-updates every second
before:
```
File "/home/alanrosenthal/code/fitbit/bumble/bumble/gatt.py", line 572, in __str__
f'Descriptor(handle=0x{self.handle:04X}, '
File "/home/alanrosenthal/code/fitbit/bumble/bumble/att.py", line 756, in read_value
self.permissions & self.READ_REQUIRES_ENCRYPTION
TypeError: unsupported operand type(s) for &: 'str' and 'int'
```
* Converted CharacteristicDeclaration implementation to class
* Added ability to get a gatt_server attribute by service UUID, characteristics UUID, descriptor UUID
If characteristic supports Notify and Indicate, the prefer_notify option
will subscribe with Notify if True or Indicate if False.
If characteristic only supports one property, Notify or Indicate, that
mode will be selected, regardless of the prefer_notify setting.
Tested with a characteristic that supports both Notify and Indicate and
verified that prefer_notify sets the desired mode.
Subscribe command will enable notify or indicate events from the
characteristic, depending on supported characteristic properties, and
print received values to the output window.
Unsubscribe will stop notify or indicate events.
Rename find_attribute() to find_characteristic() and return a
characteristic for a set of UUIDS, a characteristic for an attribute
handle, or None.
Print read and received values has a hex string.
Add an unsubscribe implementation to gatt_client.py. Reset the CCCD bits
to 0x0000. Remove a matching subsciber, if one is provided. Otherwise
remove all subscribers for a characteristic, since no more notify or
indicates events will be comming.
authored-by: Michael Mogenson <mogenson@google.com>