GIsiIndicationFunc func[256];
void *data[256];
} ind;
+
+ /* Debugging */
+ GIsiDebugFunc debug_func;
+ void *debug_data;
};
static gboolean g_isi_callback(GIOChannel *channel, GIOCondition cond,
}
/**
+ * Set a debugging function for @a client. This function will be
+ * called whenever an ISI protocol message is sent or received.
+ * @param client client to debug
+ * @param func debug function
+ * @param opaque user data
+ */
+void g_isi_client_set_debug(GIsiClient *client, GIsiDebugFunc func,
+ void *opaque)
+{
+ if (!client)
+ return;
+
+ client->debug_func = func;
+ client->debug_data = opaque;
+}
+
+/**
* Destroys an ISI client, cancels all pending transactions and subscriptions.
* @param client client to destroy
*/
return NULL;
}
+ if (cl->debug_func)
+ cl->debug_func(buf, len, cl->debug_data);
+
cl->func[id] = cb;
cl->data[id] = opaque;
return TRUE;
msg = (uint8_t *)buf;
+
+ if (cl->debug_func)
+ cl->debug_func(msg, len, cl->debug_data);
+
if (indication) {
/* Message ID at offset 1 */
id = msg[1];
const void *restrict data, size_t len,
uint16_t object, void *opaque);
+typedef void (*GIsiDebugFunc) (const void *restrict data, size_t len,
+ void *opaque);
+
GIsiClient *g_isi_client_create(GIsiModem *modem, uint8_t resource);
uint8_t g_isi_client_resource(GIsiClient *client);
+void g_isi_client_set_debug(GIsiClient *client, GIsiDebugFunc func,
+ void *opaque);
+
void g_isi_client_destroy(GIsiClient *client);
int g_isi_client_error(const GIsiClient *client);