Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5CD28200B80 for ; Wed, 10 Aug 2016 04:12:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5B8B8160AA5; Wed, 10 Aug 2016 02:12:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7FA49160AB0 for ; Wed, 10 Aug 2016 04:11:59 +0200 (CEST) Received: (qmail 33486 invoked by uid 500); 10 Aug 2016 02:11:58 -0000 Mailing-List: contact commits-help@mynewt.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mynewt.incubator.apache.org Delivered-To: mailing list commits@mynewt.incubator.apache.org Received: (qmail 33477 invoked by uid 99); 10 Aug 2016 02:11:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Aug 2016 02:11:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id F26831A01CC for ; Wed, 10 Aug 2016 02:11:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id CsXlCf34tKMw for ; Wed, 10 Aug 2016 02:11:56 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id EF5485FBB5 for ; Wed, 10 Aug 2016 02:11:55 +0000 (UTC) Received: (qmail 33242 invoked by uid 99); 10 Aug 2016 02:11:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Aug 2016 02:11:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C548AE69AE; Wed, 10 Aug 2016 02:11:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ccollins@apache.org To: commits@mynewt.incubator.apache.org Date: Wed, 10 Aug 2016 02:12:01 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [8/8] incubator-mynewt-core git commit: BLE apps - Base ble_hs max_hci setting on HCI cfg. archived-at: Wed, 10 Aug 2016 02:12:00 -0000 BLE apps - Base ble_hs max_hci setting on HCI cfg. The host should be configured to allocate the same number of OS events as there are HCI event buffers. This commit changes the sample apps to use the RAM transport's configuration to determine how many OS events to configure the host with. 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/1e9bbc28 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1e9bbc28 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1e9bbc28 Branch: refs/heads/develop Commit: 1e9bbc2860e38c88d63a1504b6724f175ddd6def Parents: 8b8d887 Author: Christopher Collins Authored: Tue Aug 9 17:56:52 2016 -0700 Committer: Christopher Collins Committed: Tue Aug 9 18:00:31 2016 -0700 ---------------------------------------------------------------------- apps/blecent/src/main.c | 6 ++++-- apps/bleprph/src/main.c | 5 ++++- apps/bletiny/src/main.c | 1 + apps/bleuart/src/main.c | 6 ++++-- 4 files changed, 13 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1e9bbc28/apps/blecent/src/main.c ---------------------------------------------------------------------- diff --git a/apps/blecent/src/main.c b/apps/blecent/src/main.c index 66a4e3f..2b89a11 100755 --- a/apps/blecent/src/main.c +++ b/apps/blecent/src/main.c @@ -508,6 +508,7 @@ blecent_task_handler(void *unused) int main(void) { + struct ble_hci_ram_cfg hci_cfg; struct ble_hs_cfg cfg; uint32_t seed; int rc; @@ -567,12 +568,13 @@ main(void) assert(rc == 0); /* Initialize the RAM HCI transport. */ - rc = ble_hci_ram_init(&ble_hci_ram_cfg_dflt); + hci_cfg = ble_hci_ram_cfg_dflt; + rc = ble_hci_ram_init(&hci_cfg); assert(rc == 0); /* Configure the host. */ cfg = ble_hs_cfg_dflt; - cfg.max_hci_bufs = 3; + cfg.max_hci_bufs = hci_cfg.num_evt_hi_bufs + hci_cfg.num_evt_lo_bufs; cfg.max_gattc_procs = 5; cfg.sm_bonding = 1; cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC; http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1e9bbc28/apps/bleprph/src/main.c ---------------------------------------------------------------------- diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c index 9d75a66..961ed4b 100755 --- a/apps/bleprph/src/main.c +++ b/apps/bleprph/src/main.c @@ -332,6 +332,7 @@ bleprph_task_handler(void *unused) int main(void) { + struct ble_hci_ram_cfg hci_cfg; struct ble_hs_cfg cfg; uint32_t seed; int rc; @@ -391,11 +392,13 @@ main(void) assert(rc == 0); /* Initialize the RAM HCI transport. */ - rc = ble_hci_ram_init(&ble_hci_ram_cfg_dflt); + hci_cfg = ble_hci_ram_cfg_dflt; + 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_hi_bufs + hci_cfg.num_evt_lo_bufs; cfg.max_gattc_procs = 2; cfg.sm_bonding = 1; cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC; http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1e9bbc28/apps/bletiny/src/main.c ---------------------------------------------------------------------- diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c index dbb340b..f2941e7 100755 --- a/apps/bletiny/src/main.c +++ b/apps/bletiny/src/main.c @@ -1704,6 +1704,7 @@ main(void) /* Initialize the NimBLE host configuration. */ cfg = ble_hs_cfg_dflt; + cfg.max_hci_bufs = hci_cfg.num_evt_hi_bufs + hci_cfg.num_evt_lo_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/1e9bbc28/apps/bleuart/src/main.c ---------------------------------------------------------------------- diff --git a/apps/bleuart/src/main.c b/apps/bleuart/src/main.c index a530195..061ab3b 100755 --- a/apps/bleuart/src/main.c +++ b/apps/bleuart/src/main.c @@ -253,6 +253,7 @@ bleuart_task_handler(void *unused) int main(void) { + struct ble_hci_ram_cfg hci_cfg; struct ble_hs_cfg cfg; uint32_t seed; int rc; @@ -297,11 +298,13 @@ main(void) assert(rc == 0); /* Initialize the RAM HCI transport. */ - rc = ble_hci_ram_init(&ble_hci_ram_cfg_dflt); + hci_cfg = ble_hci_ram_cfg_dflt; + rc = ble_hci_ram_init(&hci_cfg); assert(rc == 0); /* Initialize the BLE host. */ cfg = ble_hs_cfg_dflt; + cfg.max_hci_bufs = hci_cfg.num_evt_hi_bufs + hci_cfg.num_evt_lo_bufs; cfg.max_connections = 1; cfg.max_gattc_procs = 2; cfg.max_l2cap_chans = 3; @@ -334,7 +337,6 @@ main(void) rc = nmgr_ble_gatt_svr_init(&bleuart_evq, &cfg); assert(rc == 0); - rc = ble_hs_init(&bleuart_evq, &cfg); assert(rc == 0);