mirror of git://git.sysmocom.de/ofono
Add functions for disconnect and debug handling
This commit is contained in:
parent
c9ba0e7df5
commit
094fdd4e71
|
@ -35,8 +35,12 @@
|
||||||
#include "gatmux.h"
|
#include "gatmux.h"
|
||||||
|
|
||||||
struct _GAtMux {
|
struct _GAtMux {
|
||||||
gint ref_count; /* Ref count */
|
gint ref_count; /* Ref count */
|
||||||
GIOChannel *channel; /* channel */
|
GIOChannel *channel; /* channel */
|
||||||
|
GAtDisconnectFunc user_disconnect; /* user disconnect func */
|
||||||
|
gpointer user_disconnect_data; /* user disconnect data */
|
||||||
|
GAtDebugFunc debugf; /* debugging output function */
|
||||||
|
gpointer debug_data; /* Data to pass to debug func */
|
||||||
};
|
};
|
||||||
|
|
||||||
GAtMux *g_at_mux_new(GIOChannel *channel)
|
GAtMux *g_at_mux_new(GIOChannel *channel)
|
||||||
|
@ -125,3 +129,26 @@ gboolean g_at_mux_shutdown(GAtMux *mux)
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean g_at_mux_set_disconnect_function(GAtMux *mux,
|
||||||
|
GAtDisconnectFunc disconnect, gpointer user_data)
|
||||||
|
{
|
||||||
|
if (mux == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
mux->user_disconnect = disconnect;
|
||||||
|
mux->user_disconnect_data = user_data;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean g_at_mux_set_debug(GAtMux *mux, GAtDebugFunc func, gpointer user)
|
||||||
|
{
|
||||||
|
if (mux == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
mux->debugf = func;
|
||||||
|
mux->debug_data = user;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gatchat.h"
|
||||||
|
|
||||||
struct _GAtMux;
|
struct _GAtMux;
|
||||||
|
|
||||||
typedef struct _GAtMux GAtMux;
|
typedef struct _GAtMux GAtMux;
|
||||||
|
@ -38,6 +40,11 @@ void g_at_mux_unref(GAtMux *mux);
|
||||||
|
|
||||||
gboolean g_at_mux_shutdown(GAtMux *mux);
|
gboolean g_at_mux_shutdown(GAtMux *mux);
|
||||||
|
|
||||||
|
gboolean g_at_mux_set_disconnect_function(GAtMux *mux,
|
||||||
|
GAtDisconnectFunc disconnect, gpointer user_data);
|
||||||
|
|
||||||
|
gboolean g_at_mux_set_debug(GAtMux *mux, GAtDebugFunc func, gpointer user);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue