From 480ff3cb1a7b47a00b48790413501c38b47c51c1 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 12 Sep 2019 10:19:06 +0200 Subject: [PATCH 1/3] mesh: fix compile without ENABLE_MESH_PROVISIONER --- src/mesh/pb_adv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesh/pb_adv.c b/src/mesh/pb_adv.c index 6dbe4595c..8ea8a8143 100644 --- a/src/mesh/pb_adv.c +++ b/src/mesh/pb_adv.c @@ -451,6 +451,7 @@ static void pb_adv_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe case HCI_EVENT_MESH_META: switch(packet[2]){ case MESH_SUBEVENT_CAN_SEND_NOW: +#ifdef ENABLE_MESH_PROVISIONER if (link_state == LINK_STATE_W4_ACK){ // build packet uint8_t buffer[22]; @@ -467,6 +468,7 @@ static void pb_adv_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe btstack_run_loop_add_timer(&pb_adv_random_delay_timer); break; } +#endif if (link_state == LINK_STATE_CLOSING){ log_info("link close %08x", pb_adv_link_id); printf("PB-ADV: Sending Link Close\n"); From 88dd0c2f703cdeb4561ca7438d57df806f36f242 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 12 Sep 2019 11:02:11 +0200 Subject: [PATCH 2/3] example/mesh_node_demo: fix compile --- example/mesh_node_demo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/mesh_node_demo.c b/example/mesh_node_demo.c index 0a9ce98db..7ca3da1eb 100644 --- a/example/mesh_node_demo.c +++ b/example/mesh_node_demo.c @@ -190,7 +190,7 @@ int btstack_main(void) // crypto btstack_crypto_init(); -#ifdef ENABLE_GATT_BEARER +#ifdef ENABLE_MESH_GATT_BEARER // l2cap l2cap_init(); @@ -213,7 +213,7 @@ int btstack_main(void) // mesh mesh_init(); -#ifdef ENABLE_GATT_BEARER +#ifdef ENABLE_MESH_GATT_BEARER // setup connectable advertisments bd_addr_t null_addr; memset(null_addr, 0, 6); From ad254f5df72afc98c915b8e568d3f5533da8d0f3 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 12 Sep 2019 11:04:31 +0200 Subject: [PATCH 3/3] hci_transport_h4: avoid calling hci_transport_h4_trigger_next_read when transport is closed --- src/hci_transport_h4.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index e8ae8b9e1..0cb2f3bbd 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -288,8 +288,10 @@ static void hci_transport_h4_block_read(void){ packet_handler(hci_packet[0], &hci_packet[1], read_pos-1); hci_transport_h4_reset_statemachine(); break; - default: - break; + + case H4_OFF: + bytes_to_read = 0; + return; } #ifdef ENABLE_BAUDRATE_CHANGE_FLOWCONTROL_BUG_WORKAROUND