summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2011-12-01 12:11:40 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2016-09-25 08:11:47 +0200
commit4ddd47a80422a540306ff6992599bc77f52a2c84 (patch)
tree24e0099b7409c85bfd1963b2c8d822464d958dfd /src/host/layer23/include
parent958292f3a4024c54115035cb3379e301168fbfde (diff)
layer23/mobile: Adding user interface to mobile application
Enable it in the VTY: en conf t ms 1 user-interface telnet-port 4248 write It will show a status screen. Different items to display in the status screen can be enabled/disabled via configuration. Dialing and handling of one or multiple calls are possible. This interface is not complete.
Diffstat (limited to 'src/host/layer23/include')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/osmocom_data.h2
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/Makefile.am2
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gui.h50
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/settings.h4
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/vty.h4
5 files changed, 60 insertions, 2 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
index d42cf09b..191fb96d 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -19,6 +19,7 @@ struct osmocom_ms;
#include <osmocom/bb/mobile/gsm48_mm.h>
#include <osmocom/bb/mobile/gsm48_cc.h>
#include <osmocom/bb/mobile/mncc_sock.h>
+#include <osmocom/bb/mobile/gui.h>
#include <osmocom/bb/common/sim.h>
#include <osmocom/bb/common/l1ctl.h>
@@ -78,6 +79,7 @@ struct osmocom_ms {
struct gsm48_cclayer cclayer;
struct osmomncc_entity mncc_entity;
struct llist_head trans_list;
+ struct gsm_ui gui;
};
enum osmobb_sig_subsys {
diff --git a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
index 6adb6991..38a5b4e6 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
@@ -1,3 +1,3 @@
noinst_HEADERS = gsm322.h gsm480_ss.h gsm411_sms.h gsm48_cc.h gsm48_mm.h \
gsm48_rr.h mncc.h settings.h subscriber.h support.h \
- transaction.h vty.h mncc_sock.h mnccms.h
+ transaction.h vty.h mncc_sock.h mnccms.h gui.h
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gui.h b/src/host/layer23/include/osmocom/bb/mobile/gui.h
new file mode 100644
index 00000000..a67044d8
--- /dev/null
+++ b/src/host/layer23/include/osmocom/bb/mobile/gui.h
@@ -0,0 +1,50 @@
+#ifndef _gui_h
+#define _gui_h
+
+#include <osmocom/bb/ui/ui.h>
+
+struct status_screen {
+ const char *feature;
+ const char *feature_vty;
+ const char *feature_help;
+ int default_en;
+ int lines;
+ int (*display_func)(struct osmocom_ms *ms,
+ char *text);
+};
+
+extern struct status_screen status_screen[];
+
+#define GUI_NUM_STATUS 9 /* number of status infos */
+#define GUI_NUM_STATUS_LINES 32 /* total number of lines of all status infos */
+
+struct gsm_ui {
+ struct ui_inst ui; /* user interface instance */
+ int menu; /* current menu */
+ const char *status_lines[GUI_NUM_STATUS_LINES];
+ /* list of status lines */
+ char status_text[GUI_NUM_STATUS_LINES * (UI_COLS + 1) + 128];
+ /* memory for status lines (extra 128 bytes
+ * in case of overflow */
+ struct osmo_timer_list timer;
+ /* refresh timer */
+ char dialing[33]; /* dailing buffer */
+ int selected_call; /* call that is selected */
+
+ /* select menus */
+ void *select_menu; /* current menu */
+ void *choose_menu; /* current choose item in menu */
+
+ /* supserv */
+ int ss_lines; /* number of lines we display */
+ int ss_pending, ss_active;
+ /* state of transaction */
+};
+
+void gui_init_status_config(void);
+int gui_start(struct osmocom_ms *ms);
+int gui_stop(struct osmocom_ms *ms);
+int gui_notify_call(struct osmocom_ms *ms);
+int gui_notify_ss(struct osmocom_ms *ms, const char *fmt, ...);
+
+#endif /* _gui_h */
diff --git a/src/host/layer23/include/osmocom/bb/mobile/settings.h b/src/host/layer23/include/osmocom/bb/mobile/settings.h
index 37f87873..b5f25e83 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/settings.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/settings.h
@@ -104,6 +104,10 @@ struct gsm_settings {
/* Ring tone */
uint8_t ringtone; /* 0 = off */
+
+ /* UI */
+ uint16_t ui_port; /* telnet port: 0, if disabled */
+ uint32_t status_enable; /* status display flags */
};
struct gsm_settings_abbrev {
diff --git a/src/host/layer23/include/osmocom/bb/mobile/vty.h b/src/host/layer23/include/osmocom/bb/mobile/vty.h
index 1f1341bc..d59853fd 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/vty.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/vty.h
@@ -10,10 +10,12 @@ enum ms_vty_node {
MS_NODE = _LAST_OSMOVTY_NODE + 1,
TESTSIM_NODE,
SUPPORT_NODE,
+ UI_NODE,
};
enum node_type ms_vty_go_parent(struct vty *vty);
-int ms_vty_init(void);
+int ms_vty_init(void *tall_ctx);
+void ms_vty_exit(void);
extern void vty_notify(struct osmocom_ms *ms, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
#endif