55
55
typedef void (*GRilNotifyFunc)(struct ril_msg *message, gpointer user_data);
60
* @arg...: list of arguments
62
* Simple macro around ofono_debug() used for tracing RIL messages
63
* name it is called in.
65
#define G_RIL_TRACE(gril, fmt, arg...) do { \
66
if (g_ril_get_trace(gril)) \
67
ofono_debug(fmt, ## arg); \
70
#define RIL_PRINT_BUF_SIZE 8096
71
static char print_buf[RIL_PRINT_BUF_SIZE] __attribute__((used));
73
#define g_ril_print_request(gril, token, req) \
74
G_RIL_TRACE(gril, "[%04d]> %s %s", token, ril_request_id_to_string(req), print_buf)
75
#define g_ril_print_request_no_args(gril, token, req) \
76
G_RIL_TRACE(gril, "[%04d]> %s", token, ril_request_id_to_string(req))
77
#define g_ril_print_response(gril, message) \
78
G_RIL_TRACE(gril, "[%04d]< %s %s", message->serial_no, \
79
ril_request_id_to_string(message->req), print_buf)
80
#define g_ril_print_response_no_args(gril, message) \
81
G_RIL_TRACE(gril, "[%04d]< %s", message->serial_no, \
82
ril_request_id_to_string(message->req))
84
#define g_ril_append_print_buf(gril, x...) do { \
85
if (g_ril_get_trace(gril)) \
86
sprintf(print_buf, x); \
89
#define g_ril_print_unsol(gril, message) \
90
G_RIL_TRACE(gril, "[UNSOL]< %s %s", ril_unsol_request_to_string(message->req), \
92
#define g_ril_print_unsol_no_args(gril, message) \
93
G_RIL_TRACE(gril, "[UNSOL]< %s", ril_unsol_request_to_string(message->req))
59
97
GIOChannel *g_ril_get_channel(GRil *ril);
70
108
gboolean g_ril_set_disconnect_function(GRil *ril, GRilDisconnectFunc disconnect,
71
109
gpointer user_data);
111
gboolean g_ril_get_trace(GRil *ril);
112
gboolean g_ril_set_trace(GRil *ril, gboolean trace);
74
115
* If the function is not NULL, then on every read/write from the GIOChannel
75
116
* provided to GRil the logging function will be called with the
76
117
* input/output string and user data
78
gboolean g_ril_set_debug(GRil *ril, GRilDebugFunc func, gpointer user_data);
119
gboolean g_ril_set_debugf(GRil *ril, GRilDebugFunc func, gpointer user_data);
81
122
* Queue an RIL request for execution. The request contents are given