src: use new libosmogsm and include/osmocom/[gsm|core] path to headers
[osmocom-bb.git] / src / host / layer23 / src / mobile / app_mobile.c
index 822ea64..33fdde6 100644 (file)
 #include <osmocom/bb/mobile/mncc.h>
 #include <osmocom/vty/telnet_interface.h>
 
-#include <osmocore/msgb.h>
-#include <osmocore/talloc.h>
-#include <osmocore/select.h>
-#include <osmocore/signal.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/select.h>
+#include <osmocom/core/signal.h>
 
 extern void *l23_ctx;
 extern struct llist_head ms_list;
@@ -333,7 +333,7 @@ int l23_app_exit(void)
        unregister_signal_handler(SS_L1CTL, &mobile_signal_cb, NULL);
        unregister_signal_handler(SS_GLOBAL, &global_signal_cb, NULL);
 
-       gps_close();
+       osmo_gps_close();
 
        return 0;
 }
@@ -349,23 +349,25 @@ int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *),
        const char *config_file, uint16_t vty_port)
 {
        struct telnet_connection dummy_conn;
-       int rc;
+       int rc = 0;
 
        mncc_recv_app = mncc_recv;
 
-       gps_init();
+       osmo_gps_init();
 
        vty_init(&vty_info);
        ms_vty_init();
        dummy_conn.priv = NULL;
        vty_reading = 1;
-       rc = vty_read_config_file(config_file, &dummy_conn);
-       if (rc < 0) {
-               fprintf(stderr, "Failed to parse the config file: '%s'\n",
-                       config_file);
-               fprintf(stderr, "Please check or create config file using: "
-                       "'touch %s'\n", config_file);
-               return rc;
+       if (config_file != NULL) {
+               rc = vty_read_config_file(config_file, &dummy_conn);
+               if (rc < 0) {
+                       fprintf(stderr, "Failed to parse the config file:"
+                                       " '%s'\n", config_file);
+                       fprintf(stderr, "Please check or create config file"
+                                       " using: 'touch %s'\n", config_file);
+                       return rc;
+               }
        }
        vty_reading = 0;
        telnet_init(l23_ctx, NULL, vty_port);