From d4346c3c9b17f2cb802bf87bbbbcbc0b28350c89 Mon Sep 17 00:00:00 2001 From: Hui Peng Date: Wed, 22 Mar 2023 13:13:52 -0700 Subject: [PATCH] delegate the HCI_PIN_Code_Request event on host --- bumble/host.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bumble/host.py b/bumble/host.py index 9f667a1..a38f1ff 100644 --- a/bumble/host.py +++ b/bumble/host.py @@ -53,7 +53,6 @@ from .hci import ( HCI_LE_Write_Suggested_Default_Data_Length_Command, HCI_Link_Key_Request_Negative_Reply_Command, HCI_Link_Key_Request_Reply_Command, - HCI_PIN_Code_Request_Negative_Reply_Command, HCI_Packet, HCI_Read_Buffer_Size_Command, HCI_Read_Local_Supported_Commands_Command, @@ -794,11 +793,7 @@ class Host(AbortableEventEmitter): ) def on_hci_pin_code_request_event(self, event): - # For now, just refuse all requests - # TODO: delegate the decision - self.send_command_sync( - HCI_PIN_Code_Request_Negative_Reply_Command(bd_addr=event.bd_addr) - ) + self.emit('pin_code_request', event.bd_addr) def on_hci_link_key_request_event(self, event): async def send_link_key():