xref: /haiku/headers/os/bluetooth/bluetooth.h (revision 079eccf655ba39812b421ae1b87a727d41b50354)
1 /*
2  * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
3  *
4  * All rights reserved. Distributed under the terms of the MIT License.
5  *
6  */
7 
8 #ifndef _BLUETOOTH_H
9 #define _BLUETOOTH_H
10 
11 #include <ByteOrder.h>
12 
13 /* Bluetooth version */
14 #define BLUETOOTH_1_1B 0
15 #define BLUETOOTH_1_1  1
16 #define BLUETOOTH_1_2  2
17 #define BLUETOOTH_2_0  3
18 
19 #define BLUETOOTH_VERSION BLUETOOTH_2_0
20 
21 
22 /* Bluetooth common types */
23 
24 /* BD Address */
25 typedef struct {
26 	uint8 b[6];
27 } __attribute__((packed)) bdaddr_t;
28 
29 
30 #define BDADDR_NULL       (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
31 #define BDADDR_LOCAL  	  (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
32 #define BDADDR_BROADCAST  (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}})
33 #define BDADDR_ANY BDADDR_BROADCAST
34 
35 /* 128 integer type needed for SDP */
36 struct int128 {
37 	int8	b[16];
38 };
39 typedef struct int128	int128;
40 typedef struct int128	uint128;
41 
42 /* Protocol definitions - add to as required... */
43 #define BLUETOOTH_PROTO_HCI		134	/* HCI protocol number */
44 #define BLUETOOTH_PROTO_L2CAP	135	/* L2CAP protocol number */
45 #define BLUETOOTH_PROTO_RFCOMM	136	/* RFCOMM protocol number */
46 
47 #define BLUETOOTH_PROTO_MAX     256
48 
49 
50 #endif
51