mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-17 02:42:33 +00:00
rename internal function
This commit is contained in:
parent
e8474f1aaa
commit
bf01b0119c
@ -61,7 +61,6 @@ static connection_t *btstack_connection = NULL;
|
||||
|
||||
/** prototypes & dummy functions */
|
||||
static void dummy_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){};
|
||||
static int btstack_packet_handler(connection_t *connection, uint16_t packet_type, uint16_t channel, uint8_t *data, uint16_t size);
|
||||
|
||||
/** local globals :) */
|
||||
static void (*client_packet_handler)(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) = dummy_handler;
|
||||
@ -76,10 +75,16 @@ void bt_use_tcp(const char * address, uint16_t port){
|
||||
daemon_tcp_port = port;
|
||||
}
|
||||
|
||||
static int socket_packet_handler(connection_t *connection, uint16_t packet_type, uint16_t channel, uint8_t *data, uint16_t size){
|
||||
// log_info("BTstack client handler: packet type %u, data[0] %x", packet_type, data[0]);
|
||||
(*client_packet_handler)(packet_type, channel, data, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// init BTstack library
|
||||
int bt_open(void){
|
||||
|
||||
socket_connection_register_packet_callback(btstack_packet_handler);
|
||||
socket_connection_register_packet_callback(socket_packet_handler);
|
||||
|
||||
// BTdaemon
|
||||
if (daemon_tcp_address) {
|
||||
@ -107,12 +112,6 @@ int bt_send_cmd(const hci_cmd_t *cmd, ...){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int btstack_packet_handler(connection_t *connection, uint16_t packet_type, uint16_t channel, uint8_t *data, uint16_t size){
|
||||
// log_info("BTstack client handler: packet type %u, data[0] %x", packet_type, data[0]);
|
||||
(*client_packet_handler)(packet_type, channel, data, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// register packet handler
|
||||
btstack_packet_handler_t bt_register_packet_handler(btstack_packet_handler_t handler){
|
||||
btstack_packet_handler_t old_handler = client_packet_handler;
|
||||
|
Loading…
x
Reference in New Issue
Block a user