Gammu internals
1.38.0
|
#include <string.h>
#include <gammu.h>
#include "gsmstate.h"
#include "gsmcomon.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | PRINT_FUNCTION_START smprintf(s, "Entering %s:%d\n", __FILE__, __LINE__); |
#define | PRINT_FUNCTION_END smprintf(s, "Leaving %s:%d\n", __FILE__, __LINE__); |
#define | PRINT_MEMORY_INFO() smprintf(s, "Location = %d, Memory type = %s\n", entry->Location, GSM_MemoryTypeToString(entry->MemoryType)); |
#define | PRINT_TODO_INFO() smprintf(s, "Location = %d\n", ToDo->Location); |
#define | PRINT_CALENDAR_INFO() smprintf(s, "Location = %d\n", Note->Location); |
#define | PRINT_NOTE_INFO() smprintf(s, "Location = %d\n", Note->Location); |
#define | PRINT_MSMS_INFO() smprintf(s, "Number = %d, Location = %d, Folder = %d\n", sms->Number, sms->SMS[0].Location, sms->SMS[0].Folder); |
#define | PRINT_SMS_INFO() smprintf(s, "Location = %d, Folder = %d\n", sms->Location, sms->Folder); |
#define | PRINT_START() if (start) smprintf(s, "Starting reading!\n"); |
#define | PRINT_LOG_ERROR(err) |
#define | CHECK_PHONE_CONNECTION() |
#define | RUN_RESTARTABLE(return_value, function_call) |
#define CHECK_PHONE_CONNECTION | ( | ) |
Checks whether we are connected to phone, fails with error otherwise.
Definition at line 38 of file api.c.
Referenced by GSM_AddCalendar(), GSM_AddCategory(), GSM_AddFilePart(), GSM_AddFolder(), GSM_AddMemory(), GSM_AddNote(), GSM_AddSMS(), GSM_AddSMSFolder(), GSM_AddToDo(), GSM_AnswerCall(), GSM_CancelAllDiverts(), GSM_CancelCall(), GSM_ClearFMStations(), GSM_ConferenceCall(), GSM_DeleteAllCalendar(), GSM_DeleteAllMemory(), GSM_DeleteAllNotes(), GSM_DeleteAllToDo(), GSM_DeleteCalendar(), GSM_DeleteFile(), GSM_DeleteFolder(), GSM_DeleteMemory(), GSM_DeleteNote(), GSM_DeleteSMS(), GSM_DeleteSMSFolder(), GSM_DeleteToDo(), GSM_DeleteUserRingtones(), GSM_DeleteWAPBookmark(), GSM_DialService(), GSM_DialVoice(), GSM_EnterSecurityCode(), GSM_GetAlarm(), GSM_GetBatteryCharge(), GSM_GetBitmap(), GSM_GetCalendar(), GSM_GetCalendarSettings(), GSM_GetCalendarStatus(), GSM_GetCallDivert(), GSM_GetCategory(), GSM_GetCategoryStatus(), GSM_GetChatSettings(), GSM_GetDateTime(), GSM_GetDisplayStatus(), GSM_GetFilePart(), GSM_GetFileSystemStatus(), GSM_GetFirmware(), GSM_GetFMStation(), GSM_GetFolderListing(), GSM_GetGPRSAccessPoint(), GSM_GetHardware(), GSM_GetIMEI(), GSM_GetLocale(), GSM_GetManufactureMonth(), GSM_GetManufacturer(), GSM_GetMemory(), GSM_GetMemoryStatus(), GSM_GetMMSFolders(), GSM_GetMMSSettings(), GSM_GetModel(), GSM_GetNetworkInfo(), GSM_GetNextCalendar(), GSM_GetNextFileFolder(), GSM_GetNextMemory(), GSM_GetNextMMSFileInfo(), GSM_GetNextNote(), GSM_GetNextRootFolder(), GSM_GetNextSMS(), GSM_GetNextToDo(), GSM_GetNote(), GSM_GetNotesStatus(), GSM_GetOriginalIMEI(), GSM_GetPPM(), GSM_GetProductCode(), GSM_GetProfile(), GSM_GetRingtone(), GSM_GetRingtonesInfo(), GSM_GetScreenshot(), GSM_GetSecurityStatus(), GSM_GetSignalQuality(), GSM_GetSIMIMSI(), GSM_GetSMS(), GSM_GetSMSC(), GSM_GetSMSFolders(), GSM_GetSMSStatus(), GSM_GetSpeedDial(), GSM_GetSyncMLSettings(), GSM_GetToDo(), GSM_GetToDoStatus(), GSM_GetWAPBookmark(), GSM_GetWAPSettings(), GSM_HoldCall(), GSM_PlayTone(), GSM_PressKey(), GSM_Reset(), GSM_ResetPhoneSettings(), GSM_SendDTMF(), GSM_SendFilePart(), GSM_SendSavedSMS(), GSM_SendSMS(), GSM_SetAlarm(), GSM_SetAutoNetworkLogin(), GSM_SetBitmap(), GSM_SetCalendar(), GSM_SetCalendarSettings(), GSM_SetCallDivert(), GSM_SetChatSettings(), GSM_SetDateTime(), GSM_SetFastSMSSending(), GSM_SetFileAttributes(), GSM_SetFMStation(), GSM_SetGPRSAccessPoint(), GSM_SetIncomingCall(), GSM_SetIncomingCB(), GSM_SetIncomingSMS(), GSM_SetIncomingUSSD(), GSM_SetLocale(), GSM_SetMemory(), GSM_SetMMSSettings(), GSM_SetNote(), GSM_SetPower(), GSM_SetProfile(), GSM_SetRingtone(), GSM_SetSMS(), GSM_SetSMSC(), GSM_SetSpeedDial(), GSM_SetSyncMLSettings(), GSM_SetToDo(), GSM_SetWAPBookmark(), GSM_SetWAPSettings(), GSM_SplitCall(), GSM_SwitchCall(), GSM_TransferCall(), and GSM_UnholdCall().
#define PRINT_CALENDAR_INFO | ( | ) | smprintf(s, "Location = %d\n", Note->Location); |
Definition at line 17 of file api.c.
Referenced by GSM_AddCalendar(), GSM_DeleteCalendar(), GSM_GetCalendar(), GSM_GetNextCalendar(), and GSM_SetCalendar().
#define PRINT_FUNCTION_END smprintf(s, "Leaving %s:%d\n", __FILE__, __LINE__); |
#define PRINT_FUNCTION_START smprintf(s, "Entering %s:%d\n", __FILE__, __LINE__); |
#define PRINT_LOG_ERROR | ( | err | ) |
Prints error message (if any) to debug log.
err | Error code to check. |
Definition at line 28 of file api.c.
Referenced by GSM_AddCalendar(), GSM_AddCategory(), GSM_AddFilePart(), GSM_AddFolder(), GSM_AddMemory(), GSM_AddNote(), GSM_AddSMS(), GSM_AddSMSFolder(), GSM_AddToDo(), GSM_AnswerCall(), GSM_CancelAllDiverts(), GSM_CancelCall(), GSM_ClearFMStations(), GSM_ConferenceCall(), GSM_DeleteAllCalendar(), GSM_DeleteAllMemory(), GSM_DeleteAllNotes(), GSM_DeleteAllToDo(), GSM_DeleteCalendar(), GSM_DeleteFile(), GSM_DeleteFolder(), GSM_DeleteMemory(), GSM_DeleteNote(), GSM_DeleteSMS(), GSM_DeleteSMSFolder(), GSM_DeleteToDo(), GSM_DeleteUserRingtones(), GSM_DeleteWAPBookmark(), GSM_DialService(), GSM_DialVoice(), GSM_EnterSecurityCode(), GSM_GetAlarm(), GSM_GetBatteryCharge(), GSM_GetBitmap(), GSM_GetCalendar(), GSM_GetCalendarSettings(), GSM_GetCalendarStatus(), GSM_GetCallDivert(), GSM_GetCategory(), GSM_GetCategoryStatus(), GSM_GetChatSettings(), GSM_GetDateTime(), GSM_GetDisplayStatus(), GSM_GetFilePart(), GSM_GetFileSystemStatus(), GSM_GetFirmware(), GSM_GetFMStation(), GSM_GetFolderListing(), GSM_GetGPRSAccessPoint(), GSM_GetHardware(), GSM_GetIMEI(), GSM_GetLocale(), GSM_GetManufactureMonth(), GSM_GetManufacturer(), GSM_GetMemory(), GSM_GetMemoryStatus(), GSM_GetMMSFolders(), GSM_GetMMSSettings(), GSM_GetModel(), GSM_GetNetworkInfo(), GSM_GetNextCalendar(), GSM_GetNextFileFolder(), GSM_GetNextMemory(), GSM_GetNextMMSFileInfo(), GSM_GetNextNote(), GSM_GetNextRootFolder(), GSM_GetNextSMS(), GSM_GetNextToDo(), GSM_GetNote(), GSM_GetNotesStatus(), GSM_GetOriginalIMEI(), GSM_GetPPM(), GSM_GetProductCode(), GSM_GetProfile(), GSM_GetRingtone(), GSM_GetRingtonesInfo(), GSM_GetScreenshot(), GSM_GetSecurityStatus(), GSM_GetSignalQuality(), GSM_GetSIMIMSI(), GSM_GetSMS(), GSM_GetSMSC(), GSM_GetSMSFolders(), GSM_GetSMSStatus(), GSM_GetSpeedDial(), GSM_GetSyncMLSettings(), GSM_GetToDo(), GSM_GetToDoStatus(), GSM_GetWAPBookmark(), GSM_GetWAPSettings(), GSM_HoldCall(), GSM_Install(), GSM_PlayTone(), GSM_PressKey(), GSM_Reset(), GSM_ResetPhoneSettings(), GSM_SendDTMF(), GSM_SendFilePart(), GSM_SendSavedSMS(), GSM_SendSMS(), GSM_SetAlarm(), GSM_SetAutoNetworkLogin(), GSM_SetBitmap(), GSM_SetCalendar(), GSM_SetCalendarSettings(), GSM_SetCallDivert(), GSM_SetChatSettings(), GSM_SetDateTime(), GSM_SetFastSMSSending(), GSM_SetFileAttributes(), GSM_SetFMStation(), GSM_SetGPRSAccessPoint(), GSM_SetIncomingCall(), GSM_SetIncomingCB(), GSM_SetIncomingSMS(), GSM_SetIncomingUSSD(), GSM_SetLocale(), GSM_SetMemory(), GSM_SetMMSSettings(), GSM_SetNote(), GSM_SetPower(), GSM_SetProfile(), GSM_SetRingtone(), GSM_SetSMS(), GSM_SetSMSC(), GSM_SetSpeedDial(), GSM_SetSyncMLSettings(), GSM_SetToDo(), GSM_SetWAPBookmark(), GSM_SetWAPSettings(), GSM_SplitCall(), GSM_SwitchCall(), GSM_TransferCall(), and GSM_UnholdCall().
#define PRINT_MEMORY_INFO | ( | ) | smprintf(s, "Location = %d, Memory type = %s\n", entry->Location, GSM_MemoryTypeToString(entry->MemoryType)); |
Definition at line 15 of file api.c.
Referenced by GSM_AddMemory(), GSM_DeleteMemory(), GSM_GetMemory(), GSM_GetNextMemory(), and GSM_SetMemory().
#define PRINT_MSMS_INFO | ( | ) | smprintf(s, "Number = %d, Location = %d, Folder = %d\n", sms->Number, sms->SMS[0].Location, sms->SMS[0].Folder); |
Definition at line 19 of file api.c.
Referenced by GSM_GetNextSMS(), and GSM_GetSMS().
#define PRINT_NOTE_INFO | ( | ) | smprintf(s, "Location = %d\n", Note->Location); |
Definition at line 18 of file api.c.
Referenced by GSM_AddNote(), GSM_DeleteNote(), GSM_GetNextNote(), GSM_GetNote(), and GSM_SetNote().
#define PRINT_SMS_INFO | ( | ) | smprintf(s, "Location = %d, Folder = %d\n", sms->Location, sms->Folder); |
Definition at line 20 of file api.c.
Referenced by GSM_AddSMS(), GSM_DeleteSMS(), and GSM_SetSMS().
#define PRINT_START | ( | ) | if (start) smprintf(s, "Starting reading!\n"); |
Definition at line 21 of file api.c.
Referenced by GSM_GetFolderListing(), GSM_GetNextCalendar(), GSM_GetNextFileFolder(), GSM_GetNextMemory(), GSM_GetNextMMSFileInfo(), GSM_GetNextNote(), GSM_GetNextSMS(), and GSM_GetNextToDo().
#define PRINT_TODO_INFO | ( | ) | smprintf(s, "Location = %d\n", ToDo->Location); |
Definition at line 16 of file api.c.
Referenced by GSM_AddToDo(), GSM_DeleteToDo(), GSM_GetNextToDo(), GSM_GetToDo(), and GSM_SetToDo().
#define RUN_RESTARTABLE | ( | return_value, | |
function_call | |||
) |
Tries the command a couple of times to see if it can complete without an ERR_BUSY return.
Definition at line 56 of file api.c.
Referenced by GSM_DeleteMemory(), and GSM_SetMemory().
GSM_Error GSM_ClearFMStations | ( | GSM_StateMachine * | s | ) |
Clears defined FM stations.
Definition at line 1685 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone_Functions::ClearFMStations, GSM_Phone::Functions, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_DeleteUserRingtones | ( | GSM_StateMachine * | s | ) |
Deletes user defined ringtones from phone.
Definition at line 1092 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone_Functions::DeleteUserRingtones, GSM_Phone::Functions, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetChatSettings | ( | GSM_StateMachine * | s, |
GSM_ChatSettings * | settings | ||
) |
Acquires chat/presence settings.
Definition at line 1209 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetChatSettings, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetFMStation | ( | GSM_StateMachine * | s, |
GSM_FMStation * | FMStation | ||
) |
Reads FM station.
Definition at line 1659 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetFMStation, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetGPRSAccessPoint | ( | GSM_StateMachine * | s, |
GSM_GPRSAccessPoint * | point | ||
) |
Gets GPRS access point.
Definition at line 1843 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetGPRSAccessPoint, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetLocale | ( | GSM_StateMachine * | s, |
GSM_Locale * | locale | ||
) |
Gets locale from phone.
Definition at line 281 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetLocale, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetMMSSettings | ( | GSM_StateMachine * | s, |
GSM_MultiWAPSettings * | settings | ||
) |
Acquires MMS settings.
Definition at line 1235 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetMMSSettings, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetProfile | ( | GSM_StateMachine * | s, |
GSM_Profile * | Profile | ||
) |
Reads profile.
Definition at line 1633 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetProfile, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetRingtone | ( | GSM_StateMachine * | s, |
GSM_Ringtone * | Ringtone, | ||
gboolean | PhoneRingtone | ||
) |
Gets ringtone from phone.
Definition at line 1053 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetRingtone, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetRingtonesInfo | ( | GSM_StateMachine * | s, |
GSM_AllRingtonesInfo * | Info | ||
) |
Acquires ringtone informaiton.
Definition at line 1079 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetRingtonesInfo, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_GetSyncMLSettings | ( | GSM_StateMachine * | s, |
GSM_SyncMLSettings * | settings | ||
) |
Acquires SyncML settings.
Definition at line 1183 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetSyncMLSettings, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
GSM_Error GSM_PlayTone | ( | GSM_StateMachine * | s, |
int | Herz, | ||
unsigned char | Volume, | ||
gboolean | start | ||
) |
Plays tone.
Definition at line 1105 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, GSM_Phone_Functions::PlayTone, and PRINT_LOG_ERROR.
GSM_Error GSM_Reset | ( | GSM_StateMachine * | s, |
gboolean | hard | ||
) |
Performs phone reset.
Definition at line 333 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::Reset.
Referenced by GSM_WaitFor().
GSM_Error GSM_ResetPhoneSettings | ( | GSM_StateMachine * | s, |
GSM_ResetSettingsType | Type | ||
) |
Resets phone settings.
Definition at line 346 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::ResetPhoneSettings.
GSM_Error GSM_SetAutoNetworkLogin | ( | GSM_StateMachine * | s | ) |
Enables network auto login.
Definition at line 398 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetAutoNetworkLogin.
GSM_Error GSM_SetChatSettings | ( | GSM_StateMachine * | s, |
GSM_ChatSettings * | settings | ||
) |
Changes chat/presence settings.
Definition at line 1222 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetChatSettings.
GSM_Error GSM_SetFMStation | ( | GSM_StateMachine * | s, |
GSM_FMStation * | FMStation | ||
) |
Sets FM station.
Definition at line 1672 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetFMStation.
GSM_Error GSM_SetGPRSAccessPoint | ( | GSM_StateMachine * | s, |
GSM_GPRSAccessPoint * | point | ||
) |
Sets GPRS access point.
Definition at line 1856 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetGPRSAccessPoint.
GSM_Error GSM_SetLocale | ( | GSM_StateMachine * | s, |
GSM_Locale * | locale | ||
) |
Sets locale of phone.
Definition at line 294 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetLocale.
GSM_Error GSM_SetMMSSettings | ( | GSM_StateMachine * | s, |
GSM_MultiWAPSettings * | settings | ||
) |
Changes MMS settings.
Definition at line 1248 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetMMSSettings.
GSM_Error GSM_SetPower | ( | GSM_StateMachine * | s, |
gboolean | on | ||
) |
Power on/off the phone.
Definition at line 307 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetPower.
GSM_Error GSM_SetProfile | ( | GSM_StateMachine * | s, |
GSM_Profile * | Profile | ||
) |
Updates profile.
Definition at line 1646 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetProfile.
GSM_Error GSM_SetRingtone | ( | GSM_StateMachine * | s, |
GSM_Ringtone * | Ringtone, | ||
int * | maxlength | ||
) |
Sets ringtone in phone.
Definition at line 1066 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetRingtone.
GSM_Error GSM_SetSyncMLSettings | ( | GSM_StateMachine * | s, |
GSM_SyncMLSettings * | settings | ||
) |
Changes SyncML settings.
Definition at line 1196 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetSyncMLSettings.