diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-16 20:20:27 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-16 20:22:28 +0100 |
commit | c265bef48c414ca6c135f803c0c5dfdecbeece72 (patch) | |
tree | 2f36f0aa572f26629edd669917ee3664e8ff4332 /src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c | |
parent | 02a2afa962799c1519eb78cffa8877fd3da75b2e (diff) |
sysmobts: Add slave on/off action for the sysmoBTS2050
Add new power actions for the sysmoBTS2050. This allows to
switch off the secondary/slave when the system temperature
is too high and back on when the normal level is reached.
Do not allow to switch off the master (so remove the enum
value), do not check if the slave is switching itself off.
Diffstat (limited to 'src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c')
-rw-r--r-- | src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c index 39b20dca..34af2abc 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c @@ -93,6 +93,19 @@ static void handle_normal_actions(int actions) } } + if (actions & TEMP_ACT_NORM_SLAVE_ON) { + if (!is_sbts2050()) { + LOGP(DTEMP, LOGL_NOTICE, + "Slave on only possible on the sysmoBTS2050\n"); + } else if (sbts2050_uc_set_slave_power(1) != 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to switch on the slave BTS\n"); + } else { + LOGP(DTEMP, LOGL_NOTICE, + "Switched on the slave as normal action.\n"); + } + } + if (actions & TEMP_ACT_NORM_BTS_SRV_ON) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch on the BTS service\n"); @@ -121,6 +134,19 @@ static void handle_actions(int actions) } } + if (actions & TEMP_ACT_SLAVE_OFF) { + if (!is_sbts2050()) { + LOGP(DTEMP, LOGL_NOTICE, + "Slave off only possible on the sysmoBTS2050\n"); + } else if (sbts2050_uc_set_slave_power(0) != 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to switch off the slave BTS\n"); + } else { + LOGP(DTEMP, LOGL_NOTICE, + "Switched off the slave due temperature\n"); + } + } + if (actions & TEMP_ACT_BTS_SRV_OFF) { LOGP(DTEMP, LOGL_NOTICE, "Going to switch off the BTS service\n"); |