Gammu internals  1.38.0
gammu-message.h
Go to the documentation of this file.
1 
7 #ifndef __gammu_message_h
8 #define __gammu_message_h
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include <gammu-limits.h>
15 #include <gammu-memory.h>
16 #include <gammu-datetime.h>
17 #include <gammu-ringtone.h>
18 #include <gammu-bitmap.h>
19 #include <gammu-wap.h>
20 #include <gammu-calendar.h>
21 #include <gammu-file.h>
22 #include <gammu-debug.h>
23 
56 typedef enum {
77 
80 
86 typedef struct {
90  char Address[500];
94  char Title[200];
98  char Sender[200];
102  size_t MessageSize;
106  GSM_MMS_Class Class;
108 
114 typedef struct {
118  int Channel;
122  char Text[300];
123 } GSM_CBMessage;
124 
130 typedef enum {
160 
166 typedef struct {
170  unsigned char Text[2 * (GSM_MAX_USSD_LENGTH + 1)];
174  GSM_USSDStatus Status;
176 
182 typedef struct {
190  int SIMUsed;
194  int SIMSize;
212 
218 typedef enum {
223  /* Some values not handled here */
224 } GSM_SMSFormat;
225 
233 typedef enum {
241 
248 typedef enum {
251  /* Specification gives also other possibilities */
253 
259 typedef struct {
260  GSM_ValidityPeriodFormat Format;
266 
272 typedef struct {
276  int Location;
280  unsigned char Name[(GSM_MAX_SMSC_NAME_LENGTH + 1) * 2];
284  unsigned char Number[(GSM_MAX_NUMBER_LENGTH + 1) * 2];
292  GSM_SMSFormat Format;
296  unsigned char DefaultNumber[(GSM_MAX_NUMBER_LENGTH + 1) * 2];
297 } GSM_SMSC;
298 
304 typedef enum {
305  SMS_Sent = 1,
309 } GSM_SMS_State;
310 
316 typedef enum {
332 
338 const char *GSM_SMSCodingToString(GSM_Coding_Type type);
339 
343 GSM_Coding_Type GSM_StringToSMSCoding(const char *s);
344 
350 typedef enum {
379 } GSM_UDH;
380 
386 typedef struct {
390  GSM_UDH Type;
394  int Length;
398  unsigned char Text[GSM_MAX_UDH_LENGTH];
402  int ID8bit;
406  int ID16bit;
414  int AllParts;
415 } GSM_UDHHeader;
416 
422 typedef enum {
435  /* specification gives more */
437 
443 typedef struct {
447  unsigned char ReplaceMessage;
459  unsigned char Number[(GSM_MAX_NUMBER_LENGTH + 1) * 2];
460 
461  unsigned char
464 
468  GSM_SMSC SMSC;
476  int Location;
480  int Folder;
488  int Length;
492  GSM_SMS_State State;
496  unsigned char Name[(GSM_MAX_SMS_NAME_LENGTH + 1) * 2];
500  unsigned char Text[(GSM_MAX_SMS_LENGTH + 1) * 2];
504  GSM_SMSMessageType PDU;
508  GSM_Coding_Type Coding;
520  unsigned char DeliveryStatus;
528  signed char Class;
532  unsigned char MessageReference;
534 
535 /* In layouts are saved locations for some SMS part. Below are listed
536  * specs, which describe them
537  *
538  * \ingroup SMS
539  */
540 typedef struct {
544  unsigned char Text;
550  unsigned char Number;
554  unsigned char SMSCNumber;
559  unsigned char TPDCS;
564  unsigned char DateTime;
568  unsigned char SMSCTime;
572  unsigned char TPStatus;
576  unsigned char TPUDL;
580  unsigned char TPVP;
597  unsigned char firstbyte;
601  unsigned char TPMR;
605  unsigned char TPPID;
607 
621  const unsigned char *buffer, size_t length,
622  size_t *final_pos, gboolean SMSC);
623 
630  unsigned char *buffer,
631  GSM_SMSMessageLayout Layout);
632 
637 GSM_Coding_Type GSM_GetMessageCoding(GSM_Debug_Info * di, const char TPDCS);
638 
645  unsigned char *buffer, GSM_SMSMessageLayout Layout,
646  int *length, gboolean clear);
647 
654  GSM_SMSMessage * SMS,
655  unsigned char *buffer,
656  GSM_SMSMessageLayout Layout);
657 
664  unsigned char *buffer,
665  GSM_SMSMessageLayout Layout);
666 
673 
680 
690 
699 
705 typedef struct {
721  unsigned char Name[(GSM_MAX_SMS_FOLDER_NAME_LEN + 1) * 2];
723 
729 typedef struct {
733  GSM_OneSMSFolder Folder[GSM_MAX_SMS_FOLDERS];
737  int Number;
739 
745 typedef struct {
746  unsigned long SequenceID;
747  unsigned int PacketsNum;
748  unsigned int PacketNum;
749  unsigned long AllDataLen;
750 
751  unsigned char DataType[10];
752  unsigned char DataName[40];
753  unsigned int DataLen;
754  unsigned char Data[140];
756 
763  GSM_SiemensOTASMSInfo * Info,
764  GSM_SMSMessage * SMS);
765 
771 typedef struct {
775  int Number;
781 
787 typedef struct {
795  char Name[(GSM_MAX_MMS_FOLDER_NAME_LEN + 1) * 2];
797 
803 typedef struct {
807  unsigned char Number;
811  GSM_OneMMSFolder Folder[GSM_MAX_MMS_FOLDERS];
813 
820 
827 
834 
840 typedef enum {
844  SMS_Text = 1,
973 
979 typedef struct {
980  EncodeMultiPartSMSID ID;
981 
982  int Number;
993 
994  unsigned char *Buffer;
1004 
1005  /* Return values */
1008 
1014 typedef struct {
1017  int Class;
1018  unsigned char ReplaceMessage;
1022 
1031  unsigned char *buffer,
1032  GSM_SMSMessageLayout Layout, int *length,
1033  gboolean clear);
1034 
1043  GSM_MultiPartSMSInfo * Info,
1044  GSM_MultiSMSMessage * SMS);
1045 
1052  GSM_MultiPartSMSInfo * Info,
1053  GSM_MultiSMSMessage * SMS, gboolean ems);
1054 
1061 
1068 
1077  GSM_MultiSMSMessage ** INPUT,
1078  GSM_MultiSMSMessage ** OUTPUT, gboolean ems);
1079 
1085 typedef enum {
1088 } MMSAddressType;
1089 
1095 typedef struct {
1100  unsigned char ContentType[400];
1104  unsigned char SMIL[400];
1106 
1112 typedef struct {
1114 
1118  unsigned char Source[200];
1119  MMSAddressType SourceType;
1123  unsigned char Destination[200];
1124  MMSAddressType DestinationType;
1128  unsigned char CC[200];
1129  MMSAddressType CCType;
1130 
1134  unsigned char Subject[200];
1138  unsigned char ContentType[400];
1142  unsigned char MSGType[50];
1143 
1146 
1154 
1162 
1169 
1180 GSM_Error GSM_GetSMSC(GSM_StateMachine * s, GSM_SMSC * smsc);
1181 
1192 GSM_Error GSM_SetSMSC(GSM_StateMachine * s, GSM_SMSC * smsc);
1193 
1206 
1219 
1238  gboolean start);
1250 
1262 
1274 
1286 
1298 GSM_Error GSM_SendSavedSMS(GSM_StateMachine * s, int Folder, int Location);
1299 
1311 
1323 
1335 
1348 
1359 GSM_Error GSM_AddSMSFolder(GSM_StateMachine * s, unsigned char *name);
1360 
1372 
1385 
1400 GSM_Error GSM_GetNextMMSFileInfo(GSM_StateMachine * s, unsigned char *FileID,
1401  int *MMSFolder, gboolean start);
1413 
1426 void GSM_SMSCounter(GSM_Debug_Info *di, unsigned char *MessageBuffer,
1427  GSM_UDH UDHType, GSM_Coding_Type Coding, int *SMSNum, size_t *CharsLeft);
1428 
1429 #ifdef __cplusplus
1430 }
1431 #endif
1432 #endif
1433 
1434 /* Editor configuration
1435  * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
1436  */
unsigned char Text
GSM_SMSMessageType PDU
GSM_Error GSM_SetIncomingUSSD(GSM_StateMachine *s, gboolean enable)
Definition: api.c:1027
GSM_DateTime DateTime
GSM_Error GSM_SendSavedSMS(GSM_StateMachine *s, int Folder, int Location)
Definition: api.c:753
unsigned char TPUDL
void GSM_SetDefaultReceivedSMSData(GSM_SMSMessage *SMS)
Definition: gsmsms.c:1092
gboolean GSM_DecodeMultiPartSMS(GSM_Debug_Info *di, GSM_MultiPartSMSInfo *Info, GSM_MultiSMSMessage *SMS, gboolean ems)
Definition: gsmmulti.c:1275
GSM_Error GSM_SetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc)
Definition: api.c:641
GSM_Error GSM_GetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc)
Definition: api.c:628
GSM_MemoryEntry * Phonebook
GSM_MultiBitmap * Bitmap
unsigned char TPDCS
GSM_WAPSettings * Settings
unsigned char ReplaceMessage
GSM_SMS_State State
unsigned char ReplaceMessage
#define GSM_MAX_UDH_LENGTH
Definition: gammu-limits.h:169
unsigned char SMSCTime
const char * GSM_SMSCodingToString(GSM_Coding_Type type)
Definition: gsmsms.c:1284
GSM_Error GSM_SetIncomingSMS(GSM_StateMachine *s, gboolean enable)
Definition: api.c:780
#define GSM_MAX_NUMBER_LENGTH
Definition: gammu-limits.h:77
GSM_ValidityPeriod
GSM_MMSIndicator * MMSIndicator
void GSM_SMSCounter(GSM_Debug_Info *di, unsigned char *MessageBuffer, GSM_UDH UDHType, GSM_Coding_Type Coding, int *SMSNum, size_t *CharsLeft)
Definition: gsmmulti.c:355
GSM_Error GSM_DecodeSMSFrame(GSM_Debug_Info *di, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout)
Definition: gsmsms.c:807
GSM_Error
Definition: gammu-error.h:23
GSM_Error GSM_GetNextMMSFileInfo(GSM_StateMachine *s, unsigned char *FileID, int *MMSFolder, gboolean start)
Definition: api.c:1274
gboolean RejectDuplicates
GSM_Error GSM_DecodePDUFrame(GSM_Debug_Info *di, GSM_SMSMessage *SMS, const unsigned char *buffer, size_t length, size_t *final_pos, gboolean SMSC)
Definition: gsmsms.c:508
GSM_Error GSM_DeleteSMSFolder(GSM_StateMachine *s, int ID)
Definition: api.c:832
signed char Class
void GSM_SetDefaultSMSData(GSM_SMSMessage *SMS)
Definition: gsmsms.c:1129
GSM_SMSMessageLayout PHONE_SMSDeliver
Definition: pfunc.c:16
GSM_UDHHeader UDH
GSM_MMS_Class Class
GSM_ToDoEntry * ToDo
GSM_Ringtone * Ringtone
#define GSM_MAX_MMS_FOLDERS
Definition: gammu-limits.h:197
GSM_Error GSM_SetIncomingCB(GSM_StateMachine *s, gboolean enable)
Definition: api.c:793
unsigned char DeliveryStatus
GSM_Coding_Type Coding
GSM_Error GSM_ClearMMSMultiPart(GSM_EncodedMultiPartMMSInfo *info)
Definition: gsmdata.c:416
unsigned char SMSCNumber
GSM_SMSFormat Format
gboolean InboxFolder
unsigned long AllDataLen
GSM_Error GSM_GetNextSMS(GSM_StateMachine *s, GSM_MultiSMSMessage *sms, gboolean start)
Definition: api.c:683
#define GSM_MAX_SMS_LENGTH
Definition: gammu-limits.h:176
unsigned char Number
GSM_SMSMessageType
gboolean GSM_DecodeSiemensOTASMS(GSM_Debug_Info *di, GSM_SiemensOTASMSInfo *Info, GSM_SMSMessage *SMS)
Definition: gsmsms.c:1202
#define GSM_MAX_USSD_LENGTH
Definition: gammu-limits.h:309
GSM_Error GSM_GetSMSFolders(GSM_StateMachine *s, GSM_SMSFolders *folders)
Definition: api.c:806
#define GSM_MAX_SMS_NAME_LENGTH
Definition: gammu-limits.h:138
GSM_Error GSM_AddSMSFolder(GSM_StateMachine *s, unsigned char *name)
Definition: api.c:819
#define GSM_MAX_MMS_FOLDER_NAME_LEN
Definition: gammu-limits.h:204
int gboolean
Definition: gammu-types.h:23
#define GSM_SMS_OTHER_NUMBERS
Definition: gammu-limits.h:145
GSM_Error GSM_SendSMS(GSM_StateMachine *s, GSM_SMSMessage *sms)
Definition: api.c:740
GSM_ValidityPeriodFormat Format
GSM_MemoryType
Definition: gammu-memory.h:31
#define GSM_MAX_SMS_FOLDER_NAME_LEN
Definition: gammu-limits.h:155
void GSM_ClearMultiPartSMSInfo(GSM_MultiPartSMSInfo *Info)
Definition: gsmmulti.c:915
void GSM_FreeMultiPartSMSInfo(GSM_MultiPartSMSInfo *Info)
Definition: gsmmulti.c:952
gboolean InboxFolder
GSM_Error GSM_DecodeSMSFrameText(GSM_Debug_Info *di, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout)
Definition: gsmsms.c:316
GSM_SMSValidity Validity
unsigned int PacketNum
MMSAddressType
GSM_Error GSM_DeleteSMS(GSM_StateMachine *s, GSM_SMSMessage *sms)
Definition: api.c:726
GSM_Error GSM_SetSMS(GSM_StateMachine *s, GSM_SMSMessage *sms)
Definition: api.c:698
unsigned int PacketsNum
unsigned char TPVP
GSM_MMS_Class
Definition: gammu-message.h:56
GSM_Error GSM_GetMMSFolders(GSM_StateMachine *s, GSM_MMSFolders *folders)
Definition: api.c:1261
GSM_WAPBookmark * Bookmark
GSM_MemoryType Memory
gboolean OutboxFolder
GSM_Coding_Type GSM_GetMessageCoding(GSM_Debug_Info *di, const char TPDCS)
Definition: gsmsms.c:261
GSM_Error GSM_EncodeMultiPartSMS(GSM_Debug_Info *di, GSM_MultiPartSMSInfo *Info, GSM_MultiSMSMessage *SMS)
Definition: gsmmulti.c:500
GSM_Error GSM_GetSMS(GSM_StateMachine *s, GSM_MultiSMSMessage *sms)
Definition: api.c:668
gboolean InboxFolder
EncodeMultiPartSMSID ID
#define GSM_MAX_MULTI_SMS
Definition: gammu-limits.h:162
GSM_Error GSM_DecodeMMSFileToMultiPart(GSM_Debug_Info *di, GSM_File *file, GSM_EncodedMultiPartMMSInfo *info)
Definition: gsmdata.c:469
GSM_ValidityPeriodFormat
unsigned char firstbyte
GSM_SMSMessageLayout PHONE_SMSStatusReport
Definition: pfunc.c:30
GSM_UDH
#define GSM_MAX_SMS_FOLDERS
Definition: gammu-limits.h:150
GSM_Coding_Type
unsigned char * Buffer
unsigned char TPStatus
GSM_Error GSM_EncodeSMSFrame(GSM_Debug_Info *di, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout, int *length, gboolean clear)
Definition: gsmsms.c:1008
GSM_Error GSM_AddSMS(GSM_StateMachine *s, GSM_SMSMessage *sms)
Definition: api.c:712
void GSM_DecodeUDHHeader(GSM_Debug_Info *di, GSM_UDHHeader *UDH)
Definition: gsmsms.c:121
GSM_SMSMessageLayout PHONE_SMSSubmit
Definition: pfunc.c:23
GSM_Error GSM_SetFastSMSSending(GSM_StateMachine *s, gboolean enable)
Definition: api.c:767
GSM_USSDStatus
GSM_SMS_State
void GSM_EncodeUDHHeader(GSM_Debug_Info *di, GSM_UDHHeader *UDH)
Definition: gsmsms.c:1151
GSM_Error GSM_GetSMSStatus(GSM_StateMachine *s, GSM_SMSMemoryStatus *status)
Definition: api.c:655
GSM_Coding_Type GSM_StringToSMSCoding(const char *s)
Definition: gsmsms.c:1260
GSM_CalendarEntry * Calendar
GSM_Error GSM_LinkSMS(GSM_Debug_Info *di, GSM_MultiSMSMessage **INPUT, GSM_MultiSMSMessage **OUTPUT, gboolean ems)
Definition: gsmmulti.c:1395
unsigned char MessageReference
GSM_SMSFormat
gboolean ReplyViaSameSMSC
#define GSM_MAX_MULTI_MMS
Definition: gammu-limits.h:211
GSM_DateTime SMSCTime
GSM_Error PHONE_EncodeSMSFrame(GSM_StateMachine *s, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout, int *length, gboolean clear)
Definition: pfunc.c:58
unsigned char DateTime
unsigned char Number
unsigned char TPMR
GSM_ValidityPeriod Relative
EncodeMultiPartSMSID
GSM_MemoryType Memory
GSM_USSDStatus Status
unsigned long SequenceID
GSM_Error GSM_DecodeSMSFrameStatusReportData(GSM_Debug_Info *di, GSM_SMSMessage *SMS, unsigned char *buffer, GSM_SMSMessageLayout Layout)
Definition: gsmsms.c:503
#define GSM_MAX_SMSC_NAME_LENGTH
Definition: gammu-limits.h:218
unsigned char TPPID