PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/bluez/btmodule.h

http://pybluez.googlecode.com/
C Header | 44 lines | 27 code | 9 blank | 8 comment | 0 complexity | 2b65cca9bfd2d2feb657fc21040db1f3 MD5 | raw file
Possible License(s): GPL-2.0
  1. #ifndef __btmodule_h__
  2. #define __btmodule_h__
  3. #include "Python.h"
  4. #include <bluetooth/bluetooth.h>
  5. #include <bluetooth/sdp.h>
  6. #include <bluetooth/sdp_lib.h>
  7. #include <stdint.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /* The object holding a socket. It holds some extra information,
  12. like the address family, which is used to decode socket address
  13. arguments properly. */
  14. typedef struct {
  15. PyObject_HEAD
  16. int sock_fd; /* Socket file descriptor */
  17. int sock_family; /* Address family, always AF_BLUETOOTH */
  18. int sock_type; /* Socket type, e.g., SOCK_STREAM */
  19. int sock_proto; /* Protocol type, e.g., BTPROTO_L2CAP */
  20. PyObject *(*errorhandler)(void); /* Error handler; checks
  21. errno, returns NULL and
  22. sets a Python exception */
  23. double sock_timeout; /* Operation timeout in seconds;
  24. 0.0 means non-blocking */
  25. int is_listening_socket; // XXX this is a hack to make
  26. // sdp_advertise_service easier
  27. uint32_t sdp_record_handle; // if it's a listening socket and advertised
  28. // via SDP, this is the SDP handle
  29. sdp_session_t *sdp_session;
  30. } PySocketSockObject;
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. extern PyObject *bluetooth_error;
  35. #endif // __btmodule_h__