SMSD¶
-
GSM_Error
SMSD_InjectSMS(GSM_SMSDConfig * Config, GSM_MultiSMSMessage * sms, char * NewID)¶ Enqueues SMS message in SMS daemon queue.
- Return
- Error code
- Parameters
Config-SMSD configuration pointer.
sms-Message data to send.
NewID-Pointer to string where ID of new message will be written. Can be NULL and then it is ignored.
-
GSM_Error
SMSD_GetStatus(GSM_SMSDConfig * Config, GSM_SMSDStatus * status)¶ Gets SMSD status via shared memory.
- Return
- Error code
- Parameters
Config-SMSD configuration pointer.
status-pointer where status will be copied
-
GSM_Error
SMSD_Shutdown(GSM_SMSDConfig * Config)¶ Flags SMSD daemon to terminate itself gracefully.
- Return
- Error code
- Parameters
Config-Pointer to SMSD configuration data.
-
GSM_Error
SMSD_ReadConfig(const char * filename, GSM_SMSDConfig * Config, gboolean uselog)¶ Reads SMSD configuration.
- Return
- Error code
- Parameters
filename-File name of configuration.
Config-Pointer to SMSD configuration data.
uselog-Whether to log errors to configured log.
-
GSM_Error
SMSD_MainLoop(GSM_SMSDConfig * Config, gboolean exit_on_failure, int max_failures)¶ Main SMS daemon loop. It connects to phone, scans for messages and sends messages from inbox. Can be interrupted by SMSD_Shutdown.
- See
- SMSD_Shutdown
- Return
- Error code
- Parameters
Config-Pointer to SMSD configuration data.
exit_on_failure-Whether failure should lead to terminaton of program.
max_failures-Maximal number of failures after which SMSD will terminate. Use 0 to not terminate on failures.
-
GSM_SMSDConfig*
SMSD_NewConfig(const char * name)¶ Creates new SMSD configuration.
- Return
- Pointer to SMSD configuration data block.
- Parameters
name-Name of process, will be used for logging. If NULL, gammu-smsd text is used.
-
void
SMSD_FreeConfig(GSM_SMSDConfig * config)¶ Frees SMSD configuration.
- Parameters
config-Pointer to SMSD configuration data.
-
struct
GSM_SMSDStatus¶ Status structure, which can be found in shared memory (if supported on platform).
Public Members
-
int
Version¶ Version of this structure (1 for now).
-
char GSM_SMSDStatus::PhoneID[SMSD_TEXT_LENGTH+1] PhoneID from configuration.
-
char GSM_SMSDStatus::Client[SMSD_TEXT_LENGTH+1] Client software name.
-
GSM_BatteryCharge
Charge¶ Current phone battery state.
-
GSM_SignalQuality
Network¶ Current network state.
-
int
Received¶ Number of received messages.
-
int
Sent¶ Number of sent messages.
-
int
Failed¶ Number of messages which failed to be send.
-
char GSM_SMSDStatus::IMEI[GSM_MAX_IMEI_LENGTH+1] Phone IMEI.
-
int
-
typedef
GSM_SMSDConfig¶ SMSD configuration data, these are not expected to be manipulated directly by application.