diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-12 14:36:59 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-12 14:40:25 +0100 |
commit | 8381a6a4835feae6b714fb6fac38c247b69958ee (patch) | |
tree | 17afdd25d8eee78f9ff6e334edac86d8c69c9c1e | |
parent | 4d4dc2674252658330cdd581757d6168087ba4fb (diff) |
sysmobts: Actions can be executed in all levels
Somebody could decide to switch off the PA in the warning level
already. Support this mode of operation. This means we could have
a config that:
* Enables the PA in the normal level
* Disables it in the critical level
With kdbus or better IPC we could even have the PA and other
parts be represented as service that talk to a bts manager and
then simply execute start/stop requests. This would make the
entire TODO entry irrelevant as state would be managed by
systemd and one can see the time the service was executed.
-rw-r--r-- | src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c index 90203542..d110c131 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c @@ -77,28 +77,10 @@ static int next_state(enum sysmobts_temp_state current_state, int critical, int return next_state; } -/** - * Go back to normal! Undo everything we did in the other states. For - * reducint the transmit power, the question is if we should slowly set - * it back to normal, let the BTS slowly increase it.. or handle it here - * as well? - */ -static void execute_normal_act(struct sysmobts_mgr_instance *manager) -{ - LOGP(DTEMP, LOGL_NOTICE, "System is back to normal temperature.\n"); -} - -static void execute_warning_act(struct sysmobts_mgr_instance *manager) -{ - LOGP(DTEMP, LOGL_NOTICE, "System has reached temperature warning.\n"); -} - -static void execute_critical_act(struct sysmobts_mgr_instance *manager) +static void handle_actions(int actions) { - LOGP(DTEMP, LOGL_NOTICE, "System has reached critical warning.\n"); - /* switch off the PA */ - if (manager->action_crit & TEMP_ACT_PA_OFF) { + if (actions & TEMP_ACT_PA_OFF) { if (!is_sbts2050()) { LOGP(DTEMP, LOGL_NOTICE, "PA can only be switched-off on the master\n"); @@ -118,6 +100,29 @@ static void execute_critical_act(struct sysmobts_mgr_instance *manager) } } +/** + * Go back to normal! Undo everything we did in the other states. For + * reducint the transmit power, the question is if we should slowly set + * it back to normal, let the BTS slowly increase it.. or handle it here + * as well? + */ +static void execute_normal_act(struct sysmobts_mgr_instance *manager) +{ + LOGP(DTEMP, LOGL_NOTICE, "System is back to normal temperature.\n"); +} + +static void execute_warning_act(struct sysmobts_mgr_instance *manager) +{ + LOGP(DTEMP, LOGL_NOTICE, "System has reached temperature warning.\n"); + handle_actions(manager->action_warn); +} + +static void execute_critical_act(struct sysmobts_mgr_instance *manager) +{ + LOGP(DTEMP, LOGL_NOTICE, "System has reached critical warning.\n"); + handle_actions(manager->action_crit); +} + static void sysmobts_mgr_temp_handle(struct sysmobts_mgr_instance *manager, int critical, int warning) { |