emulator: force creation of atom at modem offline state
PATCH 1/1 emulator: force creation of atom at modem offline state
this allows to fix problem when atom created in online state are destroyed when modem goes to offline state
--- src/emulator.c | 3 ++- src/modem.c | 14 ++++++++++++++ src/ofono.h | 5 +++++ 3 files changed, 21 insertions(+), 1 deletions(-)
src/emulator.c +2 -1
@@ -115,7 +115,8 @@ struct ofono_emulator *ofono_emulator_create(struct ofono_modem *modem, em->type = type; - em->atom =__ofono_modem_add_atom (modem, atom_t, emulator_remove, em); + em->atom =__ofono_modem_add_atom_offline (modem, atom_t, + emulator_remove, em);return em; }
src/modem.c +14 -0
@@ -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;
src/ofono.h +5 -0
@@ -148,6 +148,11 @@ struct ofono_atom *__ofono_modem_add_atom(struct ofono_modem *modem,void (*destruct)(struct ofono_atom *), void *data); +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 *__ofono_modem_find_atom (struct ofono_modem *modem,enum ofono_atom_type type);
Signature · 1 line
1.7.1
Hi Frédéric,
Quoted 8 lines · Frédéric Danis
this allows to fix problem when atom created in online state are destroyed when modem goes to offline state
--- src/emulator.c | 3 ++- src/modem.c | 14 ++++++++++++++ src/ofono.h | 5 +++++ 3 files changed, 21 insertions(+), 1 deletions(-)
Patch has been applied, thanks.
Regards,
-Denis