Gammu API  1.38.0
gammu-misc.h File Reference
#include <stdio.h>
#include <gammu-file.h>
#include <gammu-config.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define MAX(a, b)   ((a)>(b) ? (a) : (b))
 
#define MIN(a, b)   ((a)<(b) ? (a) : (b))
 
#define GSM_GNUC_PREREQ(maj, min)   0
 
#define PRINTF_STYLE(f, a)
 
#define SCANF_STYLE(f, a)
 
#define WARNUNUSED
 
#define UNUSED
 
#define NORETURN
 
#define __FUNCTION__WORKING
 

Functions

size_t GetLine (FILE *File, char *Line, int count)
 
const char * GetGammuVersion (void)
 
const char * GetCompiler (void)
 
const char * GetOS (void)
 
const char * GetGammuLocalePath (void)
 
void GSM_InitLocales (const char *path)
 
void EncodeHexBin (char *dest, const unsigned char *src, size_t len)
 
gboolean GSM_IsNewerVersion (const char *latest_version, const char *current_version)
 
GSM_Error GSM_SetPower (GSM_StateMachine *s, gboolean on)
 

Detailed Description

Author
Michal Čihař

Miscellaneous helper functions.

Definition in file gammu-misc.h.

Macro Definition Documentation

§ __FUNCTION__WORKING

#define __FUNCTION__WORKING

Definition at line 128 of file gammu-misc.h.

§ GSM_GNUC_PREREQ

#define GSM_GNUC_PREREQ (   maj,
  min 
)    0

Definition at line 84 of file gammu-misc.h.

§ MAX

#define MAX (   a,
 
)    ((a)>(b) ? (a) : (b))

Definition at line 68 of file gammu-misc.h.

§ MIN

#define MIN (   a,
 
)    ((a)<(b) ? (a) : (b))

Definition at line 70 of file gammu-misc.h.

§ NORETURN

#define NORETURN

Definition at line 111 of file gammu-misc.h.

§ PRINTF_STYLE

#define PRINTF_STYLE (   f,
 
)

Definition at line 92 of file gammu-misc.h.

§ SCANF_STYLE

#define SCANF_STYLE (   f,
 
)

Definition at line 93 of file gammu-misc.h.

§ UNUSED

#define UNUSED

Definition at line 105 of file gammu-misc.h.

§ WARNUNUSED

#define WARNUNUSED

Definition at line 99 of file gammu-misc.h.

Function Documentation

§ EncodeHexBin()

void EncodeHexBin ( char *  dest,
const unsigned char *  src,
size_t  len 
)

Encodes text to hexadecimal binary representation.

§ GetCompiler()

const char* GetCompiler ( void  )

Gets compiler which was used to compile Gammu library.

§ GetGammuLocalePath()

const char* GetGammuLocalePath ( void  )

Returns path to Gammu locales.

§ GetGammuVersion()

const char* GetGammuVersion ( void  )

Gets Gammu library version.

§ GetLine()

size_t GetLine ( FILE *  File,
char *  Line,
int  count 
)

Reads single line from file.

Parameters
FileFile descriptor to read from.
LineBuffer where t ostore result.
countMaximal length of text which can be stored in buffer.
Returns
Length of read line, -1 on error.

§ GetOS()

const char* GetOS ( void  )

Gets host OS.

§ GSM_InitLocales()

void GSM_InitLocales ( const char *  path)

Initializes locales. This sets up things needed for proper string conversion from local charset as well as initializes gettext based translation.

Parameters
pathPath to gettext translation. If NULL compiled in default is used.

§ GSM_IsNewerVersion()

gboolean GSM_IsNewerVersion ( const char *  latest_version,
const char *  current_version 
)

Returns TRUE if firmware version is newer.

Parameters
latest_versionString containing version (eg. latest available).
current_versionString containing version (eg. current one).
Returns
True if latest_version > current_version.

§ GSM_SetPower()

GSM_Error GSM_SetPower ( GSM_StateMachine s,
gboolean  on 
)

Set Power On/Off the phone

Parameters
sState machine pointer.
onTRUE to power on the phone, FALSE to power off
Returns
Error code.