aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_rf_ctrl.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-16 14:29:53 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-01-15 11:27:28 +0100
commit7b6ea56f4185a7c11b7ba50ee373854ca2074368 (patch)
treeec3e1e00c742119a22e660c965d9af717e51f8e1 /openbsc/src/libbsc/bsc_rf_ctrl.c
parentbaa1a2df2086b1c920053c1aaa6062929f2256e4 (diff)
bsc: Use the BSC RF CTRL to change the RF state of the TRXs
Use the delayed scheduling feature of the osmo_bsc_rf class to avoid crashing the site controller of the nanoBTS.
Diffstat (limited to 'openbsc/src/libbsc/bsc_rf_ctrl.c')
-rw-r--r--openbsc/src/libbsc/bsc_rf_ctrl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/openbsc/src/libbsc/bsc_rf_ctrl.c
index 2744666b..89a0246b 100644
--- a/openbsc/src/libbsc/bsc_rf_ctrl.c
+++ b/openbsc/src/libbsc/bsc_rf_ctrl.c
@@ -303,9 +303,7 @@ static int rf_read_cmd(struct osmo_fd *fd)
case RF_CMD_D_OFF:
case RF_CMD_ON:
case RF_CMD_OFF:
- conn->rf->last_request = buf[0];
- if (!osmo_timer_pending(&conn->rf->delay_cmd))
- osmo_timer_schedule(&conn->rf->delay_cmd, 1, 0);
+ osmo_bsc_rf_schedule_lock(conn->rf, buf[0]);
break;
default:
conn->rf->last_state_command = "Unknown command";
@@ -449,3 +447,9 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net
return rf;
}
+void osmo_bsc_rf_schedule_lock(struct osmo_bsc_rf *rf, char cmd)
+{
+ rf->last_request = cmd;
+ if (!osmo_timer_pending(&rf->delay_cmd))
+ osmo_timer_schedule(&rf->delay_cmd, 1, 0);
+}