You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/11/01 19:18:16 UTC

[2/2] incubator-mynewt-core git commit: oicmgr; call oc_main_init() before os starts. Need to start BLE host package when using ble as transport.

oicmgr; call oc_main_init() before os starts. Need to start BLE host
package when using ble as transport.


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

Branch: refs/heads/develop
Commit: ae2b85bf73474ee7f868a488cd7dc817b88ae1a0
Parents: a560068
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Nov 1 12:06:41 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Nov 1 12:11:52 2016 -0700

----------------------------------------------------------------------
 mgmt/oicmgr/src/oicmgr.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ae2b85bf/mgmt/oicmgr/src/oicmgr.c
----------------------------------------------------------------------
diff --git a/mgmt/oicmgr/src/oicmgr.c b/mgmt/oicmgr/src/oicmgr.c
index ebd7266..eccec6b 100644
--- a/mgmt/oicmgr/src/oicmgr.c
+++ b/mgmt/oicmgr/src/oicmgr.c
@@ -29,6 +29,10 @@
 #include <mgmt/mgmt.h>
 #include <nmgr_os/nmgr_os.h>
 
+#if (MYNEWT_VAL(OC_TRANSPORT_GATT) == 1)
+#include "host/ble_hs.h"
+#endif
+
 #include <cborattr/cborattr.h>
 #include <tinycbor/cbor.h>
 #include <tinycbor/cbor_buf_writer.h>
@@ -238,6 +242,12 @@ omgr_oic_process_oc_event(struct os_event *ev)
 {
     struct omgr_state *o = &omgr_state;
     os_time_t next_event;
+#if MYNEWT_VAL(OC_TRANSPORT_GATT)
+    int rc;
+
+    rc = ble_hs_start();
+    assert(rc == 0);
+#endif
 
     next_event = oc_main_poll();
     if (next_event) {
@@ -275,6 +285,8 @@ oicmgr_init(void)
         goto err;
     }
 
+    oc_main_init((oc_handler_t *)&omgr_oc_handler);
+
     return (0);
 err:
     return (rc);