2 * \file gammu-message.h
5 * Message data and functions.
7 #ifndef __gammu_message_h
8 #define __gammu_message_h
10 #include <gammu-limits.h>
11 #include <gammu-memory.h>
12 #include <gammu-datetime.h>
13 #include <gammu-ringtone.h>
14 #include <gammu-bitmap.h>
15 #include <gammu-wap.h>
16 #include <gammu-calendar.h>
17 #include <gammu-file.h>
18 #include <gammu-debug.h>
21 * \defgroup Message Messages
22 * Messages manipulations.
26 * \defgroup USSD USSD messages
27 * USSD messages manipulations.
32 * \defgroup CB CB messages
33 * Cell broadcast messages manipulations.
38 * \defgroup SMS SMS messages
39 * SMS messages manipulations.
44 * \defgroup MMS MMS messages
45 * MMS messages manipulations.
54 * None class specified.
62 * Advertisement message.
64 GSM_MMS_Advertisement
,
66 * Informational message.
70 * Automatic message class.
82 * Message address (URL for download).
86 * Message title (subject).
94 * Message size, if 0 it won't be decoded or was not decoded.
104 * Structure for Cell Broadcast messages.
120 * Status of USSD message.
130 * No action is needed, maybe network initiated USSD
138 * USSD dialog terminated
142 * Another client replied
146 * Operation not supported
156 * Structure for USSD messages.
164 unsigned char Text
[2 * (GSM_MAX_USSD_LENGTH
+ 1)];
168 GSM_USSDStatus Status
;
172 * Status of SMS memory.
178 * Number of unread messages on SIM.
182 * Number of all saved messages (including unread) on SIM.
186 * Number of all possible messages on SIM.
190 * Number of used templates (62xx/63xx/7110/etc.).
194 * Number of unread messages in phone.
198 * Number of all saved messages in phone.
202 * Number of all possible messages on phone.
205 } GSM_SMSMemoryStatus
;
208 * Enum defines format of SMS messages. See GSM 03.40 section 9.2.3.9
213 SMS_FORMAT_Pager
= 1,
217 /* Some values not handled here */
221 * Enum defines some the most often used validity lengths for SMS messages
222 * for relative validity format. See GSM 03.40 section 9.2.3.12.1 - it gives
228 SMS_VALID_1_Hour
= 0x0b,
229 SMS_VALID_6_Hours
= 0x47,
230 SMS_VALID_1_Day
= 0xa7,
231 SMS_VALID_3_Days
= 0xa9,
232 SMS_VALID_1_Week
= 0xad,
233 SMS_VALID_Max_Time
= 0xff
234 } GSM_ValidityPeriod
;
237 * Enum defines format of validity period for SMS messages.
238 * See GSM 03.40 section 9.2.3.12
243 SMS_Validity_NotAvailable
= 1,
244 SMS_Validity_RelativeFormat
245 /* Specification gives also other possibilities */
246 } GSM_ValidityPeriodFormat
;
249 * Structure for validity of SMS messages
254 GSM_ValidityPeriodFormat Format
;
256 * Value defines period for relative format
258 GSM_ValidityPeriod Relative
;
262 * Structure for SMSC (SMS Center) information.
268 * Number of the SMSC on SIM
274 unsigned char Name
[(GSM_MAX_SMSC_NAME_LENGTH
+ 1) * 2];
278 unsigned char Number
[(GSM_MAX_NUMBER_LENGTH
+ 1) * 2];
280 * Validity of SMS messages.
282 GSM_SMSValidity Validity
;
284 * Format of sent SMS messages.
286 GSM_SMSFormat Format
;
288 * Default recipient number. In old DCT3 ignored
290 unsigned char DefaultNumber
[(GSM_MAX_NUMBER_LENGTH
+ 1) * 2];
294 * Status of SMS message.
306 * Coding type of SMS.
314 SMS_Coding_Unicode_No_Compression
= 1,
315 SMS_Coding_Unicode_Compression
,
317 * Default GSM alphabet.
319 SMS_Coding_Default_No_Compression
,
320 SMS_Coding_Default_Compression
,
328 * Converts SMS coding to string.
330 * \return Pointer to static string, NULL on failure.
332 const char *GSM_SMSCodingToString(GSM_Coding_Type type
);
335 * Converts SMS coding to type.
337 GSM_Coding_Type
GSM_StringToSMSCoding(const char *s
);
340 * Types of UDH (User Data Header).
349 UDH_ConcatenatedMessages
,
351 * Linked SMS with 16 bit reference.
353 UDH_ConcatenatedMessages16bit
,
362 UDH_NokiaRingtoneLong
,
363 UDH_NokiaOperatorLogo
,
364 UDH_NokiaOperatorLogoLong
,
368 UDH_NokiaCalendarLong
,
369 UDH_NokiaProfileLong
,
370 UDH_NokiaPhonebookLong
,
376 * Structure for User Data Header.
392 unsigned char Text
[GSM_MAX_UDH_LENGTH
];
394 * 8-bit ID, when required (-1 otherwise).
398 * 16-bit ID, when required (-1 otherwise).
402 * Number of current part.
406 * Total number of parts.
412 * TP-Message-Type-Indicator. See GSM 03.40 section 9.2.3.1.
426 * SMS for sending or in Outbox
429 /* specification gives more */
430 } GSM_SMSMessageType
;
439 * Message to be replaced.
441 unsigned char ReplaceMessage
;
443 * Whether to reject duplicates.
445 gboolean RejectDuplicates
;
447 * UDH (User Data Header)
451 * Sender or recipient number.
453 unsigned char Number
[(GSM_MAX_NUMBER_LENGTH
+ 1) * 2];
456 OtherNumbers
[GSM_SMS_OTHER_NUMBERS
][(GSM_MAX_NUMBER_LENGTH
+ 1) * 2];
464 * For saved SMS: where exactly it's saved (SIM/phone)
466 GSM_MemoryType Memory
;
468 * For saved SMS: location of SMS in memory.
472 * For saved SMS: number of folder, where SMS is saved
476 * For saved SMS: whether SMS is really in Inbox.
478 gboolean InboxFolder
;
480 * Length of the SMS message.
484 * Status (read/unread/...) of SMS message.
488 * Name in Nokia with SMS memory (6210/7110, etc.) Ignored in other.
490 unsigned char Name
[(GSM_MAX_SMS_NAME_LENGTH
+ 1) * 2];
494 unsigned char Text
[(GSM_MAX_SMS_LENGTH
+ 1) * 2];
498 GSM_SMSMessageType PDU
;
502 GSM_Coding_Type Coding
;
504 * Date and time, when SMS was saved or sent
506 GSM_DateTime DateTime
;
508 * Date of SMSC response in DeliveryReport messages.
510 GSM_DateTime SMSCTime
;
512 * In delivery reports: status.
514 unsigned char DeliveryStatus
;
516 * Indicates whether "Reply via same center" is set.
518 gboolean ReplyViaSameSMSC
;
520 * SMS class (0 is flash SMS, 1 is normal one).
526 unsigned char MessageReference
;
529 /* In layouts are saved locations for some SMS part. Below are listed
530 * specs, which describe them
536 * TP-User-Data. GSM 03.40 section 9.2.3.24.
540 * - In SMS-Deliver: TP-Originating-Address. GSM 03.40 section 9.2.3.7.
541 * - In SMS-Submit: TP-Destination-Address. GSM 03.40 section 9.2.3.8.
542 * - In SMS-Status-Report: TP-Recipient-Address. GSM 03.40 section 9.2.3.14.
544 unsigned char Number
;
548 unsigned char SMSCNumber
;
550 * TP-Data-Coding-Scheme. GSM 03.40 section 9.2.3.10.
551 * Contains alphabet type, SMS class (and some others)
555 * - For SMS-Submit: TP-Validity-Period. GSM 03.40 section 9.2.3.12.
556 * - For SMS-Status-Report: TP-Discharge Time. GSM 03.40 section 9.2.3.13.
558 unsigned char DateTime
;
560 * TP-Service-Centre-Time-Stamp in SMS-Status-Report. GSM 03.40 section 9.2.3.11.
562 unsigned char SMSCTime
;
564 * TP-Status in SMS-Status-Report. GSM 03.40 section 9.2.3.15.
566 unsigned char TPStatus
;
568 * TP-User-Data-Length. GSM 03.40 section 9.2.3.16.
572 * TP-Validity Period in SMS-Submit. GSM 03.40 section 9.2.3.12.
576 * Byte contains in SMS-Deliver:
577 * - TP-Message-Type-Indicator (2 bits) GSM 03.40 section 9.2.3.1
578 * - TP-More-Messages-To-Send (1 bit). GSM 03.40 section 9.2.3.2
579 * - TP-Reply-Path (1 bit). GSM 03.40 section 9.2.3.17
580 * - TP-User-Data-Header-Indicator (1 bit). GSM 03.40 section 9.2.3.23
581 * - TP-Status-Report-Indicator (1 bit). GSM 03.40 section 9.2.3.4
583 * Byte contains in SMS-Submit:
584 * - TP-Message-Type-Indicator (2 bits) GSM 03.40 section 9.2.3.1
585 * - TP-Reject-Duplicates (1 bit). GSM 03.40 section
586 * - TP-Validity-Period-Format (2 bits).GSM 03.40 section 9.2.3.3
587 * - TP-Reply-Path (1 bit). GSM 03.40 section 9.2.3.17
588 * - TP-User-Data-Header-Indicator (1 bit). GSM 03.40 section 9.2.3.23
589 * - TP-Status-Report-Request (1 bit). GSM 03.40 section 9.2.3.5
591 unsigned char firstbyte
;
593 * TP-Message Reference in SMS-Submit. GSM 03.40 section 9.2.3.6
597 * TP-Protocol-Identifier. GSM 03.40 section 9.2.3.9
600 } GSM_SMSMessageLayout
;
605 * \param di Debug information structure.
606 * \param SMS Pointer where to store parsed message.
607 * \param buffer PDU data.
608 * \param length Length of PDU data.
609 * \param final_pos Optional pointer where end position will be stored.
610 * \param SMSC Whether PDU includes SMSC data.
614 GSM_Error
GSM_DecodePDUFrame(GSM_Debug_Info
*di
, GSM_SMSMessage
*SMS
,
615 const unsigned char *buffer
, size_t length
,
616 size_t *final_pos
, gboolean SMSC
);
623 GSM_Error
GSM_DecodeSMSFrame(GSM_Debug_Info
* di
, GSM_SMSMessage
* SMS
,
624 unsigned char *buffer
,
625 GSM_SMSMessageLayout Layout
);
628 * Finds out coding type based on TPDCS header byte as defined by GSM
631 GSM_Coding_Type
GSM_GetMessageCoding(GSM_Debug_Info
* di
, const char TPDCS
);
638 GSM_Error
GSM_EncodeSMSFrame(GSM_Debug_Info
* di
, GSM_SMSMessage
* SMS
,
639 unsigned char *buffer
, GSM_SMSMessageLayout Layout
,
640 int *length
, gboolean clear
);
643 * Decodes SMS frame for status report.
647 GSM_Error
GSM_DecodeSMSFrameStatusReportData(GSM_Debug_Info
* di
,
648 GSM_SMSMessage
* SMS
,
649 unsigned char *buffer
,
650 GSM_SMSMessageLayout Layout
);
653 * Decodes SMS frame in textual representation.
657 GSM_Error
GSM_DecodeSMSFrameText(GSM_Debug_Info
* di
, GSM_SMSMessage
* SMS
,
658 unsigned char *buffer
,
659 GSM_SMSMessageLayout Layout
);
662 * Decodes UDH header.
666 void GSM_DecodeUDHHeader(GSM_Debug_Info
* di
, GSM_UDHHeader
* UDH
);
669 * Encodes UDH header.
673 void GSM_EncodeUDHHeader(GSM_Debug_Info
* di
, GSM_UDHHeader
* UDH
);
676 * Sets default content for SMS except for changing locations.
677 * Use this for clearing structure while keeping location of message.
679 * \param SMS Pointer to structure which should be cleaned up.
683 void GSM_SetDefaultReceivedSMSData(GSM_SMSMessage
* SMS
);
686 * Sets default content for SMS. Use this for clearing structure.
688 * \param SMS Pointer to structure which should be cleaned up.
692 void GSM_SetDefaultSMSData(GSM_SMSMessage
* SMS
);
695 * Information about SMS folder.
701 * Whether it is inbox.
703 gboolean InboxFolder
;
705 * Whether it is outbox.
707 gboolean OutboxFolder
;
709 * Where exactly it's saved.
711 GSM_MemoryType Memory
;
715 unsigned char Name
[(GSM_MAX_SMS_FOLDER_NAME_LEN
+ 1) * 2];
719 * List of SMS folders.
725 * Array of structures holding information about each folder.
727 GSM_OneSMSFolder Folder
[GSM_MAX_SMS_FOLDERS
];
729 * Number of SMS folders.
740 unsigned long SequenceID
;
741 unsigned int PacketsNum
;
742 unsigned int PacketNum
;
743 unsigned long AllDataLen
;
745 unsigned char DataType
[10];
746 unsigned char DataName
[40];
747 unsigned int DataLen
;
748 unsigned char Data
[140];
749 } GSM_SiemensOTASMSInfo
;
752 * Decodes Siemens OTA data.
756 gboolean
GSM_DecodeSiemensOTASMS(GSM_Debug_Info
* di
,
757 GSM_SiemensOTASMSInfo
* Info
,
758 GSM_SMSMessage
* SMS
);
761 * Multiple SMS messages, used for Smart Messaging 3.0/EMS.
767 * Number of messages.
773 GSM_SMSMessage SMS
[GSM_MAX_MULTI_SMS
];
774 } GSM_MultiSMSMessage
;
777 * Information about MMS folder.
783 * Whether it is really inbox.
785 gboolean InboxFolder
;
787 * Name for MMS folder.
789 char Name
[(GSM_MAX_MMS_FOLDER_NAME_LEN
+ 1) * 2];
793 * List of MMS folders.
799 * Number of MMS folders.
801 unsigned char Number
;
803 * Array of structures holding information about each folder.
805 GSM_OneMMSFolder Folder
[GSM_MAX_MMS_FOLDERS
];
809 * Layout for submit message.
813 extern GSM_SMSMessageLayout PHONE_SMSSubmit
;
816 * Layout for deliver message.
820 extern GSM_SMSMessageLayout PHONE_SMSDeliver
;
823 * Layout for status report message.
827 extern GSM_SMSMessageLayout PHONE_SMSStatusReport
;
830 * ID during packing SMS for Smart Messaging 3.0, EMS and other
840 * Contacenated SMS, when longer than 1 SMS.
842 SMS_ConcatenatedTextLong
,
844 * Contacenated SMS, auto Default/Unicode coding.
846 SMS_ConcatenatedAutoTextLong
,
847 SMS_ConcatenatedTextLong16bit
,
848 SMS_ConcatenatedAutoTextLong16bit
,
850 * Nokia profile = Name, Ringtone, ScreenSaver
852 SMS_NokiaProfileLong
,
854 * Nokia Picture Image + (text)
856 SMS_NokiaPictureImageLong
,
858 * Nokia screen saver + (text)
860 SMS_NokiaScreenSaverLong
,
862 * Nokia ringtone - old SM2.0 format, 1 SMS
866 * Nokia ringtone contacenated, when very long
868 SMS_NokiaRingtoneLong
,
870 * Nokia 72x14 operator logo, 1 SMS
872 SMS_NokiaOperatorLogo
,
874 * Nokia 72x14 op logo or 78x21 in 2 SMS
876 SMS_NokiaOperatorLogoLong
,
878 * Nokia 72x14 caller logo, 1 SMS
882 * Nokia WAP bookmark in 1 or 2 SMS
884 SMS_NokiaWAPBookmarkLong
,
886 * Nokia WAP settings in 2 SMS
888 SMS_NokiaWAPSettingsLong
,
890 * Nokia MMS settings in 2 SMS
892 SMS_NokiaMMSSettingsLong
,
894 * Nokia VCARD 1.0 - only name and default number
896 SMS_NokiaVCARD10Long
,
898 * Nokia VCARD 2.1 - all numbers + text
900 SMS_NokiaVCARD21Long
,
902 * Nokia VCALENDAR 1.0 - can be in few sms
904 SMS_NokiaVCALENDAR10Long
,
924 * IMelody without header - SonyEricsson extension
926 SMS_EMSSonyEricssonSound
,
928 * IMelody 1.0 with UPI.
932 * IMelody 1.2 with UPI.
936 * IMelody without header with UPI.
938 SMS_EMSSonyEricssonSoundLong
,
939 SMS_EMSPredefinedSound
,
940 SMS_EMSPredefinedAnimation
,
943 * Fixed bitmap of size 16x16 or 32x32.
946 SMS_EMSVariableBitmap
,
947 SMS_EMSVariableBitmapLong
,
949 * MMS message indicator.
951 SMS_MMSIndicatorLong
,
952 SMS_WAPIndicatorLong
,
954 * Variable bitmap with black and white colors
956 SMS_AlcatelMonoBitmapLong
,
958 * Variable animation with black and white colors
960 SMS_AlcatelMonoAnimationLong
,
961 SMS_AlcatelSMSTemplateName
,
966 } EncodeMultiPartSMSID
;
969 * Entry of multipart SMS.
974 EncodeMultiPartSMSID ID
;
977 GSM_Ringtone
*Ringtone
;
978 GSM_MultiBitmap
*Bitmap
;
979 GSM_WAPBookmark
*Bookmark
;
980 GSM_WAPSettings
*Settings
;
981 GSM_MMSIndicator
*MMSIndicator
;
982 GSM_MemoryEntry
*Phonebook
;
983 GSM_CalendarEntry
*Calendar
;
988 unsigned char *Buffer
;
997 gboolean Strikethrough
;
1001 } GSM_MultiPartSMSEntry
;
1004 * Multipart SMS information.
1010 gboolean UnicodeCoding
;
1012 unsigned char ReplaceMessage
;
1014 GSM_MultiPartSMSEntry Entries
[GSM_MAX_MULTI_SMS
];
1015 } GSM_MultiPartSMSInfo
;
1018 * Encodes SMS frame according to layout.
1020 * \return Error code.
1024 GSM_Error
PHONE_EncodeSMSFrame(GSM_StateMachine
* s
, GSM_SMSMessage
* SMS
,
1025 unsigned char *buffer
,
1026 GSM_SMSMessageLayout Layout
, int *length
,
1030 * Encodes multi part SMS from "readable" format.
1032 * \return Error code.
1036 GSM_Error
GSM_EncodeMultiPartSMS(GSM_Debug_Info
* di
,
1037 GSM_MultiPartSMSInfo
* Info
,
1038 GSM_MultiSMSMessage
* SMS
);
1041 * Decodes multi part SMS to "readable" format.
1045 gboolean
GSM_DecodeMultiPartSMS(GSM_Debug_Info
* di
,
1046 GSM_MultiPartSMSInfo
* Info
,
1047 GSM_MultiSMSMessage
* SMS
, gboolean ems
);
1050 * Clears @ref GSM_MultiPartSMSInfo to default values.
1054 void GSM_ClearMultiPartSMSInfo(GSM_MultiPartSMSInfo
* Info
);
1057 * Frees any allocated structures inside @ref GSM_MultiPartSMSInfo.
1061 void GSM_FreeMultiPartSMSInfo(GSM_MultiPartSMSInfo
* Info
);
1064 * Links SMS messages according to IDs.
1066 * \return Error code.
1070 GSM_Error
GSM_LinkSMS(GSM_Debug_Info
* di
,
1071 GSM_MultiSMSMessage
** INPUT
,
1072 GSM_MultiSMSMessage
** OUTPUT
, gboolean ems
);
1094 unsigned char ContentType
[400];
1096 * Smil ID in Unicode
1098 unsigned char SMIL
[400];
1099 } GSM_EncodedMultiPartMMSEntry
;
1112 unsigned char Source
[200];
1113 MMSAddressType SourceType
;
1117 unsigned char Destination
[200];
1118 MMSAddressType DestinationType
;
1122 unsigned char CC
[200];
1123 MMSAddressType CCType
;
1128 unsigned char Subject
[200];
1132 unsigned char ContentType
[400];
1136 unsigned char MSGType
[50];
1138 gboolean DateTimeAvailable
;
1139 GSM_DateTime DateTime
;
1141 gboolean MMSReportAvailable
;
1146 GSM_EncodedMultiPartMMSEntry Entries
[GSM_MAX_MULTI_MMS
];
1147 } GSM_EncodedMultiPartMMSInfo
;
1154 GSM_Error
GSM_DecodeMMSFileToMultiPart(GSM_Debug_Info
* di
, GSM_File
* file
,
1155 GSM_EncodedMultiPartMMSInfo
* info
);
1158 * Clears MMS data, used to initialize structure.
1162 GSM_Error
GSM_ClearMMSMultiPart(GSM_EncodedMultiPartMMSInfo
* info
);
1165 * Gets SMS Service Center number and SMS settings.
1167 * \param s State machine pointer.
1168 * \param[in,out] smsc SMSC structure, should contain location.
1170 * \return Error code.
1174 GSM_Error
GSM_GetSMSC(GSM_StateMachine
* s
, GSM_SMSC
* smsc
);
1177 * Sets SMS Service Center number and SMS settings.
1179 * \param s State machine pointer.
1180 * \param[in] smsc SMSC structure.
1182 * \return Error code.
1186 GSM_Error
GSM_SetSMSC(GSM_StateMachine
* s
, GSM_SMSC
* smsc
);
1189 * Gets information about SMS memory (read/unread/size of memory for
1190 * both SIM and phone).
1192 * \param s State machine pointer.
1193 * \param[out] status Pointer to SMS status structure.
1195 * \return Error code.
1199 GSM_Error
GSM_GetSMSStatus(GSM_StateMachine
* s
, GSM_SMSMemoryStatus
* status
);
1202 * Reads SMS message.
1204 * \param s State machine pointer.
1205 * \param[in,out] sms SMS message data read from phone, location and
1206 * folder should be set.
1208 * \return Error code.
1212 GSM_Error
GSM_GetSMS(GSM_StateMachine
* s
, GSM_MultiSMSMessage
* sms
);
1215 * Reads next (or first if start set) SMS message. This might be
1216 * faster for some phones than using \ref GSM_GetSMS for each message.
1218 * Please note that this commend does not have to mark message as read
1219 * in phone. To do so, you have to call \ref GSM_GetSMS.
1221 * \param s State machine pointer.
1222 * \param[in,out] sms SMS message data read from phone, for subsequent
1223 * reads, location and folder might be used by phone driver to determine
1225 * \param[in] start Whether we start reading from beginning.
1227 * \return Error code.
1231 GSM_Error
GSM_GetNextSMS(GSM_StateMachine
* s
, GSM_MultiSMSMessage
* sms
,
1236 * \param s State machine pointer.
1237 * \param[in] sms SMS message data.
1239 * \return Error code.
1243 GSM_Error
GSM_SetSMS(GSM_StateMachine
* s
, GSM_SMSMessage
* sms
);
1246 * Adds SMS to specified folder.
1248 * \param s State machine pointer.
1249 * \param[in,out] sms SMS message data, location will be updated.
1251 * \return Error code.
1255 GSM_Error
GSM_AddSMS(GSM_StateMachine
* s
, GSM_SMSMessage
* sms
);
1260 * \param s State machine pointer.
1261 * \param[in] sms SMS structure with SMS location and folder.
1263 * \return Error code.
1267 GSM_Error
GSM_DeleteSMS(GSM_StateMachine
* s
, GSM_SMSMessage
* sms
);
1272 * \param s State machine pointer.
1273 * \param[in] sms SMS structure with SMS data to send.
1275 * \return Error code.
1279 GSM_Error
GSM_SendSMS(GSM_StateMachine
* s
, GSM_SMSMessage
* sms
);
1282 * Sends SMS already saved in phone.
1284 * \param s State machine pointer.
1285 * \param[in] Folder Folder, where message is stored.
1286 * \param[in] Location Location, where message is stored.
1288 * \return Error code.
1292 GSM_Error
GSM_SendSavedSMS(GSM_StateMachine
* s
, int Folder
, int Location
);
1295 * Configures fast SMS sending.
1297 * \param s State machine pointer.
1298 * \param[in] enable Whether to enable notifications.
1300 * \return Error code.
1304 GSM_Error
GSM_SetFastSMSSending(GSM_StateMachine
* s
, gboolean enable
);
1307 * Enable/disable notification on incoming SMS.
1309 * \param s State machine pointer.
1310 * \param[in] enable Whether to enable notifications.
1312 * \return Error code.
1316 GSM_Error
GSM_SetIncomingSMS(GSM_StateMachine
* s
, gboolean enable
);
1319 * Gets network information from phone.
1321 * \param s State machine pointer.
1322 * \param[in] enable Whether to enable notifications.
1324 * \return Error code.
1328 GSM_Error
GSM_SetIncomingCB(GSM_StateMachine
* s
, gboolean enable
);
1331 * Returns SMS folders information.
1333 * \param s State machine pointer.
1334 * \param[out] folders folders Pointer to folders structure, which will be
1337 * \return Error code.
1341 GSM_Error
GSM_GetSMSFolders(GSM_StateMachine
* s
, GSM_SMSFolders
* folders
);
1344 * Creates SMS folder.
1346 * \param s State machine pointer.
1347 * \param[in] name Name of SMS folder which should be created.
1349 * \return Error code.
1353 GSM_Error
GSM_AddSMSFolder(GSM_StateMachine
* s
, unsigned char *name
);
1356 * Deletes SMS folder.
1358 * \param s State machine pointer.
1359 * \param[in] ID ID of SMS folder to delete.
1361 * \return Error code.
1365 GSM_Error
GSM_DeleteSMSFolder(GSM_StateMachine
* s
, int ID
);
1368 * Lists MMS folders.
1370 * \param s State machine pointer.
1371 * \param folders Pointer to structure, whehe folder information will be
1374 * \return Error code.
1378 GSM_Error
GSM_GetMMSFolders(GSM_StateMachine
* s
, GSM_MMSFolders
* folders
);
1381 * Retrieves next part of MMS file information.
1383 * \param s State machine pointer.
1384 * \param[in,out] FileID File ID will be stored here, might be
1385 * used for consequent reads.
1386 * \param[in,out] MMSFolder MMS folder ID will be stored here, might be
1387 * used for consequent reads.
1388 * \param[in] start Whether to start reading.
1390 * \return Error code.
1394 GSM_Error
GSM_GetNextMMSFileInfo(GSM_StateMachine
* s
, unsigned char *FileID
,
1395 int *MMSFolder
, gboolean start
);
1397 * Activates/deactivates noticing about incoming USSDs (UnStructured Supplementary Services).
1399 * \param s State machine pointer.
1400 * \param[in] enable Whether to enable notifications.
1402 * \return Error code.
1406 GSM_Error
GSM_SetIncomingUSSD(GSM_StateMachine
* s
, gboolean enable
);
1409 * Calculates number of messages and free chars needed for text.
1411 * \param di Debug settings.
1412 * \param[in] MessageBuffer Actual message text in unicode.
1413 * \param[in] UDHType UDH type.
1414 * \param[in] Coding GSM Encoding type.
1415 * \param[out] SMSNum Number of messages needed to store the text.
1416 * \param[out] CharsLeft Number of free chars in the message.
1420 void GSM_SMSCounter(GSM_Debug_Info
*di
, unsigned char *MessageBuffer
,
1421 GSM_UDH UDHType
, GSM_Coding_Type Coding
, int *SMSNum
, size_t *CharsLeft
);
1425 /* Editor configuration
1426 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: