|
GSM_Debug_Info * | GSM_GetDebug (GSM_StateMachine *s) |
|
GSM_Debug_Info * | GSM_GetDI (GSM_StateMachine *s) |
|
GSM_Error | GSM_InitConnection_Log (GSM_StateMachine *s, int ReplyNum, GSM_Log_Function log_function, void *user_data) |
|
GSM_Error | GSM_InitConnection (GSM_StateMachine *s, int ReplyNum) |
|
GSM_Error | GSM_TerminateConnection (GSM_StateMachine *s) |
|
GSM_Error | GSM_AbortOperation (GSM_StateMachine *s) |
|
int | GSM_ReadDevice (GSM_StateMachine *s, gboolean waitforreply) |
|
gboolean | GSM_IsConnected (GSM_StateMachine *s) |
|
GSM_Error | GSM_FindGammuRC (INI_Section **result, const char *force_config) |
|
GSM_Error | GSM_ReadConfig (INI_Section *cfg_info, GSM_Config *cfg, int num) |
|
GSM_Config * | GSM_GetConfig (GSM_StateMachine *s, int num) |
|
int | GSM_GetConfigNum (const GSM_StateMachine *s) |
|
void | GSM_SetConfigNum (GSM_StateMachine *s, int sections) |
|
GSM_StateMachine * | GSM_AllocStateMachine (void) |
|
void | GSM_FreeStateMachine (GSM_StateMachine *s) |
|
GSM_ConnectionType | GSM_GetUsedConnection (GSM_StateMachine *s) |
|
GSM_Error | GSM_Install (GSM_StateMachine *s, const char *ExtraPath, gboolean Minimal) |
|
Generic state machine layer.
§ GSM_StateMachine
§ GSM_AbortOperation()
Aborts current operation.
This is thread safe call to abort any existing operations with the phone.
- Parameters
-
- Returns
- Error code
§ GSM_AllocStateMachine()
Allocates new clean state machine structure. You should free it then by GSM_FreeStateMachine.
- Returns
- Pointer to state machine structure.
§ GSM_FindGammuRC()
Finds and reads gammu configuration file. The search order depends on platform. On POSIX systems it looks for ~/.gammurc and then for /etc/gammurc, on Windows for gammurc in Application data folder, then in home and last fallback is in current driectory.
- Parameters
-
result | Ini file representation |
force_config | Forcing of custom path instead of autodetected one (if NULL, autodetection is performed). |
- Returns
- Error code
§ GSM_FreeStateMachine()
Frees state machine structure allocated by GSM_AllocStateMachine.
- Parameters
-
s | Pointer to state machine structure. |
§ GSM_GetConfig()
Gets gammu configuration from state machine. This actually returns pointer to internal configuration storage, so you can use it also for updating existing settings.
- Parameters
-
s | State machine data |
num | Number of section to read, -1 for currently used. |
- Returns
- Pointer to configuration.
§ GSM_GetConfigNum()
Gets number of active gammu configurations.
- Parameters
-
- Returns
- Number of sections.
§ GSM_GetDebug()
Gets debug information for state machine.
- Parameters
-
- Returns
- Debug information.
§ GSM_GetDI()
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.
- Parameters
-
- Returns
- Debug information.
§ GSM_GetUsedConnection()
Gets number of active gammu configurations.
- Parameters
-
- Returns
- Connection type.
§ GSM_InitConnection()
Initiates connection.
- Parameters
-
s | State machine data |
ReplyNum | Number of replies to await (usually 3). |
- Returns
- Error code
§ GSM_InitConnection_Log()
Initiates connection with custom logging callback.
- Parameters
-
s | State machine data |
ReplyNum | Number of replies to await (usually 3). |
log_function | Logging function, see GSM_SetDebugFunction. |
user_data | User data for logging function, see GSM_SetDebugFunction. |
- Returns
- Error code
- See also
- GSM_SetDebugFunction
§ GSM_Install()
Installs applet required for configured connection to the phone.
- Parameters
-
s | State machine data. |
ExtraPath | Extra path where to search for installation data. |
Minimal | Whether to do minimal installation (eg. without support libraries), useful for applet updates |
- Returns
- Result of operation.
§ GSM_IsConnected()
Detects whether state machine is connected.
- Parameters
-
- Returns
- Whether phone is connected.
§ GSM_ReadConfig()
Processes gammu configuration.
- Parameters
-
cfg_info | Ini file representation. |
cfg | Where to store configuration. |
num | Number of section to read. |
- Returns
- Whether we got valid configuration. Especially check for ERR_USING_DEFAULTS.
- See also
- GSM_FallbackConfig
§ GSM_ReadDevice()
Attempts to read data from phone. This can be used for getting status of incoming events, which would not be found out without polling device.
- Parameters
-
s | State machine data |
waitforreply | Whether to wait for some event |
- Returns
- Number of read bytes
§ GSM_SetConfigNum()
Gets number of active gammu configurations.
- Parameters
-
s | State machine data |
sections | Number of sections. |
§ GSM_TerminateConnection()
Terminates connection.
- Parameters
-
- Returns
- Error code