mirror of git://git.sysmocom.de/ofono
Add getter functions for atoms
This commit is contained in:
parent
a6ef7f8711
commit
9020b1dc7e
12
src/modem.c
12
src/modem.c
|
@ -59,6 +59,7 @@ struct ofono_atom {
|
|||
void (*destruct)(struct ofono_atom *atom);
|
||||
void (*unregister)(struct ofono_atom *atom);
|
||||
void *data;
|
||||
struct ofono_modem *modem;
|
||||
};
|
||||
|
||||
unsigned int __ofono_modem_alloc_callid(struct ofono_modem *modem)
|
||||
|
@ -121,6 +122,7 @@ struct ofono_atom *__ofono_modem_add_atom(struct ofono_modem *modem,
|
|||
atom->type = type;
|
||||
atom->destruct = destruct;
|
||||
atom->data = data;
|
||||
atom->modem = modem;
|
||||
|
||||
modem->atoms = g_slist_prepend(modem->atoms, atom);
|
||||
|
||||
|
@ -132,6 +134,16 @@ void *__ofono_atom_get_data(struct ofono_atom *atom)
|
|||
return atom->data;
|
||||
}
|
||||
|
||||
const char *__ofono_atom_get_path(struct ofono_atom *atom)
|
||||
{
|
||||
return atom->modem->path;
|
||||
}
|
||||
|
||||
struct ofono_modem *__ofono_atom_get_modem(struct ofono_atom *atom)
|
||||
{
|
||||
return atom->modem;
|
||||
}
|
||||
|
||||
void __ofono_atom_register(struct ofono_atom *atom,
|
||||
void (*unregister)(struct ofono_atom *))
|
||||
{
|
||||
|
|
|
@ -116,6 +116,8 @@ struct ofono_atom *__ofono_modem_find_atom(struct ofono_modem *modem,
|
|||
enum ofono_atom_type type);
|
||||
|
||||
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);
|
||||
|
||||
void __ofono_atom_register(struct ofono_atom *atom,
|
||||
void (*unregister)(struct ofono_atom *));
|
||||
|
|
Loading…
Reference in New Issue