From 93ed97b351a3432d1a9fac84bf461abaebaa7a37 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Mon, 5 Oct 2009 20:59:24 +0000 Subject: [PATCH] move packet types to btstack.h or hci_cmds.h --- TODO.txt | 6 +++++- include/btstack/hci_cmds.h | 18 ++++++++++++++++++ src/hci_transport.h | 27 --------------------------- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/TODO.txt b/TODO.txt index 8616f3c57..f29523f02 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,11 +1,15 @@ /* new todo file for BTstack */ Last milestone reached: create script to build APT package for BTdeamon, Resources, and BTstack client library -Last change: status bar icon updates +Last change: move packet types to hci_cmds.h NEXT: +- use single packet handler on client side + - add packet type to callback type + - change API + - don't dispatch on type in btstack.c - support Cocoa CFRunLoop in addition to POSIX select run loop - define struct run_loop_t - run_loop_posix.c: run_loop_t * BTstack_run_loop = run_loop_posix; diff --git a/include/btstack/hci_cmds.h b/include/btstack/hci_cmds.h index 4d5260122..2018ddd27 100644 --- a/include/btstack/hci_cmds.h +++ b/include/btstack/hci_cmds.h @@ -8,6 +8,24 @@ #include +/** + * packet types - used in BTstack and over the H4 UART interface + */ +#define HCI_COMMAND_DATA_PACKET 0x01 +#define HCI_ACL_DATA_PACKET 0x02 +#define HCI_SCO_DATA_PACKET 0x03 +#define HCI_EVENT_PACKET 0x04 + +// extension for client/server communication +#define DAEMON_EVENT_PACKET 0x05 + +// L2CAP data +#define L2CAP_DATA_PACKET 0x06 + +// RFCOMM data +#define RFCOMM_DATA_PACKET 0x07 + + // Events from host controller to host #define HCI_EVENT_INQUIRY_COMPLETE 0x01 #define HCI_EVENT_INQUIRY_RESULT 0x02 diff --git a/src/hci_transport.h b/src/hci_transport.h index 9b8a86aa4..85a39408b 100644 --- a/src/hci_transport.h +++ b/src/hci_transport.h @@ -12,33 +12,6 @@ #include /* HCI packet types */ - -/** - * Indicates (first byte) that this pkt to the bluetooth module is a command pkt. The - * module will send a #HCI_EVENT_PACKET for response. - */ -#define HCI_COMMAND_DATA_PACKET 0x01 - -/** - * Indicates (first byte) that this pkt is a acl pkt. Will be sent to and from the module. - */ -#define HCI_ACL_DATA_PACKET 0x02 - -/** - * Indicates (first byte) that this pkt is a sco pkt. Will be sent to and from the module. - */ -#define HCI_SCO_DATA_PACKET 0x03 - -/** - * Indicates (first byte) that this pkt is an event pkt. Only sent by the bluetooth module. - */ -#define HCI_EVENT_PACKET 0x04 - -// extension for client/server communication -#define L2CAP_DATA_PACKET 0x05 - -#define DAEMON_EVENT_PACKET 0x06 - typedef struct { int (*open)(void *transport_config); int (*close)();