1 /* 2 * hci_transport.h 3 * 4 * HCI Transport API -- allows hcid to use different transport protcols 5 * 6 * Created by Matthias Ringwald on 4/29/09. 7 * 8 */ 9 #pragma once 10 11 #include <stdint.h> 12 13 typedef struct { 14 int (*open)(void *transport_config); 15 int (*close)(); 16 int (*send_cmd_packet)(uint8_t *packet, int size); 17 int (*send_acl_packet)(uint8_t *packet, int size); 18 void (*register_event_packet_handler)(void (*handler)(uint8_t *packet, int size)); 19 void (*register_acl_packet_handler) (void (*handler)(uint8_t *packet, int size)); 20 int (*get_fd)(); // <-- only used for select(..) call 21 int (*handle_data)(); // -- to be called when select( .. ) returns for the fd 22 const char * (*get_transport_name)(); 23 } hci_transport_t; 24 25 typedef struct { 26 const char *device_name; 27 int baudrate; 28 int flowcontrol; // 29 } hci_uart_config_t; 30 31 typedef struct { 32 // unique usb device identifier 33 } hci_libusb_config_t; 34