Skip to content

Commit 82958f0

Browse files
committed
Fix build on FreeBSD. Bluetooth HCI API in FreeBSD is quite different
from Linux's. Just fix the build for now but the code doesn't support the complete capability of HCI on FreeBSD yet.
1 parent f7188ce commit 82958f0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Modules/socketmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,11 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
363363
#define BTPROTO_L2CAP BLUETOOTH_PROTO_L2CAP
364364
#define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
365365
#define BTPROTO_HCI BLUETOOTH_PROTO_HCI
366+
#define SOL_HCI SOL_HCI_RAW
367+
#define HCI_FILTER SO_HCI_RAW_FILTER
366368
#define sockaddr_l2 sockaddr_l2cap
367369
#define sockaddr_rc sockaddr_rfcomm
370+
#define hci_dev hci_node
368371
#define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb)
369372
#define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb)
370373
#define _BT_HCI_MEMB(sa, memb) ((sa)->hci_##memb)
@@ -4467,10 +4470,10 @@ init_socket(void)
44674470
PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP);
44684471
PyModule_AddIntConstant(m, "BTPROTO_HCI", BTPROTO_HCI);
44694472
PyModule_AddIntConstant(m, "SOL_HCI", SOL_HCI);
4470-
PyModule_AddIntConstant(m, "HCI_TIME_STAMP", HCI_TIME_STAMP);
4471-
PyModule_AddIntConstant(m, "HCI_DATA_DIR", HCI_DATA_DIR);
44724473
PyModule_AddIntConstant(m, "HCI_FILTER", HCI_FILTER);
44734474
#if !defined(__FreeBSD__)
4475+
PyModule_AddIntConstant(m, "HCI_TIME_STAMP", HCI_TIME_STAMP);
4476+
PyModule_AddIntConstant(m, "HCI_DATA_DIR", HCI_DATA_DIR);
44744477
PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO);
44754478
#endif
44764479
PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM);

0 commit comments

Comments
 (0)