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 _BTHCI_H_ 9 #define _BTHCI_H_ 10 11 /* typedefs */ 12 typedef int32 hci_id; 13 14 typedef enum { H2 = 2, H3, H4, H5 } transport_type; 15 16 // TODO: something more authomatic here? 17 #define HCI_NUM_PACKET_TYPES 5 18 typedef enum { BT_COMMAND = 0, 19 BT_EVENT, 20 BT_ACL, 21 BT_SCO, 22 BT_ESCO 23 } bt_packet_t; 24 25 26 /* packets sizes */ 27 #define HCI_MAX_ACL_SIZE 1024 28 #define HCI_MAX_SCO_SIZE 255 29 #define HCI_MAX_EVENT_SIZE 260 30 #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) 31 32 /* fields sizes */ 33 #define HCI_LAP_SIZE 3 /* LAP */ 34 #define HCI_LINK_KEY_SIZE 16 /* link key */ 35 #define HCI_PIN_SIZE 16 /* PIN */ 36 #define HCI_EVENT_MASK_SIZE 8 /* event mask */ 37 #define HCI_CLASS_SIZE 3 /* class */ 38 #define HCI_FEATURES_SIZE 8 /* LMP features */ 39 #define HCI_DEVICE_NAME_SIZE 248 /* unit name size */ 40 41 #endif 42