1

我尝试通过 l2cap 层连接到我的本地蓝牙控制器,以查看我使用 SDP 协议支持哪些服务。**不想使用 sdptool

with socket.socket(socket.AF_BLUETOOTH, socket.SOCK_RAW, socket.BTPROTO_L2CAP) as l2cap_sock:
      l2cap_sock.bind((local_bd_addr,0))
      l2cap_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
      l2cap_sock.send(b'SDP PAYLOAD')
      

错误结果:

[Errno 107] Transport endpoint is not connected

任何想法,谢谢

4

0 回答 0