diff options
author | Frédéric Danis <frederic.danis@linux.intel.com> | 2011-02-15 16:06:32 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-02-16 00:23:44 -0600 |
commit | 421c55bdac6a75bec704416ae494683b4fa91f88 (patch) | |
tree | 6876d09f5f8815abc0c948f8eb5bc3363ed54b93 /src/emulator.c | |
parent | b5969360d74e2b94a2858dc9ccf290df31097810 (diff) | |
download | ofono-421c55bdac6a75bec704416ae494683b4fa91f88.tar.bz2 |
emulator: Handle multiple emulator types
Diffstat (limited to 'src/emulator.c')
-rw-r--r-- | src/emulator.c | 14 |
1 files changed, 12 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; } |