Gammu API  1.38.0
Debug

Typedefs

typedef struct _GSM_Debug_Info GSM_Debug_Info
 

Functions

GSM_Error GSM_SetDebugFunction (GSM_Log_Function info, void *data, GSM_Debug_Info *privdi)
 
GSM_Error GSM_SetDebugFile (const char *info, GSM_Debug_Info *privdi)
 
GSM_Error GSM_SetDebugFileDescriptor (FILE *fd, gboolean closable, GSM_Debug_Info *privdi)
 
GSM_Debug_InfoGSM_GetGlobalDebug (void)
 
gboolean GSM_SetDebugLevel (const char *info, GSM_Debug_Info *privdi)
 
gboolean GSM_SetDebugCoding (const char *info, GSM_Debug_Info *privdi)
 
gboolean GSM_SetDebugGlobal (gboolean info, GSM_Debug_Info *privdi)
 
void GSM_LogError (GSM_StateMachine *s, const char *message, const GSM_Error err)
 
int smprintf (GSM_StateMachine *s, const char *format,...)
 

Detailed Description

Debuging handling.

Typedef Documentation

§ GSM_Debug_Info

typedef struct _GSM_Debug_Info GSM_Debug_Info

Debugging configuration.

Definition at line 28 of file gammu-debug.h.

Function Documentation

§ GSM_GetGlobalDebug()

GSM_Debug_Info* GSM_GetGlobalDebug ( void  )

Returns global debug settings.

Returns
Pointer to global settings.

§ GSM_LogError()

void GSM_LogError ( GSM_StateMachine s,
const char *  message,
const GSM_Error  err 
)

Logs error to debug log with additional message.

Parameters
sState machine structure pointer.
messageString to be show in message.
errError code.

§ GSM_SetDebugCoding()

gboolean GSM_SetDebugCoding ( const char *  info,
GSM_Debug_Info privdi 
)

Sets debug encoding.

Parameters
infoEncoding to set.
privdiPointer to debug information data.
Returns
True on success.

§ GSM_SetDebugFile()

GSM_Error GSM_SetDebugFile ( const char *  info,
GSM_Debug_Info privdi 
)

Sets debug file.

Parameters
infoFile path.
privdiPointer to debug information data.
Returns
Error code.

§ GSM_SetDebugFileDescriptor()

GSM_Error GSM_SetDebugFileDescriptor ( FILE *  fd,
gboolean  closable,
GSM_Debug_Info privdi 
)

Sets debug file.

Parameters
fdFile descriptor.
privdiPointer to debug information data.
closableWhether Gammu can close the file when it is no longer needed for debug output. Please note that stderr or stdout are never closed.
Returns
Error code.

§ GSM_SetDebugFunction()

GSM_Error GSM_SetDebugFunction ( GSM_Log_Function  info,
void *  data,
GSM_Debug_Info privdi 
)

Sets logging function.

Parameters
infoFunction to call.
dataUser data to pass as a second parameter to callback.
privdiPointer to debug information data.
Returns
Error code.

§ GSM_SetDebugGlobal()

gboolean GSM_SetDebugGlobal ( gboolean  info,
GSM_Debug_Info privdi 
)

Enables using of global debugging configuration. Makes no effect on global debug configuration.

Parameters
infoEnable global debug usage..
privdiPointer to debug information data.
Returns
True on success.

§ GSM_SetDebugLevel()

gboolean GSM_SetDebugLevel ( const char *  info,
GSM_Debug_Info privdi 
)

Sets debug level.

Parameters
infoLevel as text.
privdiPointer to debug information data.
Returns
True on success.

§ smprintf()

int smprintf ( GSM_StateMachine s,
const char *  format,
  ... 
)

Prints string to defined debug log.

Parameters
sState machine, where to print.
formatFormat string as for printf.
Returns
Upon successful return, these functions return the number of characters printed (as printf).