X-Git-Url: http://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=include%2Fgsm-sms.h;h=37190aef330cd8a5f16bc6975976ed1e776dcc27;hp=9174502008efbcb92b2defd19fe47cdafa00d147;hb=49dd905279a8e62936e3713510ab0fd738e20ecb;hpb=3ffd063073b4fe33d61c74b767c93833dc5bd8e5 diff --git a/include/gsm-sms.h b/include/gsm-sms.h index 9174502..37190ae 100644 --- a/include/gsm-sms.h +++ b/include/gsm-sms.h @@ -13,26 +13,8 @@ Include file for SMS library. $Log$ - Revision 1.1.1.2 2001/11/27 22:01:27 short - :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Tue Nov 27 22:58 CET 2001 - - Revision 1.7 2001/11/27 12:19:01 pkot - Cleanup, indentation, ANSI complaint preprocesor symbols (Jan Kratochvil, me) - - Revision 1.6 2001/11/22 17:56:53 pkot - smslib update. sms sending - - Revision 1.5 2001/11/20 16:22:23 pkot - First attempt to read Picture Messages. They should appear when you enable DEBUG. Nokia seems to break own standards. :/ (Markus Plail) - - Revision 1.4 2001/11/19 13:09:40 pkot - Begin work on sms sending - - Revision 1.3 2001/11/18 00:54:32 pkot - Bugfixes. I18n of the user responses. UDH support in libsms. Business Card UDH Type - - Revision 1.2 2001/11/13 16:12:21 pkot - Preparing libsms to get to work. 6210/7110 SMS and SMS Folder updates + Revision 1.1.1.6 2002/04/03 00:08:20 short + Found in "gnokii-working" directory, some November-patches version Revision 1.1 2001/11/08 16:23:20 pkot New version of libsms. Not functional yet, but it reasonably stable API. @@ -100,8 +82,7 @@ typedef enum { SMS_FaxMessage = 0x06, SMS_EmailMessage = 0x07, SMS_OtherMessage = 0x08, - SMS_BusinessCard = 0x09, - SMS_UnknownUDH = 0x0a + SMS_UnknownUDH = 0x09 } SMS_UDHType; typedef struct { @@ -204,12 +185,12 @@ typedef struct { /* Validity of SMS Messages. */ typedef enum { - SMS_V1H = 0x0b, - SMS_V6H = 0x47, - SMS_V24H = 0xa7, - SMS_V72H = 0xa9, - SMS_V1W = 0xad, - SMS_VMax = 0xff + SMS_V1H = 0x0b, + SMS_V6H = 0x47, + SMS_V24H = 0xa7, + SMS_V72H = 0xa9, + SMS_V1W = 0xad, + SMS_VMax = 0xff } SMS_ValidityPeriod; typedef struct { @@ -222,23 +203,10 @@ typedef struct { } SMS_MessageValidity; -/* This data-type is used to specify the type of the number. See the official - GSM specification 03.40, version 6.1.0, section 9.1.2.5, page 35-37. */ -typedef enum { - SMS_Unknown = 0x81, /* Unknown number */ - SMS_International = 0x91, /* International number */ - SMS_National = 0xa1, /* National number */ - SMS_Network = 0xb1, /* Network specific number */ - SMS_Subscriber = 0xc1, /* Subscriber number */ - SMS_Alphanumeric = 0xd0, /* Alphanumeric number */ - SMS_Abbreviated = 0xe1 /* Abbreviated number */ -} SMS_NumberType; - /*** MESSAGE CENTER ***/ typedef struct { int No; /* Number of the SMSC in the phone memory. */ - SMS_NumberType Type; char Name[GSM_MAX_SMS_CENTER_NAME_LENGTH]; /* Name of the SMSC. */ SMS_IndicationType Format; /* SMS is sent as text/fax/paging/email. */ SMS_ValidityPeriod Validity; /* Validity of SMS Message. */ @@ -246,8 +214,21 @@ typedef struct { char Recipient[GSM_MAX_SMS_CENTER_LENGTH]; /* Number of the default recipient. */ } SMS_MessageCenter; + /*** SHORT MESSAGE CORE ***/ +/* This data-type is used to specify the type of the number. See the official + GSM specification 03.40, version 6.1.0, section 9.1.2.5, page 35-37. */ +typedef enum { + SMS_Unknown = 0x81, /* Unknown number */ + SMS_International = 0x91, /* International number */ + SMS_National = 0xa1, /* National number */ + SMS_Network = 0xb1, /* Network specific number */ + SMS_Subscriber = 0xc1, /* Subscriber number */ + SMS_Alphanumeric = 0xd0, /* Alphanumeric number */ + SMS_Abbreviated = 0xe1 /* Abbreviated number */ +} SMS_NumberType; + typedef struct { SMS_NumberType type; char number[SMS_MAX_ADDRESS_LENGTH]; @@ -260,7 +241,6 @@ typedef enum { /* Bits meaning */ SMS_Submit_Report = 0x03, /* 01 1 */ SMS_Command = 0x04, /* 10 0 mark a report */ SMS_Status_Report = 0x05, /* 10 1 Section 9.2.3.1; 3rd digit is to */ - SMS_Picture = 0x07 /* Looks like Happy N*kia Engineers (TM) invention */ } SMS_MessageType; typedef enum { @@ -282,34 +262,10 @@ typedef enum { SMS_Unsent = 0x07 } SMS_MessageStatus; -/* In contrast to GSM_MemoryType, SMS_MemoryType is phone dependant */ typedef enum { - GMT_IN = 0x08, /* Inbox in 6210/7110 */ - GMT_OU = 0x10, /* Outbox in 6210/7110 */ - GMT_AR = 0x18, /* Archive in 6210/6110 */ - GMT_TE = 0x20, /* Templates in 6210/7110 */ - GMT_F1 = 0x29, /* 1st CUSTOM FOLDER in 6210/7110*/ - GMT_F2 = 0x31, - GMT_F3 = 0x39, - GMT_F4 = 0x41, - GMT_F5 = 0x49, - GMT_F6 = 0x51, - GMT_F7 = 0x59, - GMT_F8 = 0x61, - GMT_F9 = 0x69, - GMT_F10 = 0x71, - GMT_F11 = 0x79, - GMT_F12 = 0x81, - GMT_F13 = 0x89, - GMT_F14 = 0x91, - GMT_F15 = 0x99, - GMT_F16 = 0xA1, - GMT_F17 = 0xA9, - GMT_F18 = 0xB1, - GMT_F19 = 0xB9, - GMT_F20 = 0xC1 /* 20th CUSTOM FOLDER in 6210/7110 */ + SMS_XXX = 0x01 } SMS_MemoryType; - + /* Define datatype for SMS messages, describes precisely GSM Spec 03.40 */ typedef struct { /* Specification fields */ @@ -332,20 +288,24 @@ typedef struct { SMS_MessageValidity Validity; /* Validity Period Format & Validity Period (9.2.3.3 & 9.2.3.12) - `Message validity' in the phone */ unsigned short UDH_No; /* Number of presend UDHs */ - unsigned int UDH_Length; /* Length of the whole UDH */ SMS_UDHInfo UDH[SMS_MAX_UDH_HEADER_NUMBER]; /* User Data Header Indicator & User Data Header (9.2.3.23 & 9.2.3.24) */ SMS_DateTime SMSCTime; /* Service Centre Time Stamp (9.2.3.11) */ SMS_DateTime Time; /* Discharge Time (9.2.3.13) */ /* Other fields */ - SMS_MemoryType MemoryType; /* memoryType (for 6210/7110: folder indicator */ + SMS_MemoryType MemoryType; /* memoryType (for 6210/7110: folder indicator */ SMS_MessageStatus Status; /* Status of the message: sent/read or unsent/unread */ // SMS_CommandType Command; /* Command Type - 8 bits (9.2.3.19); FIXME: use it!!!! */ // unsigned char Parameter[???]; /* Parameter Indicator (9.2.3.27); FIXME: how to use it??? */ } GSM_SMSMessage; +extern GSM_Error EncodePDUSMS(GSM_SMSMessage *SMS, char *frame); +extern GSM_Error DecodePDUSMS(unsigned char *message, GSM_SMSMessage *SMS, int MessageLength); +extern GSM_Error EncodeTextSMS(); +extern GSM_Error DecodeTextSMS(unsigned char *message, GSM_SMSMessage *SMS); + /*** FOLDERS ***/ /* Maximal number of SMS folders */ @@ -362,7 +322,7 @@ typedef struct { typedef struct { SMS_Folder Folder[MAX_SMS_FOLDERS]; - u8 FolderID[MAX_SMS_FOLDERS]; /* ID specific for this folder and phone. */ + u8 FoldersID[MAX_SMS_FOLDERS]; /* ID specific for this folder and phone. */ /* Used in internal functions. Do not use it. */ u8 number; /* number of SMS folders */ } SMS_FolderList; @@ -378,13 +338,4 @@ typedef struct { int New; } GSM_CBMessage; -extern int EncodePDUSMS(GSM_SMSMessage *SMS, char *frame); -extern GSM_Error DecodePDUSMS(unsigned char *message, GSM_SMSMessage *SMS, int MessageLength); -/* Do not use these yet */ -extern GSM_Error EncodeTextSMS(); -extern GSM_Error DecodeTextSMS(unsigned char *message, GSM_SMSMessage *SMS); - -/* FIXME: make this static */ -extern char *GetBCDNumber(u8 *Number); - #endif /* __gnokii_sms_h_ */