forked from auracaster/bumble_mirror
Compare commits
7 Commits
gbg/improv
...
v0.0.128
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d96b821bc | ||
|
|
78b36d2049 | ||
|
|
3e0cad1456 | ||
|
|
b4de38cdc3 | ||
|
|
68d9fbc159 | ||
|
|
a916b7a21a | ||
|
|
7fa2eb7658 |
@@ -857,9 +857,9 @@ class Controller:
|
||||
See Bluetooth spec Vol 2, Part E - 7.8.44 LE Set Address Resolution Enable Command
|
||||
'''
|
||||
ret = HCI_SUCCESS
|
||||
if command.address_resolution == 1:
|
||||
if command.address_resolution_enable == 1:
|
||||
self.le_address_resolution = True
|
||||
elif command.address_resolution == 0:
|
||||
elif command.address_resolution_enable == 0:
|
||||
self.le_address_resolution = False
|
||||
else:
|
||||
ret = HCI_INVALID_HCI_COMMAND_PARAMETERS_ERROR
|
||||
|
||||
@@ -346,8 +346,11 @@ class CharacteristicAdapter:
|
||||
async def read_decoded_value(self):
|
||||
return self.decode_value(await self.wrapped_characteristic.read_value())
|
||||
|
||||
async def write_decoded_value(self, value):
|
||||
return await self.wrapped_characteristic.write_value(self.encode_value(value))
|
||||
async def write_decoded_value(self, value, with_response=False):
|
||||
return await self.wrapped_characteristic.write_value(
|
||||
self.encode_value(value),
|
||||
with_response
|
||||
)
|
||||
|
||||
def encode_value(self, value):
|
||||
return value
|
||||
|
||||
@@ -184,8 +184,8 @@ class Client:
|
||||
# Wait until we can send (only one pending command at a time for the connection)
|
||||
response = None
|
||||
async with self.request_semaphore:
|
||||
assert(self.pending_request is None)
|
||||
assert(self.pending_response is None)
|
||||
assert self.pending_request is None
|
||||
assert self.pending_response is None
|
||||
|
||||
# Create a future value to hold the eventual response
|
||||
self.pending_response = asyncio.get_running_loop().create_future()
|
||||
|
||||
@@ -48,6 +48,7 @@ install_requires =
|
||||
[options.entry_points]
|
||||
console_scripts =
|
||||
bumble-console = bumble.apps.console:main
|
||||
bumble-controller-info = bumble.apps.controller_info:main
|
||||
bumble-gatt-dump = bumble.apps.gatt_dump:main
|
||||
bumble-hci-bridge = bumble.apps.hci_bridge:main
|
||||
bumble-pair = bumble.apps.pair:main
|
||||
|
||||
@@ -164,6 +164,17 @@ async def test_characteristic_encoding():
|
||||
await async_barrier()
|
||||
assert characteristic.value == bytes([124])
|
||||
|
||||
v = await cp.read_value()
|
||||
assert v == 124
|
||||
await cp.write_value(125, with_response=True)
|
||||
await async_barrier()
|
||||
assert characteristic.value == bytes([125])
|
||||
|
||||
cd = DelegatedCharacteristicAdapter(c, encode=lambda x: bytes([x // 2]))
|
||||
await cd.write_value(100, with_response=True)
|
||||
await async_barrier()
|
||||
assert characteristic.value == bytes([50])
|
||||
|
||||
last_change = None
|
||||
|
||||
def on_change(value):
|
||||
|
||||
Reference in New Issue
Block a user