diff --git a/examples/run_hfp_gateway.py b/examples/run_hfp_gateway.py index 13a2ed93..5cb3eb3d 100644 --- a/examples/run_hfp_gateway.py +++ b/examples/run_hfp_gateway.py @@ -31,6 +31,7 @@ from bumble.core import ( BT_BR_EDR_TRANSPORT, ) from bumble import rfcomm, hfp +from bumble.hci import HCI_SynchronousDataPacket from bumble.sdp import ( Client as SDP_Client, DataElement, @@ -197,6 +198,13 @@ async def main(): print('@@@ Disconnected from RFCOMM server') return + def on_sco(connection_handle: int, packet: HCI_SynchronousDataPacket): + # Reset packet and loopback + packet.packet_status = 0 + device.host.send_hci_packet(packet) + + device.host.on('sco_packet', on_sco) + # Protocol loop (just for testing at this point) protocol = hfp.HfpProtocol(session) while True: