1 /* 2 * hci.h 3 * 4 * Created by Matthias Ringwald on 4/29/09. 5 * 6 */ 7 8 #pragma once 9 10 #include <stdint.h> 11 12 #include "hci_transport.h" 13 14 typedef enum { 15 HCI_POWER_OFF = 0, 16 HCI_POWER_ON 17 } HCI_POWER_MODE; 18 19 typedef struct { 20 uint8_t ogf; 21 uint16_t ocf; 22 const char *format; 23 } hci_cmd_t; 24 25 // set up HCI 26 void hci_init(hci_transport_t *transport, void *config); 27 28 // power control 29 int hci_power_control(HCI_POWER_MODE mode); 30 31 // run the hci daemon loop 32 void hci_run(); 33 34 // create hci command packet based on a template and a list of parameters 35 void hci_create_cmd_packet(uint8_t *buffer, uint8_t *cmd_len, hci_cmd_t *cmd, ...); 36 37 extern hci_cmd_t hci_inquiry; 38 extern hci_cmd_t hci_reset; 39 40 #define HCI_INQUIRY_LAP 0x9E8B33L // 0x9E8B33: General/Unlimited Inquiry Access Code (GIAC) 41