xref: /btstack/src/hci.h (revision 93b8dc03ca9ef215b318e70bc4dea7b953f727dc)
11f504dbdSmatthias.ringwald /*
21f504dbdSmatthias.ringwald  *  hci.h
31f504dbdSmatthias.ringwald  *
41f504dbdSmatthias.ringwald  *  Created by Matthias Ringwald on 4/29/09.
51f504dbdSmatthias.ringwald  *
61f504dbdSmatthias.ringwald  */
71f504dbdSmatthias.ringwald 
81f504dbdSmatthias.ringwald #pragma once
91f504dbdSmatthias.ringwald 
10*93b8dc03Smatthias.ringwald #include <stdint.h>
11*93b8dc03Smatthias.ringwald 
121f504dbdSmatthias.ringwald #include "hci_transport.h"
131f504dbdSmatthias.ringwald 
14475c8125Smatthias.ringwald typedef enum {
15475c8125Smatthias.ringwald     HCI_POWER_OFF = 0,
16475c8125Smatthias.ringwald     HCI_POWER_ON
17475c8125Smatthias.ringwald } HCI_POWER_MODE;
18475c8125Smatthias.ringwald 
19*93b8dc03Smatthias.ringwald typedef struct {
20*93b8dc03Smatthias.ringwald     uint8_t  ogf;
21*93b8dc03Smatthias.ringwald     uint16_t ocf;
22*93b8dc03Smatthias.ringwald     const char *format;
23*93b8dc03Smatthias.ringwald } hci_cmd_t;
24*93b8dc03Smatthias.ringwald 
25475c8125Smatthias.ringwald // set up HCI
26475c8125Smatthias.ringwald void hci_init(hci_transport_t *transport, void *config);
27475c8125Smatthias.ringwald 
28475c8125Smatthias.ringwald // power control
29475c8125Smatthias.ringwald int hci_power_control(HCI_POWER_MODE mode);
30475c8125Smatthias.ringwald 
311f504dbdSmatthias.ringwald // run the hci daemon loop
32475c8125Smatthias.ringwald void hci_run();
331f504dbdSmatthias.ringwald 
34*93b8dc03Smatthias.ringwald // create hci command packet based on a template and a list of parameters
35*93b8dc03Smatthias.ringwald void hci_create_cmd_packet(uint8_t *buffer, uint8_t *cmd_len, hci_cmd_t *cmd, ...);
36*93b8dc03Smatthias.ringwald 
37*93b8dc03Smatthias.ringwald extern hci_cmd_t hci_inquiry;
38*93b8dc03Smatthias.ringwald extern hci_cmd_t hci_reset;
39*93b8dc03Smatthias.ringwald 
40*93b8dc03Smatthias.ringwald #define HCI_INQUIRY_LAP 0x9E8B33L  // 0x9E8B33: General/Unlimited Inquiry Access Code (GIAC)
41