2009-04-29 22:00:24 +00:00
|
|
|
/*
|
|
|
|
* hci_transport.h
|
|
|
|
*
|
2009-05-19 21:49:12 +00:00
|
|
|
* HCI Transport API -- allows BT Daemon to use different transport protcols
|
2009-04-29 22:00:24 +00:00
|
|
|
*
|
|
|
|
* Created by Matthias Ringwald on 4/29/09.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2009-05-08 21:37:54 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2009-04-29 22:00:24 +00:00
|
|
|
typedef struct {
|
|
|
|
int (*open)(void *transport_config);
|
|
|
|
int (*close)();
|
2009-05-08 21:37:54 +00:00
|
|
|
int (*send_cmd_packet)(uint8_t *packet, int size);
|
|
|
|
int (*send_acl_packet)(uint8_t *packet, int size);
|
|
|
|
void (*register_event_packet_handler)(void (*handler)(uint8_t *packet, int size));
|
|
|
|
void (*register_acl_packet_handler) (void (*handler)(uint8_t *packet, int size));
|
2009-04-29 22:00:24 +00:00
|
|
|
int (*get_fd)(); // <-- only used for select(..) call
|
|
|
|
int (*handle_data)(); // -- to be called when select( .. ) returns for the fd
|
|
|
|
const char * (*get_transport_name)();
|
|
|
|
} hci_transport_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const char *device_name;
|
|
|
|
int baudrate;
|
|
|
|
int flowcontrol; //
|
|
|
|
} hci_uart_config_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
// unique usb device identifier
|
|
|
|
} hci_libusb_config_t;
|