3 * oFono - Open Source Telephony
5 * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #define OFONO_API_SUBJECT_TO_CHANGE
26 #include <ofono/types.h>
28 void __ofono_exit(void);
30 int __ofono_manager_init(void);
31 void __ofono_manager_cleanup(void);
33 void __ofono_modem_shutdown(void);
35 #include <ofono/log.h>
37 int __ofono_log_init(const char *program, const char *debug,
39 void __ofono_log_cleanup(void);
40 void __ofono_log_enable(struct ofono_debug_desc *start,
41 struct ofono_debug_desc *stop);
43 #include <ofono/dbus.h>
45 int __ofono_dbus_init(DBusConnection *conn);
46 void __ofono_dbus_cleanup(void);
48 DBusMessage *__ofono_error_invalid_args(DBusMessage *msg);
49 DBusMessage *__ofono_error_invalid_format(DBusMessage *msg);
50 DBusMessage *__ofono_error_not_implemented(DBusMessage *msg);
51 DBusMessage *__ofono_error_failed(DBusMessage *msg);
52 DBusMessage *__ofono_error_busy(DBusMessage *msg);
53 DBusMessage *__ofono_error_not_found(DBusMessage *msg);
54 DBusMessage *__ofono_error_not_active(DBusMessage *msg);
55 DBusMessage *__ofono_error_not_supported(DBusMessage *msg);
56 DBusMessage *__ofono_error_not_available(DBusMessage *msg);
57 DBusMessage *__ofono_error_timed_out(DBusMessage *msg);
58 DBusMessage *__ofono_error_sim_not_ready(DBusMessage *msg);
59 DBusMessage *__ofono_error_in_use(DBusMessage *msg);
60 DBusMessage *__ofono_error_not_attached(DBusMessage *msg);
61 DBusMessage *__ofono_error_attach_in_progress(DBusMessage *msg);
62 DBusMessage *__ofono_error_not_registered(DBusMessage *msg);
63 DBusMessage *__ofono_error_canceled(DBusMessage *msg);
64 DBusMessage *__ofono_error_access_denied(DBusMessage *msg);
65 DBusMessage *__ofono_error_emergency_active(DBusMessage *msg);
66 DBusMessage *__ofono_error_incorrect_password(DBusMessage *msg);
67 DBusMessage *__ofono_error_not_allowed(DBusMessage *msg);
68 DBusMessage *__ofono_error_not_recognized(DBusMessage *msg);
70 DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
73 void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply);
75 gboolean __ofono_dbus_valid_object_path(const char *path);
77 struct ofono_watchlist_item {
81 ofono_destroy_func destroy;
84 struct ofono_watchlist {
87 ofono_destroy_func destroy;
90 struct ofono_watchlist *__ofono_watchlist_new(ofono_destroy_func destroy);
91 unsigned int __ofono_watchlist_add_item(struct ofono_watchlist *watchlist,
92 struct ofono_watchlist_item *item);
93 gboolean __ofono_watchlist_remove_item(struct ofono_watchlist *watchlist,
95 void __ofono_watchlist_free(struct ofono_watchlist *watchlist);
97 #include <ofono/plugin.h>
99 int __ofono_plugin_init(const char *pattern, const char *exclude);
100 void __ofono_plugin_cleanup(void);
102 #include <ofono/modem.h>
104 typedef void (*ofono_modem_foreach_func)(struct ofono_modem *modem,
106 void __ofono_modem_foreach(ofono_modem_foreach_func cb, void *userdata);
108 unsigned int __ofono_modem_callid_next(struct ofono_modem *modem);
109 void __ofono_modem_callid_hold(struct ofono_modem *modem, int id);
110 void __ofono_modem_callid_release(struct ofono_modem *modem, int id);
111 void __ofono_modem_append_properties(struct ofono_modem *modem,
112 DBusMessageIter *dict);
116 enum ofono_atom_type {
117 OFONO_ATOM_TYPE_DEVINFO,
118 OFONO_ATOM_TYPE_CALL_BARRING,
119 OFONO_ATOM_TYPE_CALL_FORWARDING,
120 OFONO_ATOM_TYPE_CALL_METER,
121 OFONO_ATOM_TYPE_CALL_SETTINGS,
122 OFONO_ATOM_TYPE_NETREG,
123 OFONO_ATOM_TYPE_PHONEBOOK,
126 OFONO_ATOM_TYPE_USSD,
127 OFONO_ATOM_TYPE_VOICECALL,
128 OFONO_ATOM_TYPE_HISTORY,
130 OFONO_ATOM_TYPE_MESSAGE_WAITING,
132 OFONO_ATOM_TYPES_CALL_VOLUME,
133 OFONO_ATOM_TYPE_GPRS,
134 OFONO_ATOM_TYPE_GPRS_CONTEXT,
135 OFONO_ATOM_TYPE_RADIO_SETTINGS,
136 OFONO_ATOM_TYPE_AUDIO_SETTINGS,
138 OFONO_ATOM_TYPE_NETTIME,
140 OFONO_ATOM_TYPE_CDMA_VOICECALL_MANAGER,
141 OFONO_ATOM_TYPE_CDMA_CONNMAN,
142 OFONO_ATOM_TYPE_SIM_AUTH,
143 OFONO_ATOM_TYPE_EMULATOR_DUN,
144 OFONO_ATOM_TYPE_EMULATOR_HFP,
145 OFONO_ATOM_TYPE_LOCATION_REPORTING,
146 OFONO_ATOM_TYPE_GNSS,
147 OFONO_ATOM_TYPE_CDMA_SMS,
148 OFONO_ATOM_TYPE_CDMA_NETREG,
149 OFONO_ATOM_TYPE_HANDSFREE,
152 enum ofono_atom_watch_condition {
153 OFONO_ATOM_WATCH_CONDITION_REGISTERED,
154 OFONO_ATOM_WATCH_CONDITION_UNREGISTERED
157 typedef void (*ofono_atom_watch_func)(struct ofono_atom *atom,
158 enum ofono_atom_watch_condition cond,
161 typedef void (*ofono_atom_func)(struct ofono_atom *atom, void *data);
163 struct ofono_atom *__ofono_modem_add_atom(struct ofono_modem *modem,
164 enum ofono_atom_type type,
165 void (*destruct)(struct ofono_atom *),
168 struct ofono_atom *__ofono_modem_add_atom_offline(struct ofono_modem *modem,
169 enum ofono_atom_type type,
170 void (*destruct)(struct ofono_atom *),
173 struct ofono_atom *__ofono_modem_find_atom(struct ofono_modem *modem,
174 enum ofono_atom_type type);
176 void __ofono_modem_foreach_atom(struct ofono_modem *modem,
177 enum ofono_atom_type type,
178 ofono_atom_func callback, void *data);
180 void __ofono_modem_foreach_registered_atom(struct ofono_modem *modem,
181 enum ofono_atom_type type,
182 ofono_atom_func callback,
185 void *__ofono_atom_get_data(struct ofono_atom *atom);
186 const char *__ofono_atom_get_path(struct ofono_atom *atom);
187 struct ofono_modem *__ofono_atom_get_modem(struct ofono_atom *atom);
189 #define __ofono_atom_find(enum_type, modem) \
191 struct ofono_atom *tmp_atom = \
192 __ofono_modem_find_atom(modem, enum_type); \
194 tmp_atom ? __ofono_atom_get_data(tmp_atom) : NULL; \
197 void __ofono_atom_register(struct ofono_atom *atom,
198 void (*unregister)(struct ofono_atom *));
199 void __ofono_atom_unregister(struct ofono_atom *atom);
201 gboolean __ofono_atom_get_registered(struct ofono_atom *atom);
203 unsigned int __ofono_modem_add_atom_watch(struct ofono_modem *modem,
204 enum ofono_atom_type type,
205 ofono_atom_watch_func notify,
207 ofono_destroy_func destroy);
208 gboolean __ofono_modem_remove_atom_watch(struct ofono_modem *modem,
211 void __ofono_atom_free(struct ofono_atom *atom);
213 typedef void (*ofono_modemwatch_cb_t)(struct ofono_modem *modem,
214 gboolean added, void *data);
215 void __ofono_modemwatch_init(void);
216 void __ofono_modemwatch_cleanup(void);
217 unsigned int __ofono_modemwatch_add(ofono_modemwatch_cb_t cb, void *user,
218 ofono_destroy_func destroy);
219 gboolean __ofono_modemwatch_remove(unsigned int id);
221 typedef void (*ofono_modem_online_notify_func)(struct ofono_modem *modem,
224 unsigned int __ofono_modem_add_online_watch(struct ofono_modem *modem,
225 ofono_modem_online_notify_func notify,
226 void *data, ofono_destroy_func destroy);
227 void __ofono_modem_remove_online_watch(struct ofono_modem *modem,
230 typedef void (*ofono_modem_powered_notify_func)(struct ofono_modem *modem,
231 ofono_bool_t powered,
234 unsigned int __ofono_modem_add_powered_watch(struct ofono_modem *modem,
235 ofono_modem_online_notify_func notify,
236 void *data, ofono_destroy_func destroy);
237 void __ofono_modem_remove_powered_watch(struct ofono_modem *modem,
240 void __ofono_modem_sim_reset(struct ofono_modem *modem);
242 void __ofono_modem_inc_emergency_mode(struct ofono_modem *modem);
243 void __ofono_modem_dec_emergency_mode(struct ofono_modem *modem);
245 #include <ofono/call-barring.h>
247 gboolean __ofono_call_barring_is_busy(struct ofono_call_barring *cb);
249 #include <ofono/call-forwarding.h>
251 gboolean __ofono_call_forwarding_is_busy(struct ofono_call_forwarding *cf);
253 #include <ofono/call-meter.h>
254 #include <ofono/call-settings.h>
256 gboolean __ofono_call_settings_is_busy(struct ofono_call_settings *cs);
258 #include <ofono/cbs.h>
259 #include <ofono/devinfo.h>
260 #include <ofono/phonebook.h>
261 #include <ofono/gprs.h>
262 #include <ofono/gprs-context.h>
263 #include <ofono/radio-settings.h>
264 #include <ofono/audio-settings.h>
265 #include <ofono/ctm.h>
266 #include <ofono/location-reporting.h>
268 #include <ofono/voicecall.h>
270 enum ofono_voicecall_interaction {
271 OFONO_VOICECALL_INTERACTION_NONE = 0,
272 OFONO_VOICECALL_INTERACTION_PUT_ON_HOLD = 1,
273 OFONO_VOICECALL_INTERACTION_DISCONNECT = 2,
276 typedef void (*ofono_voicecall_dial_cb_t)(struct ofono_call *call, void *data);
277 typedef void (*ofono_voicecall_tone_cb_t)(int error, void *data);
279 ofono_bool_t __ofono_voicecall_is_busy(struct ofono_voicecall *vc,
280 enum ofono_voicecall_interaction type);
282 int __ofono_voicecall_dial(struct ofono_voicecall *vc,
283 const char *addr, int addr_type,
284 const char *message, unsigned char icon_id,
285 enum ofono_voicecall_interaction interaction,
286 ofono_voicecall_dial_cb_t cb, void *user_data);
287 void __ofono_voicecall_dial_cancel(struct ofono_voicecall *vc);
289 void __ofono_voicecall_set_alpha_and_icon_id(struct ofono_voicecall *vc,
290 const char *addr, int addr_type,
292 unsigned char icon_id);
293 void __ofono_voicecall_clear_alpha_and_icon_id(struct ofono_voicecall *vc);
295 int __ofono_voicecall_tone_send(struct ofono_voicecall *vc,
296 const char *tone_str,
297 ofono_voicecall_tone_cb_t cb, void *user_data);
298 void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id);
300 struct ofono_call *__ofono_voicecall_find_call_with_status(
301 struct ofono_voicecall *vc, int status);
303 #include <ofono/sms.h>
307 enum ofono_sms_submit_flag {
308 OFONO_SMS_SUBMIT_FLAG_REQUEST_SR = 0x1,
309 OFONO_SMS_SUBMIT_FLAG_RECORD_HISTORY = 0x2,
310 OFONO_SMS_SUBMIT_FLAG_RETRY = 0x4,
311 OFONO_SMS_SUBMIT_FLAG_EXPOSE_DBUS = 0x8,
312 OFONO_SMS_SUBMIT_FLAG_REUSE_UUID = 0x10,
315 typedef void (*ofono_sms_txq_submit_cb_t)(gboolean ok, void *data);
316 typedef void (*ofono_sms_txq_queued_cb_t)(struct ofono_sms *sms,
317 const struct ofono_uuid *uuid,
319 typedef void (*ofono_sms_text_notify_cb_t)(const char *from,
320 const struct tm *remote,
321 const struct tm *local,
324 typedef void (*ofono_sms_datagram_notify_cb_t)(const char *from,
325 const struct tm *remote,
326 const struct tm *local,
328 const unsigned char *buffer,
332 int __ofono_sms_txq_submit(struct ofono_sms *sms, GSList *list,
333 unsigned int flags, struct ofono_uuid *uuid,
334 ofono_sms_txq_queued_cb_t, void *data);
336 int __ofono_sms_txq_set_submit_notify(struct ofono_sms *sms,
337 struct ofono_uuid *uuid,
338 ofono_sms_txq_submit_cb_t cb,
340 ofono_destroy_func destroy);
342 int __ofono_sms_txq_cancel(struct ofono_sms *sms,
343 const struct ofono_uuid *uuid);
345 const char *__ofono_sms_message_path_from_uuid(struct ofono_sms *sms,
346 const struct ofono_uuid *uuid);
348 unsigned int __ofono_sms_text_watch_add(struct ofono_sms *sms,
349 ofono_sms_text_notify_cb_t cb,
350 void *data, ofono_destroy_func destroy);
351 gboolean __ofono_sms_text_watch_remove(struct ofono_sms *sms,
354 unsigned int __ofono_sms_datagram_watch_add(struct ofono_sms *sms,
355 ofono_sms_datagram_notify_cb_t cb,
356 int dst, int src, void *data,
357 ofono_destroy_func destroy);
358 gboolean __ofono_sms_datagram_watch_remove(struct ofono_sms *sms,
361 unsigned short __ofono_sms_get_next_ref(struct ofono_sms *sms);
363 #include <ofono/sim.h>
365 ofono_bool_t __ofono_sim_service_available(struct ofono_sim *sim,
368 ofono_bool_t __ofono_sim_cphs_service_available(struct ofono_sim *sim,
371 ofono_bool_t __ofono_is_valid_sim_pin(const char *pin,
372 enum ofono_sim_password_type type);
374 ofono_bool_t __ofono_is_valid_net_pin(const char *pin);
376 void __ofono_sim_refresh(struct ofono_sim *sim, GSList *file_list,
377 ofono_bool_t full_file_change,
378 ofono_bool_t naa_init);
380 void __ofono_sim_recheck_pin(struct ofono_sim *sim);
382 #include <ofono/stk.h>
384 typedef void (*__ofono_sms_sim_download_cb_t)(ofono_bool_t ok,
385 const unsigned char *tp_ud,
386 int len, void *data);
389 void __ofono_cbs_sim_download(struct ofono_stk *stk, const struct cbs *msg);
392 int __ofono_sms_sim_download(struct ofono_stk *stk, const struct sms *msg,
393 __ofono_sms_sim_download_cb_t cb, void *data);
395 #include <ofono/ussd.h>
397 typedef gboolean (*ofono_ussd_ssc_cb_t)(int type,
399 const char *sia, const char *sib,
400 const char *sic, const char *dn,
401 DBusMessage *msg, void *data);
403 typedef gboolean (*ofono_ussd_passwd_cb_t)(const char *sc,
404 const char *old, const char *new,
405 DBusMessage *msg, void *data);
407 typedef void (*ofono_ussd_request_cb_t)(int error, int dcs,
408 const unsigned char *pdu, int len,
411 gboolean __ofono_ussd_ssc_register(struct ofono_ussd *ussd, const char *sc,
412 ofono_ussd_ssc_cb_t cb, void *data,
413 ofono_destroy_func destroy);
414 void __ofono_ussd_ssc_unregister(struct ofono_ussd *ussd, const char *sc);
416 gboolean __ofono_ussd_passwd_register(struct ofono_ussd *ussd, const char *sc,
417 ofono_ussd_passwd_cb_t cb, void *data,
418 ofono_destroy_func destroy);
419 void __ofono_ussd_passwd_unregister(struct ofono_ussd *ussd, const char *sc);
420 gboolean __ofono_ussd_is_busy(struct ofono_ussd *ussd);
422 int __ofono_ussd_initiate(struct ofono_ussd *ussd, int dcs,
423 const unsigned char *pdu, int len,
424 ofono_ussd_request_cb_t cb, void *user_data);
425 void __ofono_ussd_initiate_cancel(struct ofono_ussd *ussd);
427 #include <ofono/netreg.h>
429 typedef void (*ofono_netreg_status_notify_cb_t)(int status, int lac, int ci,
430 int tech, const char *mcc, const char *mnc,
433 unsigned int __ofono_netreg_add_status_watch(struct ofono_netreg *netreg,
434 ofono_netreg_status_notify_cb_t cb,
435 void *data, ofono_destroy_func destroy);
437 gboolean __ofono_netreg_remove_status_watch(struct ofono_netreg *netreg,
440 void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,
443 #include <ofono/history.h>
445 void __ofono_history_probe_drivers(struct ofono_modem *modem);
447 void __ofono_history_call_ended(struct ofono_modem *modem,
448 const struct ofono_call *call,
449 time_t start, time_t end);
451 void __ofono_history_call_missed(struct ofono_modem *modem,
452 const struct ofono_call *call, time_t when);
454 void __ofono_history_sms_received(struct ofono_modem *modem,
455 const struct ofono_uuid *uuid,
457 const struct tm *remote,
458 const struct tm *local,
461 void __ofono_history_sms_send_pending(struct ofono_modem *modem,
462 const struct ofono_uuid *uuid,
464 time_t when, const char *text);
466 void __ofono_history_sms_send_status(struct ofono_modem *modem,
467 const struct ofono_uuid *uuid,
469 enum ofono_history_sms_status status);
471 #include <ofono/message-waiting.h>
475 void __ofono_message_waiting_mwi(struct ofono_message_waiting *mw,
476 struct sms *sms, gboolean *out_discard);
478 const struct ofono_phone_number *__ofono_message_waiting_get_mbdn(
479 struct ofono_message_waiting *mw,
482 #include <ofono/nettime.h>
484 void __ofono_nettime_probe_drivers(struct ofono_modem *modem);
486 void __ofono_nettime_info_received(struct ofono_modem *modem,
487 struct ofono_network_time *info);
489 #include <ofono/cdma-voicecall.h>
490 #include <ofono/cdma-connman.h>
491 #include <ofono/sim-auth.h>
493 #include <ofono/gprs-provision.h>
494 ofono_bool_t __ofono_gprs_provision_get_settings(const char *mcc,
495 const char *mnc, const char *spn,
496 struct ofono_gprs_provision_data **settings,
498 void __ofono_gprs_provision_free_settings(
499 struct ofono_gprs_provision_data *settings,
502 #include <ofono/emulator.h>
503 void __ofono_emulator_set_indicator_forced(struct ofono_emulator *em,
504 const char *name, int value);
506 #include <ofono/gnss.h>
507 #include <ofono/cdma-sms.h>
508 #include <ofono/cdma-netreg.h>
510 #include <ofono/cdma-provision.h>
511 ofono_bool_t __ofono_cdma_provision_get_name(const char *sid, char **name);
513 #include <ofono/private-network.h>
515 void __ofono_private_network_release(int id);
516 ofono_bool_t __ofono_private_network_request(ofono_private_network_cb_t cb,
517 int *id, void *data);