btstack/src/hci_transport.h

34 lines
977 B
C
Raw Normal View History

2009-04-29 22:00:24 +00:00
/*
* hci_transport.h
*
* 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
#include <stdint.h>
2009-04-29 22:00:24 +00:00
typedef struct {
int (*open)(void *transport_config);
int (*close)();
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;