aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-21 23:27:16 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-21 23:55:27 +0200
commite02d7796c3cb4eaeca679286bc6db12b9b2c070b (patch)
tree0402d6fa1ec499c619dd08606d431681280d69c9
parent714ccb9992307112689d63493fada72cf1a6224b (diff)
sysmobts: Show the current temperature controls state int he VTY
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr.h1
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c5
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c2
3 files changed, 8 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr.h b/src/osmo-bts-sysmo/misc/sysmobts_mgr.h
index 17a81cc..fd6f2bc 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr.h
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr.h
@@ -66,5 +66,6 @@ int sysmobts_mgr_vty_init(void);
int sysmobts_mgr_parse_config(struct sysmobts_mgr_instance *mgr);
int sysmobts_mgr_nl_init(void);
int sysmobts_mgr_temp_init(struct sysmobts_mgr_instance *mgr);
+const char *sysmobts_mgr_temp_get_state(enum sysmobts_temp_state state);
#endif
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
index 7407f74..d3a4628 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
@@ -39,6 +39,11 @@ static const struct value_string state_names[] = {
{ 0, NULL }
};
+const char *sysmobts_mgr_temp_get_state(enum sysmobts_temp_state state)
+{
+ return get_value_string(state_names, state);
+}
+
static int next_state(enum sysmobts_temp_state current_state, int critical, int warning)
{
int next_state = -1;
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c
index 4216070..4ed582b 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c
@@ -242,6 +242,8 @@ CFG_ACTION(critical, "Critical Actions\n", ACT_CRIT_NODE, action_crit)
DEFUN(show_mgr, show_mgr_cmd, "show manager",
SHOW_STR "Display information about the manager")
{
+ vty_out(vty, "Temperature control state: %s%s",
+ sysmobts_mgr_temp_get_state(s_mgr->state), VTY_NEWLINE);
vty_out(vty, "Current Temperatures%s", VTY_NEWLINE);
vty_out(vty, " Digital: %f Celcius%s",
sysmobts_temp_get(SYSMOBTS_TEMP_DIGITAL,