• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Bluez header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to Android. It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef __BLUETOOTH_H
13 #define __BLUETOOTH_H
14 
15 #ifdef __cplusplus
16 #endif
17 #include <stdio.h>
18 #include <stdint.h>
19 #include <string.h>
20 #include <endian.h>
21 #include <byteswap.h>
22 #ifndef AF_BLUETOOTH
23 #define AF_BLUETOOTH 31
24 #define PF_BLUETOOTH AF_BLUETOOTH
25 #endif
26 #ifndef SOL_BLUETOOTH
27 #define SOL_BLUETOOTH 274
28 #endif
29 #define BTPROTO_L2CAP 0
30 #define BTPROTO_HCI 1
31 #define BTPROTO_SCO 2
32 #define BTPROTO_RFCOMM 3
33 #define BTPROTO_BNEP 4
34 #define BTPROTO_CMTP 5
35 #define BTPROTO_HIDP 6
36 #define BTPROTO_AVDTP 7
37 #define SOL_HCI 0
38 #define SOL_L2CAP 6
39 #define SOL_SCO 17
40 #define SOL_RFCOMM 18
41 #if __BYTE_ORDER == __LITTLE_ENDIAN
42 #define htobs(d) (d)
43 #define htobl(d) (d)
44 #define btohs(d) (d)
45 #define btohl(d) (d)
46 #elif __BYTE_ORDER == __BIG_ENDIAN
47 #define htobs(d) bswap_16(d)
48 #define htobl(d) bswap_32(d)
49 #define btohs(d) bswap_16(d)
50 #define btohl(d) bswap_32(d)
51 #else
52 #error "Unknown byte order"
53 #endif
54 #define bt_get_unaligned(ptr)  ({   struct __attribute__((packed)) {   typeof(*(ptr)) __v;   } *__p = (void *) (ptr);   __p->__v;  })
55 #define bt_put_unaligned(val, ptr)  do {   struct __attribute__((packed)) {   typeof(*(ptr)) __v;   } *__p = (void *) (ptr);   __p->__v = (val);  } while(0)
56 #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
57 #define BDADDR_ALL (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}})
58 #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
59 #ifdef __cplusplus
60 #endif
61 typedef struct {
62 	uint8_t b[6];
63 } __attribute__((packed)) bdaddr_t;
bacpy(bdaddr_t * dst,const bdaddr_t * src)64 static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src)
65 {
66 	memcpy(dst, src, sizeof(bdaddr_t));
67 }
68 #endif
69