aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-14 22:34:47 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-14 22:34:47 +0100
commitb5bb75fbfd3bc41675f82e5d4a6daf2312820111 (patch)
tree0dd19efc4fe7f76b0cfc428f27ecf34954a07d99
parentaf5b88fb0786f8767f9aa7c5082048763a995136 (diff)
rf: Remember the last command requested on the RF CMD interface
-rw-r--r--openbsc/include/openbsc/osmo_bsc_rf.h2
-rw-r--r--openbsc/src/osmo_bsc_rf.c5
-rw-r--r--openbsc/src/vty_interface.c5
3 files changed, 12 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/openbsc/include/openbsc/osmo_bsc_rf.h
index 7039dbdce..e34abaec3 100644
--- a/openbsc/include/openbsc/osmo_bsc_rf.h
+++ b/openbsc/include/openbsc/osmo_bsc_rf.h
@@ -12,6 +12,8 @@ struct osmo_bsc_rf {
struct bsc_fd listen;
struct gsm_network *gsm_network;
+ const char *last_state_command;
+
/* some handling for the automatic grace switch */
struct timer_list grace_timeout;
};
diff --git a/openbsc/src/osmo_bsc_rf.c b/openbsc/src/osmo_bsc_rf.c
index 81797ccf3..e6b31c71f 100644
--- a/openbsc/src/osmo_bsc_rf.c
+++ b/openbsc/src/osmo_bsc_rf.c
@@ -166,18 +166,22 @@ static int rf_read_cmd(struct bsc_fd *fd)
handle_query(conn);
break;
case RF_CMD_D_OFF:
+ conn->rf->last_state_command = "RF Direct Off";
bsc_del_timer(&conn->rf->grace_timeout);
switch_rf_off(conn->rf);
break;
case RF_CMD_ON:
+ conn->rf->last_state_command = "RF Direct On";
bsc_del_timer(&conn->rf->grace_timeout);
lock_each_trx(conn->rf->gsm_network, 0);
send_signal(conn->rf, S_RF_ON);
break;
case RF_CMD_OFF:
+ conn->rf->last_state_command = "RF Scheduled Off";
enter_grace(conn);
break;
default:
+ conn->rf->last_state_command = "Unknown command";
LOGP(DINP, LOGL_ERROR, "Unknown command %d\n", buf[0]);
break;
}
@@ -305,6 +309,7 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net
rf->gsm_network = net;
rf->policy = S_RF_ON;
+ rf->last_state_command = "";
return rf;
}
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index a1823f551..8c97d9a32 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -42,6 +42,7 @@
#include <openbsc/vty.h>
#include <openbsc/ipaccess.h>
#include <openbsc/paging.h>
+#include <openbsc/osmo_bsc_rf.h>
static struct gsm_network *gsmnet;
@@ -164,6 +165,10 @@ static void net_dump_vty(struct vty *vty, struct gsm_network *net)
vty_out(vty, "hr: %d ver: %d, ",
net->audio_support[i]->hr, net->audio_support[i]->ver);
vty_out(vty, "%s", VTY_NEWLINE);
+
+ /* show rf */
+ vty_out(vty, " Last RF Command: %s%s",
+ net->rf->last_state_command, VTY_NEWLINE);
}
DEFUN(show_net, show_net_cmd, "show network",