You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/04/21 01:32:28 UTC
[6/7] incubator-mynewt-core git commit: ble host - rename "app task"
to "parent task"
ble host - rename "app task" to "parent task"
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/99dc724a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/99dc724a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/99dc724a
Branch: refs/heads/develop
Commit: 99dc724ab938b69fa7ac18a2725398164621fb0c
Parents: e4669ed
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Apr 20 15:30:23 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Wed Apr 20 16:11:48 2016 -0700
----------------------------------------------------------------------
net/nimble/host/src/ble_att.c | 2 +-
net/nimble/host/src/ble_hs.c | 27 ++++++++++++++++-----------
net/nimble/host/src/ble_hs_priv.h | 2 +-
3 files changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/99dc724a/net/nimble/host/src/ble_att.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_att.c b/net/nimble/host/src/ble_att.c
index 379ed48..b06a83f 100644
--- a/net/nimble/host/src/ble_att.c
+++ b/net/nimble/host/src/ble_att.c
@@ -397,7 +397,7 @@ ble_att_inc_rx_stat(uint8_t att_op)
uint8_t *
ble_att_get_flat_buf(void)
{
- BLE_HS_DBG_ASSERT(ble_hs_is_app_task());
+ BLE_HS_DBG_ASSERT(ble_hs_is_parent_task());
return ble_att_flat_buf;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/99dc724a/net/nimble/host/src/ble_hs.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs.c b/net/nimble/host/src/ble_hs.c
index 4d62a94..c3f1f65 100644
--- a/net/nimble/host/src/ble_hs.c
+++ b/net/nimble/host/src/ble_hs.c
@@ -64,10 +64,12 @@ static void *ble_hs_hci_os_event_buf;
static struct os_callout_func ble_hs_heartbeat_timer;
static struct os_callout_func ble_hs_event_co;
-/* Host HCI Task Events */
+/* Queue for host-specific OS events. */
static struct os_eventq ble_hs_evq;
-static struct os_eventq *ble_hs_app_evq;
-static struct os_task *ble_hs_app_task;
+
+/* Task structures for the host's parent task. */
+static struct os_eventq *ble_hs_parent_evq;
+static struct os_task *ble_hs_parent_task;
static struct os_mqueue ble_hs_rx_q;
static struct os_mqueue ble_hs_tx_q;
@@ -105,10 +107,13 @@ ble_hs_thread_safe(void)
return !os_started() || ble_hs_locked_by_cur_task();
}
+/**
+ * Indicates whether the host's parent task is currently running.
+ */
int
-ble_hs_is_app_task(void)
+ble_hs_is_parent_task(void)
{
- return os_sched_get_current_task() == ble_hs_app_task;
+ return os_sched_get_current_task() == ble_hs_parent_task;
}
void
@@ -225,7 +230,7 @@ void
ble_hs_event_enqueue(struct os_event *ev)
{
os_eventq_put(&ble_hs_evq, ev);
- os_eventq_put(ble_hs_app_evq, &ble_hs_event_co.cf_c.c_ev);
+ os_eventq_put(ble_hs_parent_evq, &ble_hs_event_co.cf_c.c_ev);
}
int
@@ -233,7 +238,7 @@ ble_hs_start(void)
{
int rc;
- ble_hs_app_task = os_sched_get_current_task();
+ ble_hs_parent_task = os_sched_get_current_task();
ble_hs_heartbeat_timer_reset();
@@ -259,7 +264,7 @@ ble_hs_rx_data(struct os_mbuf *om)
if (rc != 0) {
return BLE_HS_EOS;
}
- os_eventq_put(ble_hs_app_evq, &ble_hs_event_co.cf_c.c_ev);
+ os_eventq_put(ble_hs_parent_evq, &ble_hs_event_co.cf_c.c_ev);
return 0;
}
@@ -273,7 +278,7 @@ ble_hs_tx_data(struct os_mbuf *om)
if (rc != 0) {
return BLE_HS_EOS;
}
- os_eventq_put(ble_hs_app_evq, &ble_hs_event_co.cf_c.c_ev);
+ os_eventq_put(ble_hs_parent_evq, &ble_hs_event_co.cf_c.c_ev);
return 0;
}
@@ -302,7 +307,7 @@ ble_hs_init(struct os_eventq *app_evq, struct ble_hs_cfg *cfg)
rc = BLE_HS_EINVAL;
goto err;
}
- ble_hs_app_evq = app_evq;
+ ble_hs_parent_evq = app_evq;
ble_hs_cfg_init(cfg);
@@ -394,7 +399,7 @@ ble_hs_init(struct os_eventq *app_evq, struct ble_hs_cfg *cfg)
goto err;
}
- os_callout_func_init(&ble_hs_heartbeat_timer, ble_hs_app_evq,
+ os_callout_func_init(&ble_hs_heartbeat_timer, ble_hs_parent_evq,
ble_hs_heartbeat, NULL);
os_callout_func_init(&ble_hs_event_co, &ble_hs_evq,
ble_hs_event_handle, NULL);
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/99dc724a/net/nimble/host/src/ble_hs_priv.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs_priv.h b/net/nimble/host/src/ble_hs_priv.h
index 23df932..cf77b9e 100644
--- a/net/nimble/host/src/ble_hs_priv.h
+++ b/net/nimble/host/src/ble_hs_priv.h
@@ -98,7 +98,7 @@ void ble_hs_cfg_init(struct ble_hs_cfg *cfg);
int ble_hs_locked(void);
int ble_hs_locked_by_cur_task(void);
int ble_hs_thread_safe(void);
-int ble_hs_is_app_task(void);
+int ble_hs_is_parent_task(void);
void ble_hs_lock(void);
void ble_hs_unlock(void);