SMS messages
[Messages]

Collaboration diagram for SMS messages:

Data Structures

struct  GSM_SMSMemoryStatus
struct  GSM_SMSValidity
struct  GSM_SMSC
struct  GSM_UDHHeader
struct  GSM_SMSMessage
struct  GSM_OneSMSFolder
struct  GSM_SMSFolders
struct  GSM_SiemensOTASMSInfo
struct  GSM_MultiSMSMessage
struct  GSM_MultiPartSMSEntry
struct  GSM_MultiPartSMSInfo

Enumerations

enum  GSM_SMSFormat { SMS_FORMAT_Pager = 1, SMS_FORMAT_Fax, SMS_FORMAT_Email, SMS_FORMAT_Text }
enum  GSM_ValidityPeriod {
  SMS_VALID_1_Hour = 0x0b, SMS_VALID_6_Hours = 0x47, SMS_VALID_1_Day = 0xa7, SMS_VALID_3_Days = 0xa9,
  SMS_VALID_1_Week = 0xad, SMS_VALID_Max_Time = 0xff
}
enum  GSM_ValidityPeriodFormat { SMS_Validity_NotAvailable = 1, SMS_Validity_RelativeFormat }
enum  GSM_SMS_State { SMS_Sent = 1, SMS_UnSent, SMS_Read, SMS_UnRead }
enum  GSM_Coding_Type {
  SMS_Coding_Unicode_No_Compression = 1, SMS_Coding_Unicode_Compression, SMS_Coding_Default_No_Compression, SMS_Coding_Default_Compression,
  SMS_Coding_8bit
}
enum  GSM_UDH {
  UDH_NoUDH = 1, UDH_ConcatenatedMessages, UDH_ConcatenatedMessages16bit, UDH_DisableVoice,
  UDH_DisableFax, UDH_DisableEmail, UDH_EnableVoice, UDH_EnableFax,
  UDH_EnableEmail, UDH_VoidSMS, UDH_NokiaRingtone, UDH_NokiaRingtoneLong,
  UDH_NokiaOperatorLogo, UDH_NokiaOperatorLogoLong, UDH_NokiaCallerLogo, UDH_NokiaWAP,
  UDH_NokiaWAPLong, UDH_NokiaCalendarLong, UDH_NokiaProfileLong, UDH_NokiaPhonebookLong,
  UDH_UserUDH, UDH_MMSIndicatorLong
}
enum  GSM_SMSMessageType { SMS_Deliver = 1, SMS_Status_Report, SMS_Submit }
enum  EncodeMultiPartSMSID {
  SMS_Text = 1, SMS_ConcatenatedTextLong, SMS_ConcatenatedAutoTextLong, SMS_ConcatenatedTextLong16bit,
  SMS_ConcatenatedAutoTextLong16bit, SMS_NokiaProfileLong, SMS_NokiaPictureImageLong, SMS_NokiaScreenSaverLong,
  SMS_NokiaRingtone, SMS_NokiaRingtoneLong, SMS_NokiaOperatorLogo, SMS_NokiaOperatorLogoLong,
  SMS_NokiaCallerLogo, SMS_NokiaWAPBookmarkLong, SMS_NokiaWAPSettingsLong, SMS_NokiaMMSSettingsLong,
  SMS_NokiaVCARD10Long, SMS_NokiaVCARD21Long, SMS_NokiaVCALENDAR10Long, SMS_NokiaVTODOLong,
  SMS_VCARD10Long, SMS_VCARD21Long, SMS_DisableVoice, SMS_DisableFax,
  SMS_DisableEmail, SMS_EnableVoice, SMS_EnableFax, SMS_EnableEmail,
  SMS_VoidSMS, SMS_EMSSound10, SMS_EMSSound12, SMS_EMSSonyEricssonSound,
  SMS_EMSSound10Long, SMS_EMSSound12Long, SMS_EMSSonyEricssonSoundLong, SMS_EMSPredefinedSound,
  SMS_EMSPredefinedAnimation, SMS_EMSAnimation, SMS_EMSFixedBitmap, SMS_EMSVariableBitmap,
  SMS_EMSVariableBitmapLong, SMS_MMSIndicatorLong, SMS_WAPIndicatorLong, SMS_AlcatelMonoBitmapLong,
  SMS_AlcatelMonoAnimationLong, SMS_AlcatelSMSTemplateName, SMS_SiemensFile
}

Functions

GSM_Error GSM_DecodeSMSFrame (GSM_Debug_Info *di, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout)
GSM_Error GSM_EncodeSMSFrame (GSM_Debug_Info *di, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout, int *length, bool clear)
GSM_Error GSM_DecodeSMSFrameStatusReportData (GSM_Debug_Info *di, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout)
GSM_Error GSM_DecodeSMSFrameText (GSM_Debug_Info *di, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout)
void GSM_DecodeUDHHeader (GSM_Debug_Info *di, GSM_UDHHeader *UDH)
void GSM_EncodeUDHHeader (GSM_Debug_Info *di, GSM_UDHHeader *UDH)
void GSM_SetDefaultReceivedSMSData (GSM_SMSMessage *SMS)
void GSM_SetDefaultSMSData (GSM_SMSMessage *SMS)
bool GSM_DecodeSiemensOTASMS (GSM_Debug_Info *di, GSM_SiemensOTASMSInfo *Info, GSM_SMSMessage *SMS)
GSM_Error PHONE_EncodeSMSFrame (GSM_StateMachine *s, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout, int *length, bool clear)
GSM_Error GSM_EncodeMultiPartSMS (GSM_Debug_Info *di, GSM_MultiPartSMSInfo *Info, GSM_MultiSMSMessage *SMS)
bool GSM_DecodeMultiPartSMS (GSM_Debug_Info *di, GSM_MultiPartSMSInfo *Info, GSM_MultiSMSMessage *SMS, bool ems)
void GSM_ClearMultiPartSMSInfo (GSM_MultiPartSMSInfo *Info)
void GSM_FreeMultiPartSMSInfo (GSM_MultiPartSMSInfo *Info)
GSM_Error GSM_LinkSMS (GSM_Debug_Info *di, GSM_MultiSMSMessage **INPUT, GSM_MultiSMSMessage **OUTPUT, bool ems)
GSM_Error GSM_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc)
GSM_Error GSM_SetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc)
GSM_Error GSM_GetSMSStatus (GSM_StateMachine *s, GSM_SMSMemoryStatus *status)
GSM_Error GSM_GetSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms)
GSM_Error GSM_GetNextSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start)
GSM_Error GSM_SetSMS (GSM_StateMachine *s, GSM_SMSMessage *sms)
GSM_Error GSM_AddSMS (GSM_StateMachine *s, GSM_SMSMessage *sms)
GSM_Error GSM_DeleteSMS (GSM_StateMachine *s, GSM_SMSMessage *sms)
GSM_Error GSM_SendSMS (GSM_StateMachine *s, GSM_SMSMessage *sms)
GSM_Error GSM_SendSavedSMS (GSM_StateMachine *s, int Folder, int Location)
GSM_Error GSM_SetFastSMSSending (GSM_StateMachine *s, bool enable)
GSM_Error GSM_SetIncomingSMS (GSM_StateMachine *s, bool enable)
GSM_Error GSM_GetSMSFolders (GSM_StateMachine *s, GSM_SMSFolders *folders)
GSM_Error GSM_AddSMSFolder (GSM_StateMachine *s, unsigned char *name)
GSM_Error GSM_DeleteSMSFolder (GSM_StateMachine *s, int ID)

Variables

GSM_SMSMessageLayout PHONE_SMSSubmit
GSM_SMSMessageLayout PHONE_SMSDeliver
GSM_SMSMessageLayout PHONE_SMSStatusReport

Detailed Description

SMS messages manipulations.

Enumeration Type Documentation

ID during packing SMS for Smart Messaging 3.0, EMS and other

Enumerator:
SMS_Text  1 text SMS.
SMS_ConcatenatedTextLong  Contacenated SMS, when longer than 1 SMS.
SMS_ConcatenatedAutoTextLong  Contacenated SMS, auto Default/Unicode coding.
SMS_ConcatenatedTextLong16bit 
SMS_ConcatenatedAutoTextLong16bit 
SMS_NokiaProfileLong  Nokia profile = Name, Ringtone, ScreenSaver
SMS_NokiaPictureImageLong  Nokia Picture Image + (text)
SMS_NokiaScreenSaverLong  Nokia screen saver + (text)
SMS_NokiaRingtone  Nokia ringtone - old SM2.0 format, 1 SMS
SMS_NokiaRingtoneLong  Nokia ringtone contacenated, when very long
SMS_NokiaOperatorLogo  Nokia 72x14 operator logo, 1 SMS
SMS_NokiaOperatorLogoLong  Nokia 72x14 op logo or 78x21 in 2 SMS
SMS_NokiaCallerLogo  Nokia 72x14 caller logo, 1 SMS
SMS_NokiaWAPBookmarkLong  Nokia WAP bookmark in 1 or 2 SMS
SMS_NokiaWAPSettingsLong  Nokia WAP settings in 2 SMS
SMS_NokiaMMSSettingsLong  Nokia MMS settings in 2 SMS
SMS_NokiaVCARD10Long  Nokia VCARD 1.0 - only name and default number
SMS_NokiaVCARD21Long  Nokia VCARD 2.1 - all numbers + text
SMS_NokiaVCALENDAR10Long  Nokia VCALENDAR 1.0 - can be in few sms
SMS_NokiaVTODOLong 
SMS_VCARD10Long 
SMS_VCARD21Long 
SMS_DisableVoice 
SMS_DisableFax 
SMS_DisableEmail 
SMS_EnableVoice 
SMS_EnableFax 
SMS_EnableEmail 
SMS_VoidSMS 
SMS_EMSSound10  IMelody 1.0
SMS_EMSSound12  IMelody 1.2
SMS_EMSSonyEricssonSound  IMelody without header - SonyEricsson extension
SMS_EMSSound10Long  IMelody 1.0 with UPI.
SMS_EMSSound12Long  IMelody 1.2 with UPI.
SMS_EMSSonyEricssonSoundLong  IMelody without header with UPI.
SMS_EMSPredefinedSound 
SMS_EMSPredefinedAnimation 
SMS_EMSAnimation 
SMS_EMSFixedBitmap  Fixed bitmap of size 16x16 or 32x32.
SMS_EMSVariableBitmap 
SMS_EMSVariableBitmapLong 
SMS_MMSIndicatorLong 
SMS_WAPIndicatorLong 
SMS_AlcatelMonoBitmapLong  Variable bitmap with black and white colors
SMS_AlcatelMonoAnimationLong  Variable animation with black and white colors
SMS_AlcatelSMSTemplateName 
SMS_SiemensFile  Siemens OTA

Definition at line 761 of file gammu-message.h.

Coding type of SMS.

Enumerator:
SMS_Coding_Unicode_No_Compression  Unicode
SMS_Coding_Unicode_Compression 
SMS_Coding_Default_No_Compression  Default GSM alphabet.
SMS_Coding_Default_Compression 
SMS_Coding_8bit  8-bit.

Definition at line 267 of file gammu-message.h.

Status of SMS message.

Enumerator:
SMS_Sent 
SMS_UnSent 
SMS_Read 
SMS_UnRead 

Definition at line 255 of file gammu-message.h.

00255              {
00256         SMS_Sent = 1,
00257         SMS_UnSent,
00258         SMS_Read,
00259         SMS_UnRead
00260 } GSM_SMS_State;

Enum defines format of SMS messages. See GSM 03.40 section 9.2.3.9

Enumerator:
SMS_FORMAT_Pager 
SMS_FORMAT_Fax 
SMS_FORMAT_Email 
SMS_FORMAT_Text 

Definition at line 169 of file gammu-message.h.

00169              {
00170         SMS_FORMAT_Pager = 1,
00171         SMS_FORMAT_Fax,
00172         SMS_FORMAT_Email,
00173         SMS_FORMAT_Text
00174             /* Some values not handled here */
00175 } GSM_SMSFormat;

TP-Message-Type-Indicator. See GSM 03.40 section 9.2.3.1.

Enumerator:
SMS_Deliver  SMS in Inbox.
SMS_Status_Report  Delivery Report
SMS_Submit  SMS for sending or in Outbox

Definition at line 361 of file gammu-message.h.

00361              {
00365         SMS_Deliver = 1,
00369         SMS_Status_Report,
00373         SMS_Submit
00374             /* specification gives more */
00375 } GSM_SMSMessageType;

enum GSM_UDH

Types of UDH (User Data Header).

Enumerator:
UDH_NoUDH 
UDH_ConcatenatedMessages  Linked SMS.
UDH_ConcatenatedMessages16bit  Linked SMS with 16 bit reference.
UDH_DisableVoice 
UDH_DisableFax 
UDH_DisableEmail 
UDH_EnableVoice 
UDH_EnableFax 
UDH_EnableEmail 
UDH_VoidSMS 
UDH_NokiaRingtone 
UDH_NokiaRingtoneLong 
UDH_NokiaOperatorLogo 
UDH_NokiaOperatorLogoLong 
UDH_NokiaCallerLogo 
UDH_NokiaWAP 
UDH_NokiaWAPLong 
UDH_NokiaCalendarLong 
UDH_NokiaProfileLong 
UDH_NokiaPhonebookLong 
UDH_UserUDH 
UDH_MMSIndicatorLong 

Definition at line 289 of file gammu-message.h.

Enum defines some the most often used validity lengths for SMS messages for relative validity format. See GSM 03.40 section 9.2.3.12.1 - it gives more values.

Enumerator:
SMS_VALID_1_Hour 
SMS_VALID_6_Hours 
SMS_VALID_1_Day 
SMS_VALID_3_Days 
SMS_VALID_1_Week 
SMS_VALID_Max_Time 

Definition at line 184 of file gammu-message.h.

00184              {
00185         SMS_VALID_1_Hour = 0x0b,
00186         SMS_VALID_6_Hours = 0x47,
00187         SMS_VALID_1_Day = 0xa7,
00188         SMS_VALID_3_Days = 0xa9,
00189         SMS_VALID_1_Week = 0xad,
00190         SMS_VALID_Max_Time = 0xff
00191 } GSM_ValidityPeriod;

Enum defines format of validity period for SMS messages. See GSM 03.40 section 9.2.3.12

Enumerator:
SMS_Validity_NotAvailable 
SMS_Validity_RelativeFormat 

Definition at line 199 of file gammu-message.h.

00199              {
00200         SMS_Validity_NotAvailable = 1,
00201         SMS_Validity_RelativeFormat
00202             /* Specification gives also other possibilities */
00203 } GSM_ValidityPeriodFormat;


Function Documentation

GSM_Error GSM_AddSMS ( GSM_StateMachine s,
GSM_SMSMessage sms 
)

Adds SMS to specified folder.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_AddSMSFolder ( GSM_StateMachine s,
unsigned char *  name 
)

Creates SMS folder.

Parameters:
s State machine pointer.
Returns:
Error code.

void GSM_ClearMultiPartSMSInfo ( GSM_MultiPartSMSInfo Info  ) 

Clears GSM_MultiPartSMSInfo to default values.

bool GSM_DecodeMultiPartSMS ( GSM_Debug_Info di,
GSM_MultiPartSMSInfo Info,
GSM_MultiSMSMessage SMS,
bool  ems 
)

Decodes multi part SMS to "readable" format.

bool GSM_DecodeSiemensOTASMS ( GSM_Debug_Info di,
GSM_SiemensOTASMSInfo Info,
GSM_SMSMessage SMS 
)

Decodes Siemens OTA data.

GSM_Error GSM_DecodeSMSFrame ( GSM_Debug_Info di,
GSM_SMSMessage SMS,
unsigned char *  buffer,
GSM_SMSMessageLayout  Layout 
)

Decodes SMS frame.

GSM_Error GSM_DecodeSMSFrameStatusReportData ( GSM_Debug_Info di,
GSM_SMSMessage SMS,
unsigned char *  buffer,
GSM_SMSMessageLayout  Layout 
)

Decodes SMS frame for status report.

GSM_Error GSM_DecodeSMSFrameText ( GSM_Debug_Info di,
GSM_SMSMessage SMS,
unsigned char *  buffer,
GSM_SMSMessageLayout  Layout 
)

Decodes SMS frame in textual representation.

void GSM_DecodeUDHHeader ( GSM_Debug_Info di,
GSM_UDHHeader UDH 
)

Decodes UDH header.

GSM_Error GSM_DeleteSMS ( GSM_StateMachine s,
GSM_SMSMessage sms 
)

Deletes SMS.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_DeleteSMSFolder ( GSM_StateMachine s,
int  ID 
)

Deletes SMS folder.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_EncodeMultiPartSMS ( GSM_Debug_Info di,
GSM_MultiPartSMSInfo Info,
GSM_MultiSMSMessage SMS 
)

Encodes multi part SMS from "readable" format.

Returns:
Error code.

GSM_Error GSM_EncodeSMSFrame ( GSM_Debug_Info di,
GSM_SMSMessage SMS,
unsigned char *  buffer,
GSM_SMSMessageLayout  Layout,
int *  length,
bool  clear 
)

Encodes SMS frame.

void GSM_EncodeUDHHeader ( GSM_Debug_Info di,
GSM_UDHHeader UDH 
)

Encodes UDH header.

void GSM_FreeMultiPartSMSInfo ( GSM_MultiPartSMSInfo Info  ) 

Frees any allocated structures inside GSM_MultiPartSMSInfo.

GSM_Error GSM_GetNextSMS ( GSM_StateMachine s,
GSM_MultiSMSMessage sms,
bool  start 
)

Reads next (or first if start set) SMS message. This might be faster for some phones than using GSM_GetSMS for each message.

Please note that this commend does not have to mark message as read in phone. To do so, you have to call GSM_GetSMS.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_GetSMS ( GSM_StateMachine s,
GSM_MultiSMSMessage sms 
)

Reads SMS message.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_GetSMSC ( GSM_StateMachine s,
GSM_SMSC smsc 
)

Gets SMS Service Center number and SMS settings.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_GetSMSFolders ( GSM_StateMachine s,
GSM_SMSFolders folders 
)

Returns SMS folders information.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_GetSMSStatus ( GSM_StateMachine s,
GSM_SMSMemoryStatus status 
)

Gets information about SMS memory (read/unread/size of memory for both SIM and phone).

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_LinkSMS ( GSM_Debug_Info di,
GSM_MultiSMSMessage **  INPUT,
GSM_MultiSMSMessage **  OUTPUT,
bool  ems 
)

Links SMS messages according to IDs.

Returns:
Error code.

GSM_Error GSM_SendSavedSMS ( GSM_StateMachine s,
int  Folder,
int  Location 
)

Sends SMS already saved in phone.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_SendSMS ( GSM_StateMachine s,
GSM_SMSMessage sms 
)

Sends SMS.

Parameters:
s State machine pointer.
Returns:
Error code.

void GSM_SetDefaultReceivedSMSData ( GSM_SMSMessage SMS  ) 

Sets default content for SMS except for changing locations. Use this for clearing structure while keeping location of message.

Parameters:
SMS Pointer to structure which should be cleaned up.

void GSM_SetDefaultSMSData ( GSM_SMSMessage SMS  ) 

Sets default content for SMS. Use this for clearing structure.

Parameters:
SMS Pointer to structure which should be cleaned up.

GSM_Error GSM_SetFastSMSSending ( GSM_StateMachine s,
bool  enable 
)

Configures fast SMS sending.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_SetIncomingSMS ( GSM_StateMachine s,
bool  enable 
)

Enable/disable notification on incoming SMS.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_SetSMS ( GSM_StateMachine s,
GSM_SMSMessage sms 
)

Sets SMS.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error GSM_SetSMSC ( GSM_StateMachine s,
GSM_SMSC smsc 
)

Sets SMS Service Center number and SMS settings.

Parameters:
s State machine pointer.
Returns:
Error code.

GSM_Error PHONE_EncodeSMSFrame ( GSM_StateMachine s,
GSM_SMSMessage SMS,
unsigned char *  buffer,
GSM_SMSMessageLayout  Layout,
int *  length,
bool  clear 
)

Encodes SMS frame according to layout.

Returns:
Error code.


Variable Documentation

Layout for deliver message.

Layout for status report messa