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