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/02/12 22:41:48 UTC
[2/4] incubator-mynewt-larva git commit: Remove ble_hci_ack.[ch];
merge into ble_hci_sched.
Remove ble_hci_ack.[ch]; merge into ble_hci_sched.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/ef84dcf1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/ef84dcf1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/ef84dcf1
Branch: refs/heads/master
Commit: ef84dcf19317d5c44185bd4b8323e78223acda8c
Parents: a48970a
Author: Christopher Collins <cc...@gmail.com>
Authored: Fri Feb 12 13:12:31 2016 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Fri Feb 12 13:41:08 2016 -0800
----------------------------------------------------------------------
net/nimble/host/src/ble_gap.c | 36 +++++++-------
net/nimble/host/src/ble_hci_ack.c | 63 ------------------------
net/nimble/host/src/ble_hci_ack.h | 38 --------------
net/nimble/host/src/ble_hci_sched.c | 42 +++++++++++++---
net/nimble/host/src/ble_hci_sched.h | 11 +++++
net/nimble/host/src/ble_hs.c | 3 --
net/nimble/host/src/ble_hs_startup.c | 11 ++---
net/nimble/host/src/host_hci.c | 8 +--
net/nimble/host/src/host_hci_cmd.c | 1 -
net/nimble/host/src/test/ble_hs_adv_test.c | 1 -
net/nimble/host/src/test/ble_hs_conn_test.c | 1 -
net/nimble/host/src/test/ble_hs_test_util.c | 1 -
project/bletiny/src/main.c | 4 +-
13 files changed, 74 insertions(+), 146 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index e4cbf76..091e597 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -26,9 +26,7 @@
#include "host/host_hci.h"
#include "ble_hs_priv.h"
#include "ble_hs_adv_priv.h"
-#include "ble_hci_ack.h"
#include "ble_hs_conn.h"
-#include "ble_hci_ack.h"
#include "ble_hci_sched.h"
#include "ble_gatt_priv.h"
#include "ble_gap_priv.h"
@@ -1351,7 +1349,7 @@ ble_gap_wl_tx_add(void *arg)
assert(ble_gap_wl.entries != NULL);
assert(ble_gap_wl.cur < ble_gap_wl.count);
- ble_hci_ack_set_callback(ble_gap_wl_ack_add, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_wl_ack_add, NULL);
white_entry = ble_gap_wl.entries + ble_gap_wl.cur;
rc = host_hci_cmd_le_add_to_whitelist(white_entry->addr,
@@ -1396,7 +1394,7 @@ ble_gap_wl_tx_clear(void *arg)
assert(ble_gap_wl.op == BLE_GAP_OP_W_SET);
assert(ble_gap_wl.state == BLE_GAP_STATE_W_CLEAR);
- ble_hci_ack_set_callback(ble_gap_wl_ack_clear, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_wl_ack_clear, NULL);
rc = host_hci_cmd_le_clear_whitelist();
if (rc != 0) {
@@ -1482,7 +1480,7 @@ ble_gap_adv_disable_tx(void *arg)
{
int rc;
- ble_hci_ack_set_callback(ble_gap_adv_ack_disable, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_adv_ack_disable, NULL);
rc = host_hci_cmd_le_set_adv_enable(0);
if (rc != BLE_ERR_SUCCESS) {
ble_gap_call_slave_cb(BLE_GAP_EVENT_ADV_STOP_FAILURE,
@@ -1622,7 +1620,7 @@ ble_gap_adv_enable_tx(void *arg)
{
int rc;
- ble_hci_ack_set_callback(ble_gap_adv_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_adv_ack, NULL);
rc = host_hci_cmd_le_set_adv_enable(1);
if (rc != BLE_ERR_SUCCESS) {
ble_gap_call_slave_cb(BLE_GAP_EVENT_ADV_FAILURE,
@@ -1645,7 +1643,7 @@ ble_gap_adv_rsp_data_tx(void *arg)
ble_gap_slave.hci_handle = BLE_HCI_SCHED_HANDLE_NONE;
- ble_hci_ack_set_callback(ble_gap_adv_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_adv_ack, NULL);
rc = host_hci_cmd_le_set_scan_rsp_data(rsp_data, sizeof rsp_data);
if (rc != 0) {
ble_gap_call_slave_cb(BLE_GAP_EVENT_ADV_FAILURE,
@@ -1706,7 +1704,7 @@ ble_gap_adv_data_tx(void *arg)
&adv_data_len, BLE_HCI_MAX_ADV_DATA_LEN);
assert(rc == 0);
- ble_hci_ack_set_callback(ble_gap_adv_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_adv_ack, NULL);
rc = host_hci_cmd_le_set_adv_data(ble_gap_slave.adv_data,
adv_data_len);
if (rc != 0) {
@@ -1766,7 +1764,7 @@ ble_gap_adv_power_tx(void *arg)
ble_gap_slave.hci_handle = BLE_HCI_SCHED_HANDLE_NONE;
- ble_hci_ack_set_callback(ble_gap_adv_power_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_adv_power_ack, NULL);
rc = host_hci_cmd_read_adv_pwr();
if (rc != 0) {
ble_gap_call_slave_cb(BLE_GAP_EVENT_ADV_FAILURE,
@@ -1809,7 +1807,7 @@ ble_gap_adv_params_tx(void *arg)
break;
}
- ble_hci_ack_set_callback(ble_gap_adv_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_adv_ack, NULL);
rc = host_hci_cmd_le_set_adv_params(&hap);
if (rc != 0) {
ble_gap_call_slave_cb(BLE_GAP_EVENT_ADV_FAILURE,
@@ -2017,7 +2015,7 @@ ble_gap_disc_tx_disable(void *arg)
assert(ble_gap_master.op == BLE_GAP_OP_M_DISC);
assert(ble_gap_master.state == BLE_GAP_STATE_M_DISC_DISABLE);
- ble_hci_ack_set_callback(ble_gap_disc_ack_disable, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_disc_ack_disable, NULL);
rc = host_hci_cmd_le_set_scan_enable(0, 0);
if (rc != 0) {
/* XXX: What can we do? */
@@ -2059,7 +2057,7 @@ ble_gap_disc_tx_enable(void *arg)
assert(ble_gap_master.op == BLE_GAP_OP_M_DISC);
assert(ble_gap_master.state == BLE_GAP_STATE_M_DISC_ENABLE);
- ble_hci_ack_set_callback(ble_gap_disc_ack_enable, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_disc_ack_enable, NULL);
rc = host_hci_cmd_le_set_scan_enable(1, 0);
if (rc != 0) {
ble_gap_master_failed(rc);
@@ -2102,7 +2100,7 @@ ble_gap_disc_tx_params(void *arg)
assert(ble_gap_master.op == BLE_GAP_OP_M_DISC);
assert(ble_gap_master.state == BLE_GAP_STATE_M_DISC_PARAMS);
- ble_hci_ack_set_callback(ble_gap_disc_ack_params, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_disc_ack_params, NULL);
rc = host_hci_cmd_le_set_scan_params(
ble_gap_master.disc.scan_type,
BLE_GAP_SCAN_FAST_INTERVAL_MIN,
@@ -2242,7 +2240,7 @@ ble_gap_conn_create_tx(void *arg)
hcc.max_ce_len = ble_gap_master.conn.params.max_ce_len;
ble_gap_master.state = BLE_GAP_STATE_M_UNACKED;
- ble_hci_ack_set_callback(ble_gap_conn_create_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_conn_create_ack, NULL);
rc = host_hci_cmd_le_create_connection(&hcc);
if (rc != 0) {
@@ -2356,7 +2354,7 @@ ble_gap_terminate_tx(void *arg)
handle = (uintptr_t)arg;
- ble_hci_ack_set_callback(ble_gap_terminate_ack, arg);
+ ble_hci_sched_set_ack_cb(ble_gap_terminate_ack, arg);
status = host_hci_cmd_disconnect(handle, BLE_ERR_REM_USER_CONN_TERM);
if (status != 0) {
@@ -2418,7 +2416,7 @@ ble_gap_cancel_tx(void *arg)
{
int rc;
- ble_hci_ack_set_callback(ble_gap_cancel_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_gap_cancel_ack, NULL);
rc = host_hci_cmd_le_create_conn_cancel();
if (rc != 0) {
@@ -2574,7 +2572,7 @@ ble_gap_rx_param_req(struct hci_le_conn_param_req *evt)
pos_reply.min_ce_len = entry->params.min_ce_len;
pos_reply.max_ce_len = entry->params.max_ce_len;
- ble_hci_ack_set_callback(ble_gap_param_reply_ack, entry);
+ ble_hci_sched_set_ack_cb(ble_gap_param_reply_ack, entry);
rc = host_hci_cmd_le_conn_param_reply(&pos_reply);
}
@@ -2587,7 +2585,7 @@ ble_gap_rx_param_req(struct hci_le_conn_param_req *evt)
entry->state = BLE_GAP_STATE_U_NEG_REPLY;
}
- ble_hci_ack_set_callback(ble_gap_param_neg_reply_ack, entry);
+ ble_hci_sched_set_ack_cb(ble_gap_param_neg_reply_ack, entry);
host_hci_cmd_le_conn_param_neg_reply(&neg_reply);
}
@@ -2652,7 +2650,7 @@ ble_gap_update_tx(void *arg)
cmd.min_ce_len = entry->params.min_ce_len;
cmd.max_ce_len = entry->params.max_ce_len;
- ble_hci_ack_set_callback(ble_gap_update_ack, entry);
+ ble_hci_sched_set_ack_cb(ble_gap_update_ack, entry);
rc = host_hci_cmd_le_conn_update(&cmd);
if (rc != 0) {
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/ble_hci_ack.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hci_ack.c b/net/nimble/host/src/ble_hci_ack.c
deleted file mode 100644
index 4e9b202..0000000
--- a/net/nimble/host/src/ble_hci_ack.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <stddef.h>
-#include "nimble/ble.h"
-#include "nimble/hci_common.h"
-#include "ble_gap_priv.h"
-#include "ble_hs_conn.h"
-#include "ble_hci_sched.h"
-#include "ble_hci_ack.h"
-
-static ble_hci_ack_fn *ble_hci_ack_cb;
-
-static void *ble_hci_ack_arg;
-
-void
-ble_hci_ack_rx(struct ble_hci_ack *ack)
-{
- ble_hci_ack_fn *cb;
-
- if (ble_hci_ack_cb != NULL) {
- cb = ble_hci_ack_cb;
- ble_hci_ack_cb = NULL;
-
- cb(ack, ble_hci_ack_arg);
- }
-
- ble_hci_sched_transaction_complete();
-}
-
-void
-ble_hci_ack_set_callback(ble_hci_ack_fn *cb, void *arg)
-{
- /* Don't allow the current callback to be replaced with another. */
- assert(ble_hci_ack_cb == NULL || cb == NULL);
-
- ble_hci_ack_cb = cb;
- ble_hci_ack_arg = arg;
-}
-
-void
-ble_hci_ack_init(void)
-{
- ble_hci_ack_set_callback(NULL, NULL);
-}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/ble_hci_ack.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hci_ack.h b/net/nimble/host/src/ble_hci_ack.h
deleted file mode 100644
index e1ee962..0000000
--- a/net/nimble/host/src/ble_hci_ack.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef H_BLE_HCI_ACK_
-#define H_BLE_HCI_ACK_
-
-#include <inttypes.h>
-
-struct ble_hci_ack {
- int bha_status; /* A BLE_HS_E<...> error; NOT a naked HCI code. */
- uint8_t *bha_params;
- int bha_params_len;
- uint16_t bha_opcode;
-};
-
-typedef void ble_hci_ack_fn(struct ble_hci_ack *ack, void *arg);
-
-void ble_hci_ack_rx(struct ble_hci_ack *ack);
-void ble_hci_ack_set_callback(ble_hci_ack_fn *cb, void *arg);
-void ble_hci_ack_init(void);
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/ble_hci_sched.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hci_sched.c b/net/nimble/host/src/ble_hci_sched.c
index 6d84aa9..ded208b 100644
--- a/net/nimble/host/src/ble_hci_sched.c
+++ b/net/nimble/host/src/ble_hci_sched.c
@@ -23,7 +23,6 @@
#include "os/queue.h"
#include "os/os_mempool.h"
#include "ble_hs_priv.h"
-#include "ble_hci_ack.h"
#include "ble_hci_sched.h"
#define BLE_HCI_SCHED_NUM_ENTRIES 8
@@ -42,7 +41,10 @@ static STAILQ_HEAD(, ble_hci_sched_entry) ble_hci_sched_list;
static void *ble_hci_sched_entry_mem;
static struct os_mempool ble_hci_sched_entry_pool;
static struct ble_hci_sched_entry *ble_hci_sched_cur_entry;
-static uint8_t ble_hci_sched_next_handle;
+static uint8_t ble_hci_sched_prev_handle;
+
+static ble_hci_sched_ack_fn *ble_hci_ack_cb;
+static void *ble_hci_ack_arg;
static struct os_mutex ble_hci_sched_mutex;
@@ -143,11 +145,12 @@ ble_hci_sched_new_handle(void)
ble_hci_sched_lock();
- if (ble_hci_sched_next_handle == BLE_HCI_SCHED_HANDLE_NONE) {
- ble_hci_sched_next_handle++;
+ ble_hci_sched_prev_handle++;
+ if (ble_hci_sched_prev_handle == BLE_HCI_SCHED_HANDLE_NONE) {
+ ble_hci_sched_prev_handle++;
}
- handle = ble_hci_sched_next_handle++;
+ handle = ble_hci_sched_prev_handle;
ble_hci_sched_unlock();
@@ -229,7 +232,7 @@ ble_hci_sched_cancel(uint8_t handle)
/* User is cancelling an in-progress operation. */
entry = ble_hci_sched_cur_entry;
ble_hci_sched_cur_entry = NULL;
- ble_hci_ack_set_callback(NULL, NULL);
+ ble_hci_sched_set_ack_cb(NULL, NULL);
do_kick = !STAILQ_EMPTY(&ble_hci_sched_list);
} else {
do_kick = 0;
@@ -376,6 +379,32 @@ ble_hci_sched_transaction_complete(void)
}
}
+void
+ble_hci_sched_rx_ack(struct ble_hci_ack *ack)
+{
+ ble_hci_sched_ack_fn *cb;
+
+ if (ble_hci_ack_cb != NULL) {
+ cb = ble_hci_ack_cb;
+ ble_hci_ack_cb = NULL;
+
+ ack->bha_hci_handle = ble_hci_sched_prev_handle;
+ cb(ack, ble_hci_ack_arg);
+ }
+
+ ble_hci_sched_transaction_complete();
+}
+
+void
+ble_hci_sched_set_ack_cb(ble_hci_sched_ack_fn *cb, void *arg)
+{
+ /* Don't allow the current callback to be replaced with another. */
+ assert(ble_hci_ack_cb == NULL || cb == NULL);
+
+ ble_hci_ack_cb = cb;
+ ble_hci_ack_arg = arg;
+}
+
/**
* Lock restrictions: none.
*/
@@ -423,6 +452,7 @@ ble_hci_sched_init(void)
STAILQ_INIT(&ble_hci_sched_list);
ble_hci_sched_cur_entry = NULL;
+ ble_hci_sched_set_ack_cb(NULL, NULL);
return 0;
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/ble_hci_sched.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hci_sched.h b/net/nimble/host/src/ble_hci_sched.h
index 1a58f0c..01f9478 100644
--- a/net/nimble/host/src/ble_hci_sched.h
+++ b/net/nimble/host/src/ble_hci_sched.h
@@ -22,7 +22,16 @@
#define BLE_HCI_SCHED_HANDLE_NONE 0
+struct ble_hci_ack {
+ int bha_status; /* A BLE_HS_E<...> error; NOT a naked HCI code. */
+ uint8_t *bha_params;
+ int bha_params_len;
+ uint16_t bha_opcode;
+ uint8_t bha_hci_handle;
+};
+
typedef int ble_hci_sched_tx_fn(void *arg);
+typedef void ble_hci_sched_ack_fn(struct ble_hci_ack *ack, void *arg);
int ble_hci_sched_locked_by_cur_task(void);
@@ -31,6 +40,8 @@ int ble_hci_sched_enqueue(ble_hci_sched_tx_fn *tx_cb, void *tx_cb_arg,
int ble_hci_sched_cancel(uint8_t handle);
void ble_hci_sched_wakeup(void);
void ble_hci_sched_transaction_complete(void);
+void ble_hci_sched_rx_ack(struct ble_hci_ack *ack);
+void ble_hci_sched_set_ack_cb(ble_hci_sched_ack_fn *cb, void *arg);
int ble_hci_sched_init(void);
#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/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 ad6b57f..7ea2404 100644
--- a/net/nimble/host/src/ble_hs.c
+++ b/net/nimble/host/src/ble_hs.c
@@ -29,7 +29,6 @@
#include "ble_att_priv.h"
#include "ble_hs_conn.h"
#include "ble_hs_startup.h"
-#include "ble_hci_ack.h"
#include "ble_hci_sched.h"
#include "ble_gap_priv.h"
#ifdef PHONY_TRANSPORT
@@ -285,8 +284,6 @@ ble_hs_init(uint8_t prio, struct ble_hs_cfg *cfg)
goto err;
}
- ble_hci_ack_init();
-
rc = ble_hci_sched_init();
if (rc != 0) {
goto err;
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/ble_hs_startup.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs_startup.c b/net/nimble/host/src/ble_hs_startup.c
index abe2e05..1b85876 100644
--- a/net/nimble/host/src/ble_hs_startup.c
+++ b/net/nimble/host/src/ble_hs_startup.c
@@ -21,7 +21,6 @@
#include <assert.h>
#include "host/host_hci.h"
#include "host/ble_hs.h"
-#include "ble_hci_ack.h"
#include "ble_hci_sched.h"
#include "ble_hs_startup.h"
@@ -124,7 +123,7 @@ ble_hs_startup_le_read_sup_f_tx(void *arg)
assert(ble_hs_startup_state == BLE_HS_STARTUP_STATE_LE_READ_SUP_F);
- ble_hci_ack_set_callback(ble_hs_startup_le_read_sup_f_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_hs_startup_le_read_sup_f_ack, NULL);
rc = host_hci_cmd_le_read_loc_supp_feat();
if (rc != 0) {
return rc;
@@ -172,7 +171,7 @@ ble_hs_startup_le_read_buf_sz_tx(void *arg)
assert(ble_hs_startup_state == BLE_HS_STARTUP_STATE_LE_READ_BUF_SZ);
- ble_hci_ack_set_callback(ble_hs_startup_le_read_buf_size_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_hs_startup_le_read_buf_size_ack, NULL);
rc = host_hci_cmd_le_read_buffer_size();
if (rc != 0) {
return rc;
@@ -188,7 +187,7 @@ ble_hs_startup_le_set_evmask_tx(void *arg)
assert(ble_hs_startup_state == BLE_HS_STARTUP_STATE_LE_SET_EVMASK);
- ble_hci_ack_set_callback(ble_hs_startup_gen_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_hs_startup_gen_ack, NULL);
rc = host_hci_cmd_le_set_event_mask(0x000000000000001f);
if (rc != 0) {
return rc;
@@ -204,7 +203,7 @@ ble_hs_startup_set_evmask_tx(void *arg)
assert(ble_hs_startup_state == BLE_HS_STARTUP_STATE_SET_EVMASK);
- ble_hci_ack_set_callback(ble_hs_startup_gen_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_hs_startup_gen_ack, NULL);
rc = host_hci_cmd_set_event_mask(0x20001fffffffffff);
if (rc != 0) {
return rc;
@@ -220,7 +219,7 @@ ble_hs_startup_reset_tx(void *arg)
assert(ble_hs_startup_state == BLE_HS_STARTUP_STATE_RESET);
- ble_hci_ack_set_callback(ble_hs_startup_gen_ack, NULL);
+ ble_hci_sched_set_ack_cb(ble_hs_startup_gen_ack, NULL);
rc = host_hci_cmd_reset();
if (rc != 0) {
return rc;
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/host_hci.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/host_hci.c b/net/nimble/host/src/host_hci.c
index 6da01b6..adedbc2 100644
--- a/net/nimble/host/src/host_hci.c
+++ b/net/nimble/host/src/host_hci.c
@@ -28,9 +28,9 @@
#include "host/host_hci.h"
#include "ble_hs_priv.h"
#include "host_dbg.h"
+#include "ble_hci_sched.h"
#include "ble_hs_conn.h"
#include "ble_l2cap_priv.h"
-#include "ble_hci_ack.h"
#include "ble_gap_priv.h"
#include "ble_hs_adv_priv.h"
@@ -170,7 +170,7 @@ host_hci_timer_exp(void *arg)
ack.bha_params_len = 0;
host_hci_outstanding_opcode = 0;
- ble_hci_ack_rx(&ack);
+ ble_hci_sched_rx_ack(&ack);
}
@@ -234,7 +234,7 @@ host_hci_rx_cmd_complete(uint8_t event_code, uint8_t *data, int len)
ack.bha_status = BLE_HS_ECONTROLLER;
}
- ble_hci_ack_rx(&ack);
+ ble_hci_sched_rx_ack(&ack);
return 0;
}
@@ -278,7 +278,7 @@ host_hci_rx_cmd_status(uint8_t event_code, uint8_t *data, int len)
ack.bha_params_len = 0;
ack.bha_status = BLE_HS_HCI_ERR(status);
- ble_hci_ack_rx(&ack);
+ ble_hci_sched_rx_ack(&ack);
return 0;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/host_hci_cmd.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/host_hci_cmd.c b/net/nimble/host/src/host_hci_cmd.c
index 42b5af8..958b72f 100644
--- a/net/nimble/host/src/host_hci_cmd.c
+++ b/net/nimble/host/src/host_hci_cmd.c
@@ -28,7 +28,6 @@
#include "ble_hs_priv.h"
#include "host/host_hci.h"
#include "host_dbg.h"
-#include "ble_hci_ack.h"
#include "ble_hs_conn.h"
#include "ble_l2cap_priv.h"
#ifdef PHONY_TRANSPORT
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/test/ble_hs_adv_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/test/ble_hs_adv_test.c b/net/nimble/host/src/test/ble_hs_adv_test.c
index 1e2e61d..f5e556d 100644
--- a/net/nimble/host/src/test/ble_hs_adv_test.c
+++ b/net/nimble/host/src/test/ble_hs_adv_test.c
@@ -28,7 +28,6 @@
#include "ble_att_priv.h"
#include "ble_hs_conn.h"
#include "ble_hs_adv_priv.h"
-#include "ble_hci_ack.h"
#include "ble_hci_sched.h"
#include "ble_gap_priv.h"
#include "ble_hs_test_util.h"
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/test/ble_hs_conn_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/test/ble_hs_conn_test.c b/net/nimble/host/src/test/ble_hs_conn_test.c
index 0de575a..5bea8e0 100644
--- a/net/nimble/host/src/test/ble_hs_conn_test.c
+++ b/net/nimble/host/src/test/ble_hs_conn_test.c
@@ -27,7 +27,6 @@
#include "ble_l2cap_priv.h"
#include "ble_att_priv.h"
#include "ble_hs_conn.h"
-#include "ble_hci_ack.h"
#include "ble_hci_sched.h"
#include "ble_gap_priv.h"
#include "ble_hs_test_util.h"
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/net/nimble/host/src/test/ble_hs_test_util.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/test/ble_hs_test_util.c b/net/nimble/host/src/test/ble_hs_test_util.c
index ea5e06b..8b90430 100644
--- a/net/nimble/host/src/test/ble_hs_test_util.c
+++ b/net/nimble/host/src/test/ble_hs_test_util.c
@@ -25,7 +25,6 @@
#include "testutil/testutil.h"
#include "host/host_hci.h"
#include "ble_hs_priv.h"
-#include "ble_hci_ack.h"
#include "ble_hci_sched.h"
#include "ble_hs_conn.h"
#include "ble_gap_priv.h"
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef84dcf1/project/bletiny/src/main.c
----------------------------------------------------------------------
diff --git a/project/bletiny/src/main.c b/project/bletiny/src/main.c
index 1d68c06..4123f07 100755
--- a/project/bletiny/src/main.c
+++ b/project/bletiny/src/main.c
@@ -41,7 +41,6 @@
#include "host/ble_gatt.h"
#include "controller/ble_ll.h"
#include "../src/ble_hs_conn.h"
-#include "../src/ble_hci_ack.h"
#include "../src/ble_hci_sched.h"
#define BSWAP16(x) ((uint16_t)(((x) << 8) | (((x) & 0xff00) >> 8)))
@@ -1270,11 +1269,10 @@ bletiny_tx_rssi_req(void *arg)
conn_handle = (intptr_t)arg;
- ble_hci_ack_set_callback(bletiny_on_rx_rssi, NULL);
+ ble_hci_sched_set_ack_cb(bletiny_on_rx_rssi, NULL);
rc = host_hci_cmd_read_rssi(conn_handle);
if (rc != 0) {
- ble_hci_ack_set_callback(NULL, NULL);
BLETINY_LOG(ERROR, "failure to send rssi hci cmd; rc=%d\n", rc);
return rc;
}