Debug

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

Sets logging function.

Return

Error code.

Parameters
  • info: Function to call.

  • data: User data to pass as a second parameter to callback.

  • privdi: Pointer to debug information data.

GSM_Error GSM_SetDebugFile(const char *info, GSM_Debug_Info *privdi)

Sets debug file.

Return

Error code.

Parameters
  • info: File path.

  • privdi: Pointer to debug information data.

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

Sets debug file.

Return

Error code.

Parameters
  • fd: File descriptor.

  • privdi: Pointer to debug information data.

  • closable: Whether Gammu can close the file when it is no longer needed for debug output. Please note that stderr or stdout are never closed.

GSM_Debug_Info *GSM_GetGlobalDebug(void)

Returns global debug settings.

Return

Pointer to global settings.

GSM_Debug_Info *GSM_GetDebug(GSM_StateMachine *s)

Gets debug information for state machine.

Return

Debug information.

Parameters
  • s: State machine data

GSM_Debug_Info *GSM_GetDI(GSM_StateMachine *s)

Returns debug information active for state machine. Please note that it can be either global debug or state machine debug structure, depending on use_global flag. For configuring usite GSM_GetDebug.

Return

Debug information.

Parameters
  • s: State machine data

gboolean GSM_SetDebugLevel(const char *info, GSM_Debug_Info *privdi)

Sets debug level.

Return

True on success.

Parameters
  • info: Level as text.

  • privdi: Pointer to debug information data.

gboolean GSM_SetDebugCoding(const char *info, GSM_Debug_Info *privdi)

Sets debug encoding.

Return

True on success.

Parameters
  • info: Encoding to set.

  • privdi: Pointer to debug information data.

gboolean GSM_SetDebugGlobal(gboolean info, GSM_Debug_Info *privdi)

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

Return

True on success.

Parameters
  • info: Enable global debug usage..

  • privdi: Pointer to debug information data.

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

Logs error to debug log with additional message.

Parameters
  • s: State machine structure pointer.

  • message: String to be show in message.

  • err: Error code.

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

Prints string to defined debug log.

Return

Upon successful return, these functions return the number of characters printed (as printf).

Parameters
  • s: State machine, where to print.

  • format: Format string as for printf.

typedef struct _GSM_Debug_Info GSM_Debug_Info

Debugging configuration.