Data Structures

struct  _E_Ofono_Element
 

Typedefs

typedef struct _E_Ofono_Element E_Ofono_Element
 

Functions

EAPI E_Ofono_Elemente_ofono_element_get (const char *path, const char *interface) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_element_is_manager (const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
 
EAPI Eina_Bool e_ofono_element_is_modem (const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
 
EAPI Eina_Bool e_ofono_element_is_netreg (const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
 
EAPI void e_ofono_element_listener_add (E_Ofono_Element *element, void(*cb)(void *data, const E_Ofono_Element *element), const void *data, void(*free_data)(void *data)) EINA_ARG_NONNULL(1
 
EAPI void EAPI void e_ofono_element_listener_del (E_Ofono_Element *element, void(*cb)(void *data, const E_Ofono_Element *element), const void *data) EINA_ARG_NONNULL(1
 
EAPI void e_ofono_element_print (FILE *fp, const E_Ofono_Element *element) EINA_ARG_NONNULL(1
 
EAPI void e_ofono_element_properties_list (const E_Ofono_Element *element, Eina_Bool(*cb)(void *data, const E_Ofono_Element *element, const char *name, int type, const void *value), const void *data) EINA_ARG_NONNULL(1
 
EAPI void EAPI Eina_Bool e_ofono_element_properties_sync (E_Ofono_Element *element) EINA_ARG_NONNULL(1)
 
EAPI Eina_Bool e_ofono_element_properties_sync_full (E_Ofono_Element *element, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1)
 
EAPI Eina_Bool e_ofono_element_property_dict_get_stringshared (const E_Ofono_Element *element, const char *dict_name, const char *key_name, int *type, void *value) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_element_property_dict_set_full (E_Ofono_Element *element, const char *prop, const char *key, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_element_property_get (const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_element_property_get_stringshared (const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_element_property_set (E_Ofono_Element *element, const char *prop, int type, const void *value) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_element_property_set_full (E_Ofono_Element *element, const char *prop, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_element_property_type_get (const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1
 
EAPI void EAPI Eina_Bool e_ofono_element_property_type_get_stringshared (const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1
 
EAPI void EAPI void EAPI int e_ofono_element_ref (E_Ofono_Element *element) EINA_ARG_NONNULL(1)
 
EAPI int e_ofono_element_unref (E_Ofono_Element *element) EINA_ARG_NONNULL(1)
 
EAPI Eina_Bool e_ofono_elements_get_all (unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_elements_get_all_type (const char *type, unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1
 
EAPI E_Ofono_Elemente_ofono_manager_get (void) EINA_WARN_UNUSED_RESULT
 
EAPI Eina_Bool e_ofono_manager_modems_get (Eina_Array **array)
 
EAPI Eina_Bool e_ofono_manager_sync_elements (void)
 
EAPI Eina_Bool e_ofono_modem_name_get (const E_Ofono_Element *element, const char **name) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_modem_powered_get (const E_Ofono_Element *element, Eina_Bool *powered) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_modem_powered_set (E_Ofono_Element *element, Eina_Bool powered, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
 
EAPI Eina_Bool e_ofono_netreg_mode_get (const E_Ofono_Element *element, const char **mode) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_netreg_operator_get (const E_Ofono_Element *element, const char **op) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_netreg_status_get (const E_Ofono_Element *element, const char **status) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_netreg_strength_get (const E_Ofono_Element *element, uint8_t *strength) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_sms_sca_get (const E_Ofono_Element *element, const char **sca) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_sms_sca_set (E_Ofono_Element *element, const char *sca, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1
 
EAPI Eina_Bool e_ofono_sms_send_message (E_Ofono_Element *element, const char *number, const char *message, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1
 
EAPI unsigned int e_ofono_system_init (E_DBus_Connection *edbus_conn) EINA_ARG_NONNULL(1)
 
EAPI unsigned int e_ofono_system_shutdown (void)
 

Variables

int E_OFONO_EVENT_ELEMENT_ADD
 
int E_OFONO_EVENT_ELEMENT_DEL
 
int E_OFONO_EVENT_ELEMENT_UPDATED
 
int E_OFONO_EVENT_MANAGER_IN
 
int E_OFONO_EVENT_MANAGER_OUT
 
EAPI Eina_Bool EINA_WARN_UNUSED_RESULT
 

Detailed Description

Typedef Documentation

◆ E_Ofono_Element

Function Documentation

◆ e_ofono_element_get()

EAPI E_Ofono_Element * e_ofono_element_get ( const char *  path,
const char *  interface 
)

◆ e_ofono_element_is_manager()

EAPI Eina_Bool e_ofono_element_is_manager ( const E_Ofono_Element element)

◆ e_ofono_element_is_modem()

EAPI Eina_Bool e_ofono_element_is_modem ( const E_Ofono_Element element)

◆ e_ofono_element_is_netreg()

EAPI Eina_Bool e_ofono_element_is_netreg ( const E_Ofono_Element element)

◆ e_ofono_element_listener_add()

EAPI void e_ofono_element_listener_add ( E_Ofono_Element element,
void(*)(void *data, const E_Ofono_Element *element)  cb,
const void *  data,
void(*)(void *data)  free_data 
)

◆ e_ofono_element_listener_del()

EAPI void EAPI void e_ofono_element_listener_del ( E_Ofono_Element element,
void(*)(void *data, const E_Ofono_Element *element)  cb,
const void *  data 
)

◆ e_ofono_element_print()

EAPI void e_ofono_element_print ( FILE *  fp,
const E_Ofono_Element element 
)

◆ e_ofono_element_properties_list()

EAPI void e_ofono_element_properties_list ( const E_Ofono_Element element,
Eina_Bool(*)(void *data, const E_Ofono_Element *element, const char *name, int type, const void *value)  cb,
const void *  data 
)

◆ e_ofono_element_properties_sync()

EAPI void EAPI Eina_Bool e_ofono_element_properties_sync ( E_Ofono_Element element)

Sync element properties with server, simple version.

Call method GetProperties() at the given element on server in order to sync them. This is the simple version and there is no check of server reply for errors.

Parameters
elementto call method on server.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.

References e_ofono_element_properties_sync_full().

◆ e_ofono_element_properties_sync_full()

EAPI Eina_Bool e_ofono_element_properties_sync_full ( E_Ofono_Element element,
E_DBus_Method_Return_Cb  cb,
const void *  data 
)

Sync element properties with server.

Call method GetProperties() at the given element on server in order to sync them.

Parameters
elementto call method on server.
cbfunction to call when server replies or some error happens.
datadata to give to cb when it is called.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.

References e_ofono_element_call_full(), and _E_Ofono_Element::interface.

Referenced by e_ofono_element_properties_sync(), and e_ofono_element_sync_properties_full().

◆ e_ofono_element_property_dict_get_stringshared()

EAPI Eina_Bool e_ofono_element_property_dict_get_stringshared ( const E_Ofono_Element element,
const char *  dict_name,
const char *  key_name,
int *  type,
void *  value 
)

◆ e_ofono_element_property_dict_set_full()

EAPI Eina_Bool e_ofono_element_property_dict_set_full ( E_Ofono_Element element,
const char *  prop,
const char *  key,
int  type,
const void *  value,
E_DBus_Method_Return_Cb  cb,
const void *  data 
)

◆ e_ofono_element_property_get()

EAPI Eina_Bool e_ofono_element_property_get ( const E_Ofono_Element element,
const char *  name,
int *  type,
void *  value 
)

◆ e_ofono_element_property_get_stringshared()

EAPI Eina_Bool e_ofono_element_property_get_stringshared ( const E_Ofono_Element element,
const char *  name,
int *  type,
void *  value 
)

◆ e_ofono_element_property_set()

EAPI Eina_Bool e_ofono_element_property_set ( E_Ofono_Element element,
const char *  prop,
int  type,
const void *  value 
)

◆ e_ofono_element_property_set_full()

EAPI Eina_Bool e_ofono_element_property_set_full ( E_Ofono_Element element,
const char *  prop,
int  type,
const void *  value,
E_DBus_Method_Return_Cb  cb,
const void *  data 
)

◆ e_ofono_element_property_type_get()

EAPI Eina_Bool e_ofono_element_property_type_get ( const E_Ofono_Element element,
const char *  name,
int *  type 
)

◆ e_ofono_element_property_type_get_stringshared()

EAPI void EAPI Eina_Bool e_ofono_element_property_type_get_stringshared ( const E_Ofono_Element element,
const char *  name,
int *  type 
)

◆ e_ofono_element_ref()

EAPI void EAPI void EAPI int e_ofono_element_ref ( E_Ofono_Element element)

Add reference to element.

References _E_Ofono_Element::_references.

◆ e_ofono_element_unref()

EAPI int e_ofono_element_unref ( E_Ofono_Element element)

Remove reference from element.

If reference count drops to 0 element will be freed.

References _E_Ofono_Element::_references.

◆ e_ofono_elements_get_all()

EAPI Eina_Bool e_ofono_elements_get_all ( unsigned int *  count,
E_Ofono_Element ***  p_elements 
)

◆ e_ofono_elements_get_all_type()

EAPI Eina_Bool e_ofono_elements_get_all_type ( const char *  type,
unsigned int *  count,
E_Ofono_Element ***  p_elements 
)

◆ e_ofono_manager_get()

EAPI E_Ofono_Element * e_ofono_manager_get ( void  )

Get the element manager.

Returns
element pointer if found, NULL otherwise.

References e_ofono_element_get().

◆ e_ofono_manager_modems_get()

EAPI Eina_Bool e_ofono_manager_modems_get ( Eina_Array **  array)

Get array of modem object paths.

If this property isn't found then 0 is returned. If zero is returned, then this call failed and parameter-returned values shall be considered invalid.

Parameters
arraywhere to store the property value, must be a pointer to Eina_Array (Eina_Array **), it will not be allocated or copied and references will be valid until element changes, so copy it if you want to use it later.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.

References e_ofono_element_get().

◆ e_ofono_manager_sync_elements()

EAPI Eina_Bool e_ofono_manager_sync_elements ( void  )

Synchronize elements with server.

This will call Manager.GetProperties() on server, retrieve properties and some element paths and then request their properties.

This call will add events E_OFONO_EVENT_ELEMENT_ADD and E_OFONO_EVENT_ELEMENT_UPDATED to the main loop.

This will not remove stale elements.

Returns
EINA_TRUE on success, EINA_FALSE otherwise.

◆ e_ofono_modem_name_get()

EAPI Eina_Bool e_ofono_modem_name_get ( const E_Ofono_Element element,
const char **  name 
)

◆ e_ofono_modem_powered_get()

EAPI Eina_Bool e_ofono_modem_powered_get ( const E_Ofono_Element element,
Eina_Bool *  powered 
)

◆ e_ofono_modem_powered_set()

EAPI Eina_Bool e_ofono_modem_powered_set ( E_Ofono_Element element,
Eina_Bool  powered,
E_DBus_Method_Return_Cb  cb,
const void *  data 
)

Call method SetProperty("Powered", powered) at the given element on server.

Parameters
poweredvalue to set.
cbfunction to call when server replies or some error happens.
datadata to give to cb when it is called.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.

References e_ofono_element_property_set_full(), and e_ofono_prop_powered.

◆ e_ofono_netreg_mode_get()

EAPI Eina_Bool e_ofono_netreg_mode_get ( const E_Ofono_Element element,
const char **  mode 
)

◆ e_ofono_netreg_operator_get()

EAPI Eina_Bool e_ofono_netreg_operator_get ( const E_Ofono_Element element,
const char **  op 
)

◆ e_ofono_netreg_status_get()

EAPI Eina_Bool e_ofono_netreg_status_get ( const E_Ofono_Element element,
const char **  status 
)

◆ e_ofono_netreg_strength_get()

EAPI Eina_Bool e_ofono_netreg_strength_get ( const E_Ofono_Element element,
uint8_t *  strength 
)

◆ e_ofono_sms_sca_get()

EAPI Eina_Bool e_ofono_sms_sca_get ( const E_Ofono_Element element,
const char **  sca 
)

◆ e_ofono_sms_sca_set()

EAPI Eina_Bool e_ofono_sms_sca_set ( E_Ofono_Element element,
const char *  sca,
E_DBus_Method_Return_Cb  cb,
const void *  data 
)

◆ e_ofono_sms_send_message()

EAPI Eina_Bool e_ofono_sms_send_message ( E_Ofono_Element element,
const char *  number,
const char *  message,
E_DBus_Method_Return_Cb  cb,
const void *  data 
)

◆ e_ofono_system_init()

EAPI unsigned int e_ofono_system_init ( E_DBus_Connection edbus_conn)

Initialize E oFono (E_Ofono) system.

This will connect and watch org.ofono.Manager and Element events and translate to Ecore main loop events, also provide a proxy for method invocation on server.

Interesting events are:

  • E_OFONO_EVENT_MANAGER_IN: issued when ofono is avaiable.
  • E_OFONO_EVENT_MANAGER_OUT: issued when ofono connection is lost.
  • E_OFONO_EVENT_ELEMENT_ADD: element was added.
  • E_OFONO_EVENT_ELEMENT_DEL: element was deleted.
  • E_OFONO_EVENT_ELEMENT_UPDATED: element was updated (properties or state changed).

Manager IN/OUT events do not provide any event information, just tells you that system is usable or not. After manager is out, all elements will be removed, so after this event do not use the system anymore.

Element events will give you an element object. After DEL event callback returns, that element will not be valid anymore.

◆ e_ofono_system_shutdown()

EAPI unsigned int e_ofono_system_shutdown ( void  )

Shutdown ofono system.

When count drops to 0 resources will be released and no calls should be made anymore.

Variable Documentation

◆ E_OFONO_EVENT_ELEMENT_ADD

int E_OFONO_EVENT_ELEMENT_ADD
extern

◆ E_OFONO_EVENT_ELEMENT_DEL

int E_OFONO_EVENT_ELEMENT_DEL
extern

◆ E_OFONO_EVENT_ELEMENT_UPDATED

int E_OFONO_EVENT_ELEMENT_UPDATED
extern

◆ E_OFONO_EVENT_MANAGER_IN

int E_OFONO_EVENT_MANAGER_IN
extern

◆ E_OFONO_EVENT_MANAGER_OUT

int E_OFONO_EVENT_MANAGER_OUT
extern

◆ EINA_WARN_UNUSED_RESULT

EAPI Eina_Bool EINA_WARN_UNUSED_RESULT