diff options
-rw-r--r-- | src/emulator.c | 14 | ||||
-rw-r--r-- | src/ofono.h | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/emulator.c b/src/emulator.c index a020124e..567692df 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -32,6 +32,7 @@ struct ofono_emulator { struct ofono_atom *atom; + enum ofono_emulator_type type; GAtServer *server; }; @@ -94,16 +95,25 @@ struct ofono_emulator *ofono_emulator_create(struct ofono_modem *modem, enum ofono_emulator_type type) { struct ofono_emulator *em; + enum ofono_atom_type atom_t; DBG("modem: %p, type: %d", modem, type); + if (type == OFONO_EMULATOR_TYPE_DUN) + atom_t = OFONO_ATOM_TYPE_EMULATOR_DUN; + else if (type == OFONO_EMULATOR_TYPE_HFP) + atom_t = OFONO_ATOM_TYPE_EMULATOR_HFP; + else + return NULL; + em = g_try_new0(struct ofono_emulator, 1); if (em == NULL) return NULL; - em->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_EMULATOR_DUN, - emulator_remove, em); + em->type = type; + + em->atom = __ofono_modem_add_atom(modem, atom_t, emulator_remove, em); return em; } diff --git a/src/ofono.h b/src/ofono.h index dbe18624..f52356e7 100644 --- a/src/ofono.h +++ b/src/ofono.h @@ -129,6 +129,7 @@ enum ofono_atom_type { OFONO_ATOM_TYPE_CDMA_VOICECALL_MANAGER, OFONO_ATOM_TYPE_SIM_AUTH, OFONO_ATOM_TYPE_EMULATOR_DUN, + OFONO_ATOM_TYPE_EMULATOR_HFP, }; enum ofono_atom_watch_condition { |