diff options
author | Frédéric Danis <frederic.danis@linux.intel.com> | 2012-03-14 17:00:52 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2012-03-20 19:20:22 -0500 |
commit | 1f3935429d6cb85dacacd401989b59174a303530 (patch) | |
tree | 54c2a95ff11d80f79833d0d2e49e411284684c73 /src/emulator.c | |
parent | 6b0880f8a77b2f161ae9ad14e247a5a1ab769447 (diff) | |
download | ofono-1f3935429d6cb85dacacd401989b59174a303530.tar.bz2 |
emulator: Force indicator event implementation
Diffstat (limited to 'src/emulator.c')
-rw-r--r-- | src/emulator.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/emulator.c b/src/emulator.c index 0f1ceca0..e7c7d413 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -1245,3 +1245,26 @@ start_ring: em->callsetup_source = g_timeout_add_seconds(RING_TIMEOUT, notify_ring, em); } + +void __ofono_emulator_set_indicator_forced(struct ofono_emulator *em, + const char *name, int value) +{ + int i; + struct indicator *ind; + char buf[20]; + + ind = find_indicator(em, name, &i); + + if (ind == NULL || value < ind->min || value > ind->max) + return; + + ind->value = value; + + if (em->events_mode == 3 && em->events_ind && em->slc && ind->active) { + if (!g_at_server_command_pending(em->server)) { + sprintf(buf, "+CIEV: %d,%d", i, ind->value); + g_at_server_send_unsolicited(em->server, buf); + } else + ind->deferred = TRUE; + } +} |