3
* RIL library with GLib integration
5
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
6
* Copyright (C) 2012 Canonical Ltd.
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License version 2 as
10
* published by the Free Software Foundation.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
#include "grilresponse.h"
33
#include "ril_constants.h"
37
typedef struct _GRil GRil;
40
* This struct represents an entire RIL message read
41
* from the command socket. It can hold responses or
42
* unsolicited requests from RILD.
53
typedef void (*GRilResponseFunc)(struct ril_msg *message, gpointer user_data);
55
typedef void (*GRilNotifyFunc)(struct ril_msg *message, gpointer user_data);
59
GIOChannel *g_ril_get_channel(GRil *ril);
60
GRilIO *g_ril_get_io(GRil *ril);
62
GRil *g_ril_ref(GRil *ril);
63
void g_ril_unref(GRil *ril);
65
GRil *g_ril_clone(GRil *ril);
67
void g_ril_suspend(GRil *ril);
68
void g_ril_resume(GRil *ril);
70
gboolean g_ril_set_disconnect_function(GRil *ril, GRilDisconnectFunc disconnect,
74
* If the function is not NULL, then on every read/write from the GIOChannel
75
* provided to GRil the logging function will be called with the
76
* input/output string and user data
78
gboolean g_ril_set_debug(GRil *ril, GRilDebugFunc func, gpointer user_data);
81
* Queue an RIL request for execution. The request contents are given
82
* in data. Once the command executes, the callback function given by
83
* func is called with user provided data in user_data.
85
* Returns an id of the queued command which can be canceled using
86
* g_ril_cancel. If an error occurred, an id of 0 is returned.
89
guint g_ril_send(GRil *ril, const guint req, const char *data, const gsize data_len,
90
GRilResponseFunc func, gpointer user_data, GDestroyNotify notify);
92
guint g_ril_register(GRil *ril, const int req,
93
GRilNotifyFunc func, gpointer user_data);
95
gboolean g_ril_unregister(GRil *ril, guint id);
96
gboolean g_ril_unregister_all(GRil *ril);
102
#endif /* __GRIL_H */