From 1b591784e4eac57f0401194878acabb5d2045182 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Wed, 8 Nov 2017 16:24:50 +0100 Subject: [PATCH 1/5] nimble/host: Remove unused bsp includes X-Original-Commit: fae57b293371389d569f61900268d37e7f7b2196 --- nimble/host/src/ble_att.c | 1 - nimble/host/src/ble_att_svr.c | 1 - nimble/host/src/ble_hs.c | 1 - 3 files changed, 3 deletions(-) diff --git a/nimble/host/src/ble_att.c b/nimble/host/src/ble_att.c index bd7bcc2d6..8261e09e7 100644 --- a/nimble/host/src/ble_att.c +++ b/nimble/host/src/ble_att.c @@ -19,7 +19,6 @@ #include #include -#include "bsp/bsp.h" #include "ble_hs_priv.h" static uint16_t ble_att_preferred_mtu_val; diff --git a/nimble/host/src/ble_att_svr.c b/nimble/host/src/ble_att_svr.c index eab172308..4c2680ff8 100644 --- a/nimble/host/src/ble_att_svr.c +++ b/nimble/host/src/ble_att_svr.c @@ -19,7 +19,6 @@ #include #include -#include "bsp/bsp.h" #include "os/os.h" #include "nimble/ble.h" #include "host/ble_uuid.h" diff --git a/nimble/host/src/ble_hs.c b/nimble/host/src/ble_hs.c index c55cb9253..0e55c84c0 100644 --- a/nimble/host/src/ble_hs.c +++ b/nimble/host/src/ble_hs.c @@ -22,7 +22,6 @@ #include #include "sysinit/sysinit.h" #include "syscfg/syscfg.h" -#include "bsp/bsp.h" #include "stats/stats.h" #include "os/os.h" #include "console/console.h" From 4e3559a47cb43f8693ef4dc272865f11c27a071f Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Thu, 9 Nov 2017 12:17:59 +0100 Subject: [PATCH 2/5] nimble/host: Add missing include X-Original-Commit: 94e635f5ea7e4640a22b6ddc56c2a4373f32b885 --- nimble/host/src/ble_monitor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nimble/host/src/ble_monitor.c b/nimble/host/src/ble_monitor.c index 93a75e68c..35e619e27 100644 --- a/nimble/host/src/ble_monitor.c +++ b/nimble/host/src/ble_monitor.c @@ -25,6 +25,7 @@ #error "Cannot enable monitor over UART and RTT at the same time!" #endif +#include #include #include #include "os/os.h" From 227f2ec527c94e4a6ece1af6e93c878f21f04e74 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Thu, 9 Nov 2017 14:01:35 +0100 Subject: [PATCH 3/5] nimble/host: Fix semaphore usage We should not access semaphore internals. Instead, use dedicated API. X-Original-Commit: b226920419ca7a84f24ac56f76ca5f52e79a584a --- nimble/host/src/ble_hs_hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/host/src/ble_hs_hci.c b/nimble/host/src/ble_hs_hci.c index 820e5c306..af07fce5e 100644 --- a/nimble/host/src/ble_hs_hci.c +++ b/nimble/host/src/ble_hs_hci.c @@ -338,7 +338,7 @@ ble_hs_hci_cmd_tx_empty_ack(uint16_t opcode, void *cmd, uint8_t cmd_len) void ble_hs_hci_rx_ack(uint8_t *ack_ev) { - if (ble_hs_hci_sem.sem_tokens != 0) { + if (os_sem_get_count(&ble_hs_hci_sem) > 0) { /* This ack is unexpected; ignore it. */ ble_hci_trans_buf_free(ack_ev); return; From 6fcaf8e698f6c07611b033a2b46587e452e5a3f8 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Thu, 9 Nov 2017 15:12:19 +0100 Subject: [PATCH 4/5] nimble/host: Enable ble_hs_locked_by_cur_task for debug only It's used only for debugging anyway. X-Original-Commit: 20d7536988e4f5a210ead7601085470669e959de --- nimble/host/src/ble_hs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nimble/host/src/ble_hs.c b/nimble/host/src/ble_hs.c index 0e55c84c0..46c086533 100644 --- a/nimble/host/src/ble_hs.c +++ b/nimble/host/src/ble_hs.c @@ -124,20 +124,20 @@ ble_hs_evq_set(struct os_eventq *evq) ble_hs_evq = evq; } +#if MYNEWT_VAL(BLE_HS_DEBUG) int ble_hs_locked_by_cur_task(void) { struct os_task *owner; -#if MYNEWT_VAL(BLE_HS_DEBUG) if (!os_started()) { return ble_hs_dbg_mutex_locked; } -#endif owner = ble_hs_mutex.mu_owner; return owner != NULL && owner == os_sched_get_current_task(); } +#endif /** * Indicates whether the host's parent task is currently running. From 14512387e73345d047d957e229f9bc1a5d7a49ed Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Thu, 9 Nov 2017 16:43:46 +0100 Subject: [PATCH 5/5] nimble/ias: Fix service definition It did not compile... X-Original-Commit: 5f0df1c450541e8b45964f99f019113960471160 --- nimble/host/services/ias/src/ble_svc_ias.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nimble/host/services/ias/src/ble_svc_ias.c b/nimble/host/services/ias/src/ble_svc_ias.c index 74c9778fa..925befb4f 100644 --- a/nimble/host/services/ias/src/ble_svc_ias.c +++ b/nimble/host/services/ias/src/ble_svc_ias.c @@ -44,10 +44,10 @@ static const struct ble_gatt_svc_def ble_svc_ias_defs[] = { { /*** Service: Immediate Alert Service (IAS). */ .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = BLE_UUID16(BLE_SVC_IAS_UUID16), + .uuid = BLE_UUID16_DECLARE(BLE_SVC_IAS_UUID16), .characteristics = (struct ble_gatt_chr_def[]) { { /*** Characteristic: Alert Level. */ - .uuid = BLE_UUID16(BLE_SVC_IAS_CHR_UUID16_ALERT_LEVEL), + .uuid = BLE_UUID16_DECLARE(BLE_SVC_IAS_CHR_UUID16_ALERT_LEVEL), .access_cb = ble_svc_ias_access, .flags = BLE_GATT_CHR_F_WRITE_NO_RSP, }, {