Hi Frédéric,
On 03/09/2012 09:26 AM, Frédéric Danis wrote:
---
src/emulator.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/emulator.c b/src/emulator.c
index 0f1ceca..34329f0 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -62,6 +62,7 @@ struct indicator {
gboolean deferred;
gboolean active;
gboolean mandatory;
+ gboolean forced;
};
static void emulator_debug(const char *str, void *data)
@@ -1181,11 +1182,12 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
ind = find_indicator(em, name, &i);
- if (ind == NULL || ind->value == value || value < ind->min
- || value > ind->max)
+ if (ind == NULL || (ind->value == value && !ind->forced)
+ || value < ind->min || value > ind->max)
return;
ind->value = value;
+ ind->forced = FALSE;
call_ind = find_indicator(em, OFONO_EMULATOR_IND_CALL, NULL);
cs_ind = find_indicator(em, OFONO_EMULATOR_IND_CALLSETUP, NULL);
@@ -1245,3 +1247,15 @@ start_ring:
em->callsetup_source = g_timeout_add_seconds(RING_TIMEOUT,
notify_ring, em);
}
+
+void ofono_emulator_indicator_set_forced(struct ofono_emulator *em,
+ const char *name)
Why not just take the same arguments as ofono_emulator_set_indicator and...
+{
+ struct indicator *ind;
+
+ ind = find_indicator(em, name, NULL);
+ if (ind == NULL)
+ return;
+
+ ind->forced = TRUE;
+}
just simply update the value and emit the CIEV. We only use it in a
very specific circumstance anyway.
Regards,
-Denis