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 typedef struct { 12 int (*open)(void *transport_config); 13 int (*close)(); 14 int (*send_cmd_packet)(void *packet, int size); 15 int (*send_acl_packet)(void *packet, int size); 16 void (*register_event_packet_handler)(void (*handler)(void *packet, int size)); 17 void (*register_acl_packet_handler) (void (*handler)(void *packet, int size)); 18 int (*get_fd)(); // <-- only used for select(..) call 19 int (*handle_data)(); // -- to be called when select( .. ) returns for the fd 20 const char * (*get_transport_name)(); 21 } hci_transport_t; 22 23 typedef struct { 24 const char *device_name; 25 int baudrate; 26 int flowcontrol; // 27 } hci_uart_config_t; 28 29 typedef struct { 30 // unique usb device identifier 31 } hci_libusb_config_t; 32