You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/02/16 08:16:15 UTC

[mynewt-nimble] 03/04: apps/blehci: Add support for BabbleSim

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit d81f0708339ce2a8a5c7b6dfc8a1fbc0091be6b6
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Sun Feb 13 19:30:49 2022 +0100

    apps/blehci: Add support for BabbleSim
---
 apps/blehci/src/main.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/apps/blehci/src/main.c b/apps/blehci/src/main.c
index 040c157..e97e542 100644
--- a/apps/blehci/src/main.c
+++ b/apps/blehci/src/main.c
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-#include <assert.h>
 #include "os/mynewt.h"
 
-int
-main(void)
+static int
+main_fn(int argc, char **argv)
 {
     /* Initialize OS */
     sysinit();
@@ -31,3 +30,16 @@ main(void)
     }
     return 0;
 }
+
+int
+main(int argc, char **argv)
+{
+#if BABBLESIM
+    extern void bsim_init(int argc, char** argv, void *main_fn);
+    bsim_init(argc, argv, main_fn);
+#else
+    main_fn(argc, argv);
+#endif
+
+    return 0;
+}
\ No newline at end of file