From afe16ba22a17946374cf5121c7d08e4bcfbd2942 Mon Sep 17 00:00:00 2001 From: Frédéric Danis Date: Thu, 17 Feb 2011 18:23:29 +0100 Subject: emulator: always create emulators in offline state this allows to fix problem when atom created in online state are destroyed when modem goes to offline state --- src/modem.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/modem.c') diff --git a/src/modem.c b/src/modem.c index 8567cac4..bf8b0c08 100644 --- a/src/modem.c +++ b/src/modem.c @@ -189,6 +189,20 @@ struct ofono_atom *__ofono_modem_add_atom(struct ofono_modem *modem, return atom; } +struct ofono_atom *__ofono_modem_add_atom_offline(struct ofono_modem *modem, + enum ofono_atom_type type, + void (*destruct)(struct ofono_atom *), + void *data) +{ + struct ofono_atom *atom; + + atom = __ofono_modem_add_atom(modem, type, destruct, data); + + atom->modem_state = MODEM_STATE_OFFLINE; + + return atom; +} + void *__ofono_atom_get_data(struct ofono_atom *atom) { return atom->data; -- cgit v1.2.3