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);
69 DBusMessage *__ofono_error_network_terminated(DBusMessage *msg);
71 DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
74 void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply);
76 gboolean __ofono_dbus_valid_object_path(const char *path);
78 struct ofono_watchlist_item {
82 ofono_destroy_func destroy;
85 struct ofono_watchlist {
88 ofono_destroy_func destroy;
91 struct ofono_watchlist *__ofono_watchlist_new(ofono_destroy_func destroy);
92 unsigned int __ofono_watchlist_add_item(struct ofono_watchlist *watchlist,
93 struct ofono_watchlist_item *item);
94 gboolean __ofono_watchlist_remove_item(struct ofono_watchlist *watchlist,
96 void __ofono_watchlist_free(struct ofono_watchlist *watchlist);
98 #include <ofono/plugin.h>
100 int __ofono_plugin_init(const char *pattern, const char *exclude);
101 void __ofono_plugin_cleanup(void);
103 #include <ofono/modem.h>
105 typedef void (*ofono_modem_foreach_func)(struct ofono_modem *modem,
107 void __ofono_modem_foreach(ofono_modem_foreach_func cb, void *userdata);
109 unsigned int __ofono_modem_callid_next(struct ofono_modem *modem);
110 void __ofono_modem_callid_hold(struct ofono_modem *modem, int id);
111 void __ofono_modem_callid_release(struct ofono_modem *modem, int id);
112 void __ofono_modem_append_properties(struct ofono_modem *modem,
113 DBusMessageIter *dict);
117 enum ofono_atom_type {
118 OFONO_ATOM_TYPE_DEVINFO,
119 OFONO_ATOM_TYPE_CALL_BARRING,
120 OFONO_ATOM_TYPE_CALL_FORWARDING,
121 OFONO_ATOM_TYPE_CALL_METER,
122 OFONO_ATOM_TYPE_CALL_SETTINGS,
123 OFONO_ATOM_TYPE_NETREG,
124 OFONO_ATOM_TYPE_PHONEBOOK,
127 OFONO_ATOM_TYPE_USSD,
128 OFONO_ATOM_TYPE_VOICECALL,
129 OFONO_ATOM_TYPE_HISTORY,
131 OFONO_ATOM_TYPE_MESSAGE_WAITING,
133 OFONO_ATOM_TYPES_CALL_VOLUME,
134 OFONO_ATOM_TYPE_GPRS,
135 OFONO_ATOM_TYPE_GPRS_CONTEXT,
136 OFONO_ATOM_TYPE_RADIO_SETTINGS,
137 OFONO_ATOM_TYPE_AUDIO_SETTINGS,
139 OFONO_ATOM_TYPE_NETTIME,
141 OFONO_ATOM_TYPE_CDMA_VOICECALL_MANAGER,
142 OFONO_ATOM_TYPE_CDMA_CONNMAN,
143 OFONO_ATOM_TYPE_SIM_AUTH,
144 OFONO_ATOM_TYPE_EMULATOR_DUN,
145 OFONO_ATOM_TYPE_EMULATOR_HFP,
146 OFONO_ATOM_TYPE_LOCATION_REPORTING,
147 OFONO_ATOM_TYPE_GNSS,
148 OFONO_ATOM_TYPE_CDMA_SMS,
149 OFONO_ATOM_TYPE_CDMA_NETREG,
150 OFONO_ATOM_TYPE_HANDSFREE,
153 enum ofono_atom_watch_condition {
154 OFONO_ATOM_WATCH_CONDITION_REGISTERED,
155 OFONO_ATOM_WATCH_CONDITION_UNREGISTERED
158 typedef void (*ofono_atom_watch_func)(struct ofono_atom *atom,
159 enum ofono_atom_watch_condition cond,
162 typedef void (*ofono_atom_func)(struct ofono_atom *atom, void *data);
164 struct ofono_atom *__ofono_modem_add_atom(struct ofono_modem *modem,
165 enum ofono_atom_type type,
166 void (*destruct)(struct ofono_atom *),
169 struct ofono_atom *__ofono_modem_add_atom_offline(struct ofono_modem *modem,
170 enum ofono_atom_type type,
171 void (*destruct)(struct ofono_atom *),
174 struct ofono_atom *__ofono_modem_find_atom(struct ofono_modem *modem,
175 enum ofono_atom_type type);
177 void __ofono_modem_foreach_atom(struct ofono_modem *modem,
178 enum ofono_atom_type type,
179 ofono_atom_func callback, void *data);
181 void __ofono_modem_foreach_registered_atom(struct ofono_modem *modem,
182 enum ofono_atom_type type,
183 ofono_atom_func callback,
186 void *__ofono_atom_get_data(struct ofono_atom *atom);
187 const char *__ofono_atom_get_path(struct ofono_atom *atom);
188 struct ofono_modem *__ofono_atom_get_modem(struct ofono_atom *atom);
190 #define __ofono_atom_find(enum_type, modem) \
192 struct ofono_atom *tmp_atom = \
193 __ofono_modem_find_atom(modem, enum_type); \
195 tmp_atom ? __ofono_atom_get_data(tmp_atom) : NULL; \
198 void __ofono_atom_register(struct ofono_atom *atom,
199 void (*unregister)(struct ofono_atom *));
200 void __ofono_atom_unregister(struct ofono_atom *atom);
202 gboolean __ofono_atom_get_registered(struct ofono_atom *atom);
204 unsigned int __ofono_modem_add_atom_watch(struct ofono_modem *modem,
205 enum ofono_atom_type type,
206 ofono_atom_watch_func notify,
208 ofono_destroy_func destroy);
209 gboolean __ofono_modem_remove_atom_watch(struct ofono_modem *modem,
212 void __ofono_atom_free(struct ofono_atom *atom);
214 typedef void (*ofono_modemwatch_cb_t)(struct ofono_modem *modem,
215 gboolean added, void *data);
216 void __ofono_modemwatch_init(void);
217 void __ofono_modemwatch_cleanup(void);
218 unsigned int __ofono_modemwatch_add(ofono_modemwatch_cb_t cb, void *user,
219 ofono_destroy_func destroy);
220 gboolean __ofono_modemwatch_remove(unsigned int id);
222 typedef void (*ofono_modem_online_notify_func)(struct ofono_modem *modem,
225 unsigned int __ofono_modem_add_online_watch(struct ofono_modem *modem,
226 ofono_modem_online_notify_func notify,
227 void *data, ofono_destroy_func destroy);
228 void __ofono_modem_remove_online_watch(struct ofono_modem *modem,
231 typedef void (*ofono_modem_powered_notify_func)(struct ofono_modem *modem,
232 ofono_bool_t powered,
235 unsigned int __ofono_modem_add_powered_watch(struct ofono_modem *modem,
236 ofono_modem_online_notify_func notify,
237 void *data, ofono_destroy_func destroy);
238 void __ofono_modem_remove_powered_watch(struct ofono_modem *modem,
241 void __ofono_modem_sim_reset(struct ofono_modem *modem);
243 void __ofono_modem_inc_emergency_mode(struct ofono_modem *modem);
244 void __ofono_modem_dec_emergency_mode(struct ofono_modem *modem);
246 #include <ofono/call-barring.h>
248 gboolean __ofono_call_barring_is_busy(struct ofono_call_barring *cb);
250 #include <ofono/call-forwarding.h>
252 gboolean __ofono_call_forwarding_is_busy(struct ofono_call_forwarding *cf);
254 #include <ofono/call-meter.h>
255 #include <ofono/call-settings.h>
257 gboolean __ofono_call_settings_is_busy(struct ofono_call_settings *cs);
259 #include <ofono/cbs.h>
260 #include <ofono/devinfo.h>
261 #include <ofono/phonebook.h>
262 #include <ofono/gprs.h>
263 #include <ofono/gprs-context.h>
264 #include <ofono/radio-settings.h>
265 #include <ofono/audio-settings.h>
266 #include <ofono/ctm.h>
267 #include <ofono/location-reporting.h>
269 #include <ofono/voicecall.h>
271 enum ofono_voicecall_interaction {
272 OFONO_VOICECALL_INTERACTION_NONE = 0,
273 OFONO_VOICECALL_INTERACTION_PUT_ON_HOLD = 1,
274 OFONO_VOICECALL_INTERACTION_DISCONNECT = 2,
277 typedef void (*ofono_voicecall_dial_cb_t)(struct ofono_call *call, void *data);
278 typedef void (*ofono_voicecall_tone_cb_t)(int error, void *data);
280 ofono_bool_t __ofono_voicecall_is_busy(struct ofono_voicecall *vc,
281 enum ofono_voicecall_interaction type);
283 int __ofono_voicecall_dial(struct ofono_voicecall *vc,
284 const char *addr, int addr_type,
285 const char *message, unsigned char icon_id,
286 enum ofono_voicecall_interaction interaction,
287 ofono_voicecall_dial_cb_t cb, void *user_data);
288 void __ofono_voicecall_dial_cancel(struct ofono_voicecall *vc);
290 void __ofono_voicecall_set_alpha_and_icon_id(struct ofono_voicecall *vc,
291 const char *addr, int addr_type,
293 unsigned char icon_id);
294 void __ofono_voicecall_clear_alpha_and_icon_id(struct ofono_voicecall *vc);
296 int __ofono_voicecall_tone_send(struct ofono_voicecall *vc,
297 const char *tone_str,
298 ofono_voicecall_tone_cb_t cb, void *user_data);
299 void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id);
301 struct ofono_call *__ofono_voicecall_find_call_with_status(
302 struct ofono_voicecall *vc, int status);
304 #include <ofono/sms.h>
308 enum ofono_sms_submit_flag {
309 OFONO_SMS_SUBMIT_FLAG_REQUEST_SR = 0x1,
310 OFONO_SMS_SUBMIT_FLAG_RECORD_HISTORY = 0x2,
311 OFONO_SMS_SUBMIT_FLAG_RETRY = 0x4,
312 OFONO_SMS_SUBMIT_FLAG_EXPOSE_DBUS = 0x8,
313 OFONO_SMS_SUBMIT_FLAG_REUSE_UUID = 0x10,
316 typedef void (*ofono_sms_txq_submit_cb_t)(gboolean ok, void *data);
317 typedef void (*ofono_sms_txq_queued_cb_t)(struct ofono_sms *sms,
318 const struct ofono_uuid *uuid,
320 typedef void (*ofono_sms_text_notify_cb_t)(const char *from,
321 const struct tm *remote,
322 const struct tm *local,
325 typedef void (*ofono_sms_datagram_notify_cb_t)(const char *from,
326 const struct tm *remote,
327 const struct tm *local,
329 const unsigned char *buffer,
333 int __ofono_sms_txq_submit(struct ofono_sms *sms, GSList *list,
334 unsigned int flags, struct ofono_uuid *uuid,
335 ofono_sms_txq_queued_cb_t, void *data);
337 int __ofono_sms_txq_set_submit_notify(struct ofono_sms *sms,
338 struct ofono_uuid *uuid,
339 ofono_sms_txq_submit_cb_t cb,
341 ofono_destroy_func destroy);
343 int __ofono_sms_txq_cancel(struct ofono_sms *sms,
344 const struct ofono_uuid *uuid);
346 const char *__ofono_sms_message_path_from_uuid(struct ofono_sms *sms,
347 const struct ofono_uuid *uuid);
349 unsigned int __ofono_sms_text_watch_add(struct ofono_sms *sms,
350 ofono_sms_text_notify_cb_t cb,
351 void *data, ofono_destroy_func destroy);
352 gboolean __ofono_sms_text_watch_remove(struct ofono_sms *sms,
355 unsigned int __ofono_sms_datagram_watch_add(struct ofono_sms *sms,
356 ofono_sms_datagram_notify_cb_t cb,
357 int dst, int src, void *data,
358 ofono_destroy_func destroy);
359 gboolean __ofono_sms_datagram_watch_remove(struct ofono_sms *sms,
362 unsigned short __ofono_sms_get_next_ref(struct ofono_sms *sms);
364 #include <ofono/sim.h>
366 ofono_bool_t __ofono_sim_service_available(struct ofono_sim *sim,
369 ofono_bool_t __ofono_sim_cphs_service_available(struct ofono_sim *sim,
372 ofono_bool_t __ofono_is_valid_sim_pin(const char *pin,
373 enum ofono_sim_password_type type);
375 ofono_bool_t __ofono_is_valid_net_pin(const char *pin);
377 void __ofono_sim_refresh(struct ofono_sim *sim, GSList *file_list,
378 ofono_bool_t full_file_change,
379 ofono_bool_t naa_init);
381 void __ofono_sim_recheck_pin(struct ofono_sim *sim);
383 #include <ofono/stk.h>
385 typedef void (*__ofono_sms_sim_download_cb_t)(ofono_bool_t ok,
386 const unsigned char *tp_ud,
387 int len, void *data);
390 void __ofono_cbs_sim_download(struct ofono_stk *stk, const struct cbs *msg);
393 int __ofono_sms_sim_download(struct ofono_stk *stk, const struct sms *msg,
394 __ofono_sms_sim_download_cb_t cb, void *data);
396 #include <ofono/ussd.h>
398 typedef gboolean (*ofono_ussd_ssc_cb_t)(int type,
400 const char *sia, const char *sib,
401 const char *sic, const char *dn,
402 DBusMessage *msg, void *data);
404 typedef gboolean (*ofono_ussd_passwd_cb_t)(const char *sc,
405 const char *old, const char *new,
406 DBusMessage *msg, void *data);
408 typedef void (*ofono_ussd_request_cb_t)(int error, int dcs,
409 const unsigned char *pdu, int len,
412 gboolean __ofono_ussd_ssc_register(struct ofono_ussd *ussd, const char *sc,
413 ofono_ussd_ssc_cb_t cb, void *data,
414 ofono_destroy_func destroy);
415 void __ofono_ussd_ssc_unregister(struct ofono_ussd *ussd, const char *sc);
417 gboolean __ofono_ussd_passwd_register(struct ofono_ussd *ussd, const char *sc,
418 ofono_ussd_passwd_cb_t cb, void *data,
419 ofono_destroy_func destroy);
420 void __ofono_ussd_passwd_unregister(struct ofono_ussd *ussd, const char *sc);
421 gboolean __ofono_ussd_is_busy(struct ofono_ussd *ussd);
423 int __ofono_ussd_initiate(struct ofono_ussd *ussd, int dcs,
424 const unsigned char *pdu, int len,
425 ofono_ussd_request_cb_t cb, void *user_data);
426 void __ofono_ussd_initiate_cancel(struct ofono_ussd *ussd);
428 #include <ofono/netreg.h>
430 typedef void (*ofono_netreg_status_notify_cb_t)(int status, int lac, int ci,
431 int tech, const char *mcc, const char *mnc,
434 unsigned int __ofono_netreg_add_status_watch(struct ofono_netreg *netreg,
435 ofono_netreg_status_notify_cb_t cb,
436 void *data, ofono_destroy_func destroy);
438 gboolean __ofono_netreg_remove_status_watch(struct ofono_netreg *netreg,
441 void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,
444 #include <ofono/history.h>
446 void __ofono_history_probe_drivers(struct ofono_modem *modem);
448 void __ofono_history_call_ended(struct ofono_modem *modem,
449 const struct ofono_call *call,
450 time_t start, time_t end);
452 void __ofono_history_call_missed(struct ofono_modem *modem,
453 const struct ofono_call *call, time_t when);
455 void __ofono_history_sms_received(struct ofono_modem *modem,
456 const struct ofono_uuid *uuid,
458 const struct tm *remote,
459 const struct tm *local,
462 void __ofono_history_sms_send_pending(struct ofono_modem *modem,
463 const struct ofono_uuid *uuid,
465 time_t when, const char *text);
467 void __ofono_history_sms_send_status(struct ofono_modem *modem,
468 const struct ofono_uuid *uuid,
470 enum ofono_history_sms_status status);
472 #include <ofono/message-waiting.h>
476 void __ofono_message_waiting_mwi(struct ofono_message_waiting *mw,
477 struct sms *sms, gboolean *out_discard);
479 const struct ofono_phone_number *__ofono_message_waiting_get_mbdn(
480 struct ofono_message_waiting *mw,
483 #include <ofono/nettime.h>
485 void __ofono_nettime_probe_drivers(struct ofono_modem *modem);
487 void __ofono_nettime_info_received(struct ofono_modem *modem,
488 struct ofono_network_time *info);
490 #include <ofono/cdma-voicecall.h>
491 #include <ofono/cdma-connman.h>
492 #include <ofono/sim-auth.h>
494 #include <ofono/gprs-provision.h>
495 ofono_bool_t __ofono_gprs_provision_get_settings(const char *mcc,
496 const char *mnc, const char *spn,
497 struct ofono_gprs_provision_data **settings,
499 void __ofono_gprs_provision_free_settings(
500 struct ofono_gprs_provision_data *settings,
503 #include <ofono/emulator.h>
504 void __ofono_emulator_set_indicator_forced(struct ofono_emulator *em,
505 const char *name, int value);
507 #include <ofono/gnss.h>
508 #include <ofono/cdma-sms.h>
509 #include <ofono/cdma-netreg.h>
511 #include <ofono/cdma-provision.h>
512 ofono_bool_t __ofono_cdma_provision_get_name(const char *sid, char **name);
514 #include <ofono/private-network.h>
516 void __ofono_private_network_release(int id);
517 ofono_bool_t __ofono_private_network_request(ofono_private_network_cb_t cb,
518 int *id, void *data);