From 30a044b0956c3be1f387e2fa8623a84a01cef70d Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Mon, 9 Sep 2019 17:23:43 +0200 Subject: [PATCH] mesh: rename pb_type_t to mesh_pb_type_t, fixes #249 --- .../gatt-service/mesh_provisioning_service_server.c | 2 +- src/mesh/pb_adv.c | 2 +- src/mesh/provisioning.h | 6 +++--- src/mesh/provisioning_device.c | 10 +++++----- test/mesh/provisioning_provisioner_test.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ble/gatt-service/mesh_provisioning_service_server.c b/src/ble/gatt-service/mesh_provisioning_service_server.c index 0d0ed60ff..8f231973e 100644 --- a/src/ble/gatt-service/mesh_provisioning_service_server.c +++ b/src/ble/gatt-service/mesh_provisioning_service_server.c @@ -81,7 +81,7 @@ static mesh_provisioning_t mesh_provisioning; static void mesh_provisioning_service_emit_link_open(hci_con_handle_t con_handle, uint8_t status){ uint8_t event[7] = { HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_PB_TRANSPORT_LINK_OPEN, status}; little_endian_store_16(event, 4, con_handle); - event[6] = PB_TYPE_GATT; + event[6] = MESH_PB_TYPE_GATT; mesh_provisioning_service_packet_handler(HCI_EVENT_PACKET, 0, event, sizeof(event)); } diff --git a/src/mesh/pb_adv.c b/src/mesh/pb_adv.c index 686df9627..6dbe4595c 100644 --- a/src/mesh/pb_adv.c +++ b/src/mesh/pb_adv.c @@ -144,7 +144,7 @@ static void pb_adv_emit_pdu_sent(uint8_t status){ static void pb_adv_emit_link_open(uint8_t status, uint16_t pb_transport_cid){ uint8_t event[7] = { HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_PB_TRANSPORT_LINK_OPEN, status}; little_endian_store_16(event, 4, pb_transport_cid); - event[6] = PB_TYPE_ADV; + event[6] = MESH_PB_TYPE_ADV; pb_adv_packet_handler(HCI_EVENT_PACKET, 0, event, sizeof(event)); } diff --git a/src/mesh/provisioning.h b/src/mesh/provisioning.h index b5f091790..417992cbe 100644 --- a/src/mesh/provisioning.h +++ b/src/mesh/provisioning.h @@ -85,9 +85,9 @@ extern "C" #define MESH_INPUT_OOB_STRING 0x08 typedef enum { - PB_TYPE_ADV = 0, - PB_TYPE_GATT -} pb_type_t; + MESH_PB_TYPE_ADV = 0, + MESH_PB_TYPE_GATT +} mesh_pb_type_t; typedef enum { MESH_OOB_INFORMATION_INDEX_OTHER = 0, diff --git a/src/mesh/provisioning_device.c b/src/mesh/provisioning_device.c index a71c92fbb..62599cb11 100644 --- a/src/mesh/provisioning_device.c +++ b/src/mesh/provisioning_device.c @@ -150,17 +150,17 @@ typedef enum { static device_state_t device_state; static uint16_t pb_transport_cid; -static pb_type_t pb_type; +static mesh_pb_type_t pb_type; static void pb_send_pdu(uint16_t transport_cid, const uint8_t * buffer, uint16_t buffer_size){ switch (pb_type){ #ifdef ENABLE_MESH_ADV_BEARER - case PB_TYPE_ADV: + case MESH_PB_TYPE_ADV: pb_adv_send_pdu(transport_cid, buffer, buffer_size); break; #endif #ifdef ENABLE_MESH_GATT_BEARER - case PB_TYPE_GATT: + case MESH_PB_TYPE_GATT: pb_gatt_send_pdu(transport_cid, buffer, buffer_size); break; #endif @@ -172,12 +172,12 @@ static void pb_send_pdu(uint16_t transport_cid, const uint8_t * buffer, uint16_t static void pb_close_link(uint16_t transport_cid, uint8_t reason){ switch (pb_type){ #ifdef ENABLE_MESH_ADV_BEARER - case PB_TYPE_ADV: + case MESH_PB_TYPE_ADV: pb_adv_close_link(transport_cid, reason); break; #endif #ifdef ENABLE_MESH_GATT_BEARER - case PB_TYPE_GATT: + case MESH_PB_TYPE_GATT: pb_gatt_close_link(transport_cid, reason); break; #endif diff --git a/test/mesh/provisioning_provisioner_test.cpp b/test/mesh/provisioning_provisioner_test.cpp index 36871f19c..8dee89c18 100644 --- a/test/mesh/provisioning_provisioner_test.cpp +++ b/test/mesh/provisioning_provisioner_test.cpp @@ -102,7 +102,7 @@ static uint16_t pdu_size; static void pb_adv_emit_link_open(uint8_t status, uint16_t pb_adv_cid){ uint8_t event[7] = { HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_PB_TRANSPORT_LINK_OPEN, status}; little_endian_store_16(event, 4, pb_adv_cid); - event[6] = PB_TYPE_ADV; + event[6] = MESH_PB_TYPE_ADV; pb_adv_packet_handler(HCI_EVENT_PACKET, 0, event, sizeof(event)); }