Merge pull request #139 from google/gbg/hotfix-001

two small hotfixes
This commit is contained in:
Gilles Boccon-Gibod
2023-03-07 09:16:15 -08:00
committed by GitHub
2 changed files with 12 additions and 4 deletions

View File

@@ -534,6 +534,9 @@ class Connection(CompositeEventEmitter):
def on_connection_parameters_update_failure(self, error):
pass
def on_connection_data_length_change(self):
pass
def on_connection_phy_update(self):
pass
@@ -2008,7 +2011,7 @@ class Device(CompositeEventEmitter):
NOTE: the name of the parameters may look odd, but it just follows the names
used in the Bluetooth spec.
'''
await self.send_command(
result = await self.send_command(
HCI_LE_Connection_Update_Command(
connection_handle=connection.handle,
connection_interval_min=connection_interval_min,
@@ -2017,9 +2020,10 @@ class Device(CompositeEventEmitter):
supervision_timeout=supervision_timeout,
min_ce_length=min_ce_length,
max_ce_length=max_ce_length,
),
check_result=True,
)
)
if result.status != HCI_Command_Status_Event.PENDING:
raise HCI_StatusError(result)
async def get_connection_rssi(self, connection):
result = await self.send_command(

View File

@@ -1421,7 +1421,11 @@ class HCI_Constant:
# -----------------------------------------------------------------------------
class HCI_Error(ProtocolError):
def __init__(self, error_code):
super().__init__(error_code, 'hci', HCI_Constant.error_name(error_code))
super().__init__(
error_code,
error_namespace='hci',
error_name=HCI_Constant.error_name(error_code),
)
# -----------------------------------------------------------------------------