From 452683d08c7acbc8324cb2f3f2df56a46586e049 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Thu, 22 Oct 2009 20:00:10 +0000 Subject: [PATCH] use typedef for callback handler --- include/btstack/btstack.h | 6 +++++- src/btstack.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/btstack/btstack.h b/include/btstack/btstack.h index 4d37436c7..1e02bd536 100644 --- a/include/btstack/btstack.h +++ b/include/btstack/btstack.h @@ -15,6 +15,10 @@ #include +// packet handler +typedef void (*btstack_packet_handler_t) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); + + // init BTstack library int bt_open(); @@ -25,7 +29,7 @@ int bt_close(); int bt_send_cmd(hci_cmd_t *cmd, ...); // register packet handler -- channel only valid for l2cap and rfcomm packets -void bt_register_packet_handler (void (*handler)(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)); +btstack_packet_handler_t bt_register_packet_handler(btstack_packet_handler_t handler); void bt_send_acl(uint8_t * data, uint16_t len); diff --git a/src/btstack.c b/src/btstack.c index 7b386d28f..8e950f74b 100644 --- a/src/btstack.c +++ b/src/btstack.c @@ -62,7 +62,7 @@ int btstack_packet_handler(connection_t *connection, uint16_t packet_type, uint1 } // register packet handler -void bt_register_packet_handler(void (*handler)(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)){ +btstack_packet_handler_t bt_register_packet_handler(btstack_packet_handler_t handler){ client_packet_handler = handler; }