BLE apps - Update for latest HCI transport changes
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/c483e822 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/c483e822 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/c483e822 Branch: refs/heads/develop Commit: c483e82226001714213fa57227a4d79625133ef3 Parents: f892249 Author: Christopher Collins <[email protected]> Authored: Thu Aug 4 16:31:33 2016 -0700 Committer: Christopher Collins <[email protected]> Committed: Thu Aug 4 16:31:33 2016 -0700 ---------------------------------------------------------------------- apps/bleprph/src/main.c | 7 ++++--- apps/bletest/src/main.c | 3 +++ apps/bletiny/src/main.c | 4 ++-- apps/bleuart/src/main.c | 17 ++++++++++++----- 4 files changed, 21 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c483e822/apps/bleprph/src/main.c ---------------------------------------------------------------------- diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c index cff4763..9d75a66 100755 --- a/apps/bleprph/src/main.c +++ b/apps/bleprph/src/main.c @@ -390,6 +390,10 @@ main(void) rc = ble_ll_init(BLE_LL_TASK_PRI, MBUF_NUM_MBUFS, BLE_MBUF_PAYLOAD_SIZE); assert(rc == 0); + /* Initialize the RAM HCI transport. */ + rc = ble_hci_ram_init(&ble_hci_ram_cfg_dflt); + assert(rc == 0); + /* Initialize the NimBLE host configuration. */ cfg = ble_hs_cfg_dflt; cfg.max_gattc_procs = 2; @@ -419,9 +423,6 @@ main(void) rc = ble_hs_init(&bleprph_evq, &cfg); assert(rc == 0); - rc = ble_hci_ram_init(&ble_hci_ram_cfg_dflt); - assert(rc == 0); - nmgr_task_init(NEWTMGR_TASK_PRIO, newtmgr_stack, NEWTMGR_TASK_STACK_SIZE); imgmgr_module_init(); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c483e822/apps/bletest/src/main.c ---------------------------------------------------------------------- diff --git a/apps/bletest/src/main.c b/apps/bletest/src/main.c index be0cf6d..c2635dd 100755 --- a/apps/bletest/src/main.c +++ b/apps/bletest/src/main.c @@ -44,6 +44,8 @@ #include "controller/ble_ll_conn.h" #include "controller/ble_ll_scan.h" #include "controller/ble_ll_adv.h" + +/* RAM HCI transport. */ #include "transport/ram/ble_hci_ram.h" /* XXX: An app should not include private headers from a library. The bletest @@ -1154,6 +1156,7 @@ main(void) rc = ble_hs_init(&g_bletest_evq, NULL); assert(rc == 0); + /* Initialize the RAM HCI transport. */ rc = ble_hci_ram_init(&ble_hci_ram_cfg_dflt); assert(rc == 0); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c483e822/apps/bletiny/src/main.c ---------------------------------------------------------------------- diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c index 38ee467..dbb340b 100755 --- a/apps/bletiny/src/main.c +++ b/apps/bletiny/src/main.c @@ -45,6 +45,8 @@ #include "host/ble_gatt.h" #include "host/ble_store.h" #include "host/ble_sm.h" + +/* RAM HCI transport. */ #include "transport/ram/ble_hci_ram.h" /* RAM persistence layer. */ @@ -1697,13 +1699,11 @@ main(void) /* Initialize the RAM HCI transport. */ hci_cfg = ble_hci_ram_cfg_dflt; - hci_cfg.num_evt_bufs = 3; rc = ble_hci_ram_init(&hci_cfg); assert(rc == 0); /* Initialize the NimBLE host configuration. */ cfg = ble_hs_cfg_dflt; - cfg.max_hci_bufs = hci_cfg.num_evt_bufs; cfg.max_gattc_procs = 2; cfg.reset_cb = bletiny_on_reset; cfg.store_read_cb = ble_store_ram_read; http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c483e822/apps/bleuart/src/main.c ---------------------------------------------------------------------- diff --git a/apps/bleuart/src/main.c b/apps/bleuart/src/main.c index f7c7714..a530195 100755 --- a/apps/bleuart/src/main.c +++ b/apps/bleuart/src/main.c @@ -39,10 +39,9 @@ #include "host/ble_l2cap.h" #include "host/ble_sm.h" #include "controller/ble_ll.h" -/* Newtmgr include */ -#include "newtmgr/newtmgr.h" -#include "nmgrble/newtmgr_ble.h" -#include "bleuart/bleuart.h" + +/* RAM HCI transport. */ +#include "transport/ram/ble_hci_ram.h" /* RAM persistence layer. */ #include "store/ram/ble_store_ram.h" @@ -51,6 +50,11 @@ #include "services/mandatory/ble_svc_gap.h" #include "services/mandatory/ble_svc_gatt.h" +/* Newtmgr include */ +#include "newtmgr/newtmgr.h" +#include "nmgrble/newtmgr_ble.h" +#include "bleuart/bleuart.h" + /** Mbuf settings. */ #define MBUF_NUM_MBUFS (12) #define MBUF_BUF_SIZE OS_ALIGN(BLE_MBUF_PAYLOAD_SIZE, 4) @@ -292,9 +296,12 @@ main(void) rc = ble_ll_init(BLE_LL_TASK_PRI, MBUF_NUM_MBUFS, BLE_MBUF_PAYLOAD_SIZE); assert(rc == 0); + /* Initialize the RAM HCI transport. */ + rc = ble_hci_ram_init(&ble_hci_ram_cfg_dflt); + assert(rc == 0); + /* Initialize the BLE host. */ cfg = ble_hs_cfg_dflt; - cfg.max_hci_bufs = 3; cfg.max_connections = 1; cfg.max_gattc_procs = 2; cfg.max_l2cap_chans = 3;
