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.
This commit is contained in:
Hye-Shik Chang 2007-06-05 18:16:52 +00:00
parent f7188cefb3
commit 82958f0d3b
1 changed files with 5 additions and 2 deletions

View File

@ -363,8 +363,11 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
#define BTPROTO_L2CAP BLUETOOTH_PROTO_L2CAP #define BTPROTO_L2CAP BLUETOOTH_PROTO_L2CAP
#define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM #define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
#define BTPROTO_HCI BLUETOOTH_PROTO_HCI #define BTPROTO_HCI BLUETOOTH_PROTO_HCI
#define SOL_HCI SOL_HCI_RAW
#define HCI_FILTER SO_HCI_RAW_FILTER
#define sockaddr_l2 sockaddr_l2cap #define sockaddr_l2 sockaddr_l2cap
#define sockaddr_rc sockaddr_rfcomm #define sockaddr_rc sockaddr_rfcomm
#define hci_dev hci_node
#define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb) #define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb)
#define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb) #define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb)
#define _BT_HCI_MEMB(sa, memb) ((sa)->hci_##memb) #define _BT_HCI_MEMB(sa, memb) ((sa)->hci_##memb)
@ -4467,10 +4470,10 @@ init_socket(void)
PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP); PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP);
PyModule_AddIntConstant(m, "BTPROTO_HCI", BTPROTO_HCI); PyModule_AddIntConstant(m, "BTPROTO_HCI", BTPROTO_HCI);
PyModule_AddIntConstant(m, "SOL_HCI", SOL_HCI); PyModule_AddIntConstant(m, "SOL_HCI", SOL_HCI);
PyModule_AddIntConstant(m, "HCI_TIME_STAMP", HCI_TIME_STAMP);
PyModule_AddIntConstant(m, "HCI_DATA_DIR", HCI_DATA_DIR);
PyModule_AddIntConstant(m, "HCI_FILTER", HCI_FILTER); PyModule_AddIntConstant(m, "HCI_FILTER", HCI_FILTER);
#if !defined(__FreeBSD__) #if !defined(__FreeBSD__)
PyModule_AddIntConstant(m, "HCI_TIME_STAMP", HCI_TIME_STAMP);
PyModule_AddIntConstant(m, "HCI_DATA_DIR", HCI_DATA_DIR);
PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO); PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO);
#endif #endif
PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM); PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM);