X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=include%2Fgsm-sms.h;h=37190aef330cd8a5f16bc6975976ed1e776dcc27;hp=3cde6f37ae23e9f7ac41b60add853912aa04e97d;hb=HEAD;hpb=1fdb423c0a2e33c1282bec25de66d9f40d56999b diff --git a/include/gsm-sms.h b/include/gsm-sms.h index 3cde6f3..37190ae 100644 --- a/include/gsm-sms.h +++ b/include/gsm-sms.h @@ -12,6 +12,17 @@ Include file for SMS library. + $Log$ + 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. + + Revision 1.1 2001/07/09 23:06:26 pkot + Moved sms.* files from my hard disk to CVS + + */ #ifndef __gnokii_sms_h_ @@ -36,7 +47,8 @@ #define SMS_MAX_ADDRESS_LENGTH (40) /* FIXME: what value should be here? (Pawel Kot) */ -#define SMS_MAX_UDH_NUMBER 10 +//#define GSM_MAX_USER_DATA_HEADER_LENGTH (10) +#define SMS_MAX_UDH_HEADER_NUMBER 10 /*** MEMORY INFO ***/ @@ -70,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 { @@ -174,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 { @@ -192,43 +203,32 @@ 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 enum { - SMS_FText = 0x00, /* Plain text message. */ - SMS_FFax = 0x22, /* Fax message. */ - SMS_FVoice = 0x24, /* Voice mail message. */ - SMS_FERMES = 0x25, /* ERMES message. */ - SMS_FPaging = 0x26, /* Paging. */ - SMS_FUCI = 0x2d, /* Email message in 8110i. */ - SMS_FEmail = 0x32, /* Email message. */ - SMS_FX400 = 0x31 /* X.400 message. */ -} SMS_MessageFormat; - 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_MessageFormat Format; /* SMS is sent as text/fax/paging/email. */ + SMS_IndicationType Format; /* SMS is sent as text/fax/paging/email. */ SMS_ValidityPeriod Validity; /* Validity of SMS Message. */ char Number[GSM_MAX_SMS_CENTER_LENGTH]; /* Number of the SMSC. */ 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]; @@ -241,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 { @@ -263,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 */ @@ -313,57 +288,23 @@ 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_NUMBER]; /* User Data Header Indicator & User Data Header (9.2.3.23 & 9.2.3.24) */ + 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; -/* Define the layout of the SMS message header */ -typedef struct { - bool IsSupported; - short MoreMessages; - short ReplyViaSameSMSC; - short RejectDuplicates; - short Report; - short Number; - short Reference; - short PID; - short ReportStatus; - short Length; - short DataCodingScheme; - short Validity; - short UserDataHeader; - short MessageCenter; - bool IsMessageCenterCoded; - short RemoteNumber; - bool IsRemoteNumberCoded; - short SMSCTime; - short Time; - short MemoryType; - short Status; - short UserData; - bool IsUserDataCoded; -} SMSMessage_Layout; - -/* Define set of SMS Headers for the phone series */ -typedef struct { - unsigned short Type; - SMSMessage_Layout Deliver; - SMSMessage_Layout Submit; - SMSMessage_Layout DeliveryReport; - SMSMessage_Layout Picture; -} SMSMessage_PhoneLayout; - -extern SMSMessage_PhoneLayout layout; +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 ***/ @@ -381,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; @@ -397,15 +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); - -/* We really do need this in the other code */ -extern char *GetBCDNumber(u8 *Number); -extern int SemiOctetPack(char *Number, unsigned char *Output, SMS_NumberType type); - #endif /* __gnokii_sms_h_ */