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