mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-05 21:59:45 +00:00
remove BTSTACK_EVENT_WORKING. Use BTSTACK_EVENT_STATE with state == HCI_STATE_WORKING instead
This commit is contained in:
parent
b48a17ffb3
commit
b360b6ad92
@ -53,8 +53,7 @@ void data_handler(uint8_t *packet, uint16_t size){
|
||||
|
||||
void event_handler(uint8_t *packet, uint16_t size){
|
||||
// bt stack activated, get started - set local name
|
||||
if (packet[0] == BTSTACK_EVENT_WORKING ||
|
||||
(packet[0] == BTSTACK_EVENT_STATE && packet[2] == HCI_STATE_WORKING)) {
|
||||
if (packet[0] == BTSTACK_EVENT_STATE && packet[2] == HCI_STATE_WORKING) {
|
||||
bt_send_cmd(&hci_write_local_name, NAME);
|
||||
}
|
||||
if ( COMMAND_COMPLETE_EVENT(packet, hci_write_local_name) ) {
|
||||
|
@ -59,8 +59,7 @@ void event_handler(uint8_t *packet, uint16_t size){
|
||||
}
|
||||
|
||||
// bt stack activated, get started - set local name
|
||||
if (packet[0] == BTSTACK_EVENT_WORKING ||
|
||||
(packet[0] == BTSTACK_EVENT_STATE && packet[2] == HCI_STATE_WORKING)) {
|
||||
if (packet[0] == BTSTACK_EVENT_STATE && packet[2] == HCI_STATE_WORKING) {
|
||||
bt_send_cmd(&hci_write_local_name, "BTstack-Test");
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,7 @@ void event_handler(uint8_t *packet, uint16_t size){
|
||||
}
|
||||
|
||||
// bt stack activated, get started - set local name
|
||||
if (packet[0] == BTSTACK_EVENT_WORKING ||
|
||||
(packet[0] == BTSTACK_EVENT_STATE && packet[2] == HCI_STATE_WORKING)) {
|
||||
if (packet[0] == BTSTACK_EVENT_STATE && packet[2] == HCI_STATE_WORKING) {
|
||||
bt_send_cmd(&hci_write_local_name, "BTstack-Test");
|
||||
}
|
||||
|
||||
|
@ -46,14 +46,13 @@
|
||||
// events 0x50-0x5f are used internally
|
||||
|
||||
// events from BTstack for application/client lib
|
||||
#define BTSTACK_EVENT_WORKING 0x60
|
||||
#define BTSTACK_EVENT_STATE 0x61
|
||||
#define BTSTACK_EVENT_STATE 0x60
|
||||
|
||||
// data: event(8), len(8), nr hci connections
|
||||
#define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0x62
|
||||
#define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0x61
|
||||
|
||||
// data: none
|
||||
#define BTSTACK_EVENT_POWERON_FAILED 0x63
|
||||
#define BTSTACK_EVENT_POWERON_FAILED 0x62
|
||||
|
||||
// data: event (8), len(8), address(48), handle (16), psm (16), source_cid(16), dest_cid (16)
|
||||
#define L2CAP_EVENT_CHANNEL_OPENED 0x70
|
||||
|
@ -143,9 +143,6 @@ static int daemon_client_handler(connection_t *connection, uint16_t packet_type,
|
||||
|
||||
static void daemon_event_handler(uint8_t *packet, uint16_t size){
|
||||
// handle state event
|
||||
if (packet[0] == BTSTACK_EVENT_WORKING){
|
||||
bluetooth_status_handler(BLUETOOTH_ON);
|
||||
}
|
||||
if (packet[0] == BTSTACK_EVENT_STATE){
|
||||
if (packet[2] == HCI_STATE_WORKING) {
|
||||
bluetooth_status_handler(BLUETOOTH_ON);
|
||||
|
Loading…
Reference in New Issue
Block a user