mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vipulrah...@apache.org
Subject [13/50] incubator-mynewt-core git commit: No jira ticket. BLETEST role is now a syscfg variable.
Date Thu, 23 Feb 2017 22:33:07 GMT
No jira ticket. BLETEST role is now a syscfg variable.


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/f299c85b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/f299c85b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/f299c85b

Branch: refs/heads/sensors_branch
Commit: f299c85b183053280d94cb3f7f74ac371e720201
Parents: d61c6cd
Author: William San Filippo <wills@runtime.io>
Authored: Mon Feb 13 10:59:48 2017 -0800
Committer: William San Filippo <wills@runtime.io>
Committed: Mon Feb 13 11:01:11 2017 -0800

----------------------------------------------------------------------
 apps/bletest/src/main.c | 23 +++++++++++++++++------
 apps/bletest/syscfg.yml |  8 ++++++++
 2 files changed, 25 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f299c85b/apps/bletest/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletest/src/main.c b/apps/bletest/src/main.c
index d56ec2b..e2519eb 100755
--- a/apps/bletest/src/main.c
+++ b/apps/bletest/src/main.c
@@ -62,13 +62,24 @@ uint8_t g_host_adv_data[BLE_HCI_MAX_ADV_DATA_LEN];
 uint8_t g_host_adv_len;
 
 /* Some application configurations */
-#define BLETEST_ROLE_ADVERTISER         (0)
-#define BLETEST_ROLE_SCANNER            (1)
-#define BLETEST_ROLE_INITIATOR          (2)
+#define BLETEST_ROLE_NONE               (0)
+#define BLETEST_ROLE_ADVERTISER         (1)
+#define BLETEST_ROLE_SCANNER            (2)
+#define BLETEST_ROLE_INITIATOR          (3)
 
-#define BLETEST_CFG_ROLE                (BLETEST_ROLE_INITIATOR)
-//#define BLETEST_CFG_ROLE                (BLETEST_ROLE_ADVERTISER)
-//#define BLETEST_CFG_ROLE                (BLETEST_ROLE_SCANNER)
+#if MYNEWT_VAL(BLETEST_ROLE) == BLETEST_ROLE_ADVERTISER
+#define BLETEST_CFG_ROLE                BLETEST_ROLE_ADVERTISER
+#endif
+#if MYNEWT_VAL(BLETEST_ROLE) == BLETEST_ROLE_SCANNER
+#define BLETEST_CFG_ROLE                BLETEST_ROLE_SCANNER
+#endif
+#if MYNEWT_VAL(BLETEST_ROLE) == BLETEST_ROLE_INITIATOR
+#define BLETEST_CFG_ROLE                BLETEST_ROLE_INITIATOR
+#endif
+
+#ifndef BLETEST_CFG_ROLE
+#error "No role defined! Must define a valid role in syscfg.yml in apps/bletest"
+#endif
 
 /* Advertiser config */
 #define BLETEST_CFG_ADV_OWN_ADDR_TYPE   (BLE_HCI_ADV_OWN_ADDR_PUBLIC)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f299c85b/apps/bletest/syscfg.yml
----------------------------------------------------------------------
diff --git a/apps/bletest/syscfg.yml b/apps/bletest/syscfg.yml
index e769374..ba44607 100644
--- a/apps/bletest/syscfg.yml
+++ b/apps/bletest/syscfg.yml
@@ -17,6 +17,14 @@
 #
 
 # Package: apps/bletest
+syscfg.defs:
+    BLETEST_ROLE:
+        description: >
+            The role of the bletest code. Should be set to:
+                1: Advertiser
+                2: Scanner
+                3: Initiator
+        value: 1
 
 syscfg.vals:
     MSYS_1_BLOCK_COUNT: 16


Mime
View raw message