mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-26 21:35:16 +00:00
start work on foo
This commit is contained in:
parent
311108c5d7
commit
b6a86d9103
@ -81,6 +81,10 @@ static const char * h4_get_transport_name();
|
||||
static int h4_set_baudrate(uint32_t baudrate);
|
||||
static int h4_can_send_packet_now(uint8_t packet_type);
|
||||
|
||||
// externa prototyps, support for foo
|
||||
void foo_handle(uint8_t action);
|
||||
void foo_prepare_for_send(void);
|
||||
|
||||
// packet reader state machine
|
||||
static H4_STATE h4_state;
|
||||
static int read_pos;
|
||||
@ -160,10 +164,14 @@ static void h4_block_received(void){
|
||||
h4_state = H4_W4_EVENT_HEADER;
|
||||
bytes_to_read = HCI_EVENT_HEADER_SIZE;
|
||||
break;
|
||||
|
||||
default:
|
||||
#ifdef HAVE_FOO:
|
||||
foo_handle(hci_packet[0]);
|
||||
#else
|
||||
log_error("h4_process: invalid packet type 0x%02x\r\n", hci_packet[0]);
|
||||
#endif
|
||||
read_pos = 0;
|
||||
h4_state = H4_W4_PACKET_TYPE;
|
||||
bytes_to_read = 1;
|
||||
break;
|
||||
}
|
||||
@ -226,7 +234,7 @@ static void h4_register_packet_handler(void (*handler)(uint8_t packet_type, uint
|
||||
packet_handler = handler;
|
||||
}
|
||||
|
||||
// #define DUMP
|
||||
#define DUMP
|
||||
|
||||
#ifdef DUMP
|
||||
static void dump(uint8_t *data, uint16_t len){
|
||||
@ -275,6 +283,10 @@ static int h4_send_packet(uint8_t packet_type, uint8_t *packet, int size){
|
||||
printf("TX: %02x ", packet_type);
|
||||
dump(packet, size);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FOO:
|
||||
foo_prepare_for_send();
|
||||
#endif
|
||||
|
||||
tx_data = packet;
|
||||
tx_len = size;
|
||||
|
Loading…
x
Reference in New Issue
Block a user