mirror of git://git.sysmocom.de/ofono
modem: Add __ofono_modem_foreach_registered_atom
This commit is contained in:
parent
192c0b62f4
commit
774cb72930
24
src/modem.c
24
src/modem.c
|
@ -345,6 +345,30 @@ void __ofono_modem_foreach_atom(struct ofono_modem *modem,
|
|||
}
|
||||
}
|
||||
|
||||
void __ofono_modem_foreach_registered_atom(struct ofono_modem *modem,
|
||||
enum ofono_atom_type type,
|
||||
ofono_atom_func callback,
|
||||
void *data)
|
||||
{
|
||||
GSList *l;
|
||||
struct ofono_atom *atom;
|
||||
|
||||
if (modem == NULL)
|
||||
return;
|
||||
|
||||
for (l = modem->atoms; l; l = l->next) {
|
||||
atom = l->data;
|
||||
|
||||
if (atom->type != type)
|
||||
continue;
|
||||
|
||||
if (atom->unregister == NULL)
|
||||
continue;
|
||||
|
||||
callback(atom, data);
|
||||
}
|
||||
}
|
||||
|
||||
void __ofono_atom_free(struct ofono_atom *atom)
|
||||
{
|
||||
struct ofono_modem *modem = atom->modem;
|
||||
|
|
|
@ -163,6 +163,11 @@ void __ofono_modem_foreach_atom(struct ofono_modem *modem,
|
|||
enum ofono_atom_type type,
|
||||
ofono_atom_func callback, void *data);
|
||||
|
||||
void __ofono_modem_foreach_registered_atom(struct ofono_modem *modem,
|
||||
enum ofono_atom_type type,
|
||||
ofono_atom_func callback,
|
||||
void *data);
|
||||
|
||||
void *__ofono_atom_get_data(struct ofono_atom *atom);
|
||||
const char *__ofono_atom_get_path(struct ofono_atom *atom);
|
||||
struct ofono_modem *__ofono_atom_get_modem(struct ofono_atom *atom);
|
||||
|
|
Loading…
Reference in New Issue