📄 mmscore.h
字号:
/*=====================================================================
Copyright (c) 2001-2002 MobileSoft Corporation
All Rights Reserved.
$Logfile: mmscore.h
$Revision:
$vision: 1.00
$Date: 08/10/2002
$Author: hulf
$Declare:
This document contains information proprietary to MobileSoft
Technology (Nanjing), Corp. Transmittal, receipt, or possession
of this document does not express, license, or imply any rights to
use, sell, design, or manufacture from this information. No reproduction,
publication, or disclosure of this information, in whole or in part,
shall be made without prior written authorization from an officer of
MobileSoft Technology (NanJing), Corp.
Abstract:
Modified By:
Environment:
Revision History:
=====================================================================*/
#ifndef _MMSCORE_H_
#define _MMSCORE_H_
#include "mmscfg.h"
#include "mms_clib.h"
#include "mms_codec.h"
#ifdef MULTI_RECEPIENT
/*
* Added by longqiangl
* 2003-07-01
* MMS client should process correctly multi-recepient information
* tag_MMS_RECEPIENT is defined for this consideration
* The MMS recepient information , including To/CC/BCC
*/
typedef struct tag_MMS_RECEPIENT
{
struct tag_MMS_RECEPIENT *p_next;
/* Address of the recipient. */
MMS_S8 m_address[MAX_NAME_LENGTH];
}MMS_RECEPIENT;
typedef MMS_RECEPIENT* p_MMS_RECEPIENT;
#endif
/* struct define: CmsMMSHead
* define head field of MMS PDU
*/
typedef struct _CmsMMSHead
{
/* Internal Flags */
MMS_S32 flagMultipartRelated;
/* Header Fields Flags */
MMS_S32 flagBccAvailable;
MMS_S32 flagCcAvailable;
MMS_S32 flagContentTypeAvailable;
MMS_S32 flagDateAvailable;
MMS_S32 flagDeliveryReportAvailable;
MMS_S32 flagDeliveryTimeAvailable;
MMS_S32 flagDeliveryTimeAbsolute;
MMS_S32 flagExpiryAvailable;
MMS_S32 flagExpiryAbsolute;
MMS_S32 flagFromAvailable;
MMS_S32 flagMessageClassAvailable;
MMS_S32 flagMessageIdAvailable;
MMS_S32 flagMessageTypeAvailable;
MMS_S32 flagMMSVersionAvailable;
MMS_S32 flagPriorityAvailable;
MMS_S32 flagReadReplyAvailable;
MMS_S32 flagSenderVisibilityAvailable;
MMS_S32 flagStatusAvailable;
MMS_S32 flagSubjectAvailable;
MMS_S32 flagToAvailable;
MMS_S32 flagTransactionIdAvailable;
/* hulf add */
MMS_S32 flagContentLocationAvailable;
MMS_S32 flagReportAllowedAvailable;
MMS_S32 flagResponseStatusAvailable;
MMS_S32 flagResponseTextAvailable;
MMS_S32 flagMessageSizeAvailable;
/* head flied value */
#ifdef MULTI_RECEPIENT
p_MMS_RECEPIENT p_bcc_head;
p_MMS_RECEPIENT p_cc_head;
p_MMS_RECEPIENT p_to_head;
#else
MMS_S8 *Mms_bcc; /* Address of the recipient. */
MMS_S8 *Mms_cc; /* Address of the recipient. */
MMS_S8 *Mms_to; /* Address of the recipient. */
#endif
MMS_S8 Mms_content_location[MAX_CONTENTLOCATON_LENGTH];
/* This field defines the location of the message. */
MMS_S8 Mms_content_type[MAX_CONTENT_LENGTH];
/* The content type of the message. */
MMS_S32 Mms_date; /* Arrival time of the message at MMSProxy -Relay.
MMS Proxy -Relaywill generate this field when
not supplied by terminal. */
MMS_U8 Mms_delivery_report; /* Default determined when service is ordered.
Specifies whether the user wants a delivery
report from each recipient. When Message-Class
is Auto, the field SHALL always be present and
the value SHALL be No. */
MMS_S32 Mms_delivery_time; /* default: immediate.
Time of desired delivery. Indicates the earliest
possible delivery of the message to the recipient.
The field has two formats, either absolute or
CMS_interval. */
MMS_S32 Mms_expiry; /* default: maximum.
Length of time the message will be stored in MMS
Proxy-Relayor time to delete the message. The field has
two formats, either absolute or CMS_interval. */
MMS_S8 *Mms_from; /* Address of the sender. If hiding the address of the sender
from the recipient is supported, the MMS Proxy -Relay
will not add this field to a message header. */
MMS_U8 Mms_message_class; /* Class of the message. */
MMS_S8 Mms_message_ID[MAX_MESSAGEID_LENGTH];
/* This is an unique reference assigned to message. This ID
SHALL always be present when the originator client
requested a read reply.
The ID enables a client to match read reports with */
/* Encoded as in email address as per [RFC822].
The MMS_S8acters "<" and ">" are not included. */
MMS_U8 Mms_message_type; /* Specifies the message type. */
MMS_U8 Mms_mms_version; /* The MMS version number. According to this
specification, the version is 1.0. */
/* The three most significant bits of the Short-CMS_integer are
CMS_interpreted to encode a major version number in the range 1-7,
and the four least significant bits contain a minor version
number in the range 0-14. If there is only a major version
number, this is encoded by placing the value 15 in the four
least significant bits [WAPWSP]. */
MMS_U32 Mms_message_size; /* Full size of message in octets. */
MMS_U8 Mms_priority; /* Default: Normal.
Priority of the message for the recipient. */
MMS_U8 Mms_read_reply; /* Specifies whether the user wants a read report from each
recipient as a new message. When Message-Class is
Auto, the field SHALL always be present and the value
SHALL be No. */
MMS_U8 Mms_report_allowed; /* Default: Yes.
Sending of delivery report allowed to the user or not. */
MMS_U8 Mms_response_status; /* MMS specific status. */
MMS_S8 Mms_response_text[MAX_RESPONSETEXT_LENGTH];
/* Description which qualifies the response status value. */
MMS_U8 Mms_sender_visibility; /* Default: show address/phone number of the
sender to the recipient unless the sender has a secret
number/address.
Hide = don't show any address. Show = show even secret
address. */
MMS_U8 Mms_status; /* Message status. The status Retrieved SHALL be used
only after successful retrieval of multimedia message. */
MMS_S8 Mms_subj[MAX_SUBJECT_LENGTH];
/* Subject of the message. */
MMS_S8 Mms_transaction_ID[MAX_NAME_LENGTH];
/* This transaction ID identifies the M-Send.conf and the
corresponding request only. */
} CmsMMSHead;
/* struct define: MMSContentHead
* define data block head information in rfc2387 mutipart/related
*/
typedef struct _MMSContentHead
{
MMS_S8 Charset[30]; /* charset of this data block */
MMS_S8 Type[30]; /* media type of this block */
MMS_S8 Encoding[30]; /* encodeing type of this block */
} MMSContentHead;
/* struct define: MMSContentList
* define data block list in MMS PDU body
*/
typedef struct _MMSContentList
{
MMS_S32 start; /* start poCMS_int of this data block */
MMS_S32 length; /* length of this data block */
MMS_S8 charset; /* charset value this block */
MMS_S8 type[MAX_CONTENT_LENGTH]; /* format type of this block */
MMS_S8 id[MAX_NAME_LENGTH]; /* id value or filename of this block */
MMS_S8 filename[MAX_NAME_LENGTH]; /* file name of this block */
struct _MMSContentList *firstchild; /* first child of this data block */
struct _MMSContentList *next; /* next of this data block */
}MMSContentList;
/* struct define: CmsMMSDocument
* CmsMMSDocument describe a mms pdu
*/
typedef struct _CmsMMSDocument
{
MMS_S8 mmsfile[MAX_NAME_LENGTH]; /* filename of mm */
MMS_S8 mmsstart[MAX_NAME_LENGTH]; /* smil or wml document id(filename) */
MMS_S8 mmstype[MAX_NAME_LENGTH]; /* document type */
MMSContentList *ccontent; /* current content in body */
CmsMMSHead *mmshead; /* head of mm */
MMSContentList *content; /* content list in body */
}CmsMMSDocument;
typedef CmsMMSDocument *P_MMS_DOCUMENT;
/* struct define: CmsMMSDecoder
* CmsMMSDecoder decoder a mms pdu
*/
typedef struct _CmsMMSDecoder
{
P_MMS_DOCUMENT md_Message;
MMS_S32 md_bMultipartRelated;
MMS_S32 md_bMessageAvailable;
MMS_S32 md_bHeaderDecoded;
MMS_S8 m_In[FILE_BLOCK_LENGTH];
MMS_FILE fp;
MMS_S32 m_i;
MMS_S32 m_long;
MMS_S32 m_base;
MMS_S32 state;
}CmsMMSDecoder;
typedef CmsMMSDecoder *P_MMS_DECODER;
/* struct define: CmsMMSEncoder
* CmsMMSEncoder encoder a mms pdu
*/
typedef struct _CmsMMSEncoder
{
P_MMS_DOCUMENT m_Message;
MMS_S32 me_bMultipartRelated;
MMS_S32 me_bMessageAvailable;
MMS_S32 me_bMessageEncoded;
MMS_FILE m_Out;
}CmsMMSEncoder;
typedef CmsMMSEncoder *P_MMS_ENCODER;
MMS_S32 cms_mms_encode(P_MMS_DOCUMENT mmsdocument, MMS_S8 *app_path);
MMS_S32 cms_mms_decode(P_MMS_DOCUMENT mmsdocument, MMS_S8 *app_path);
/* inner function define */
/* decoder */
MMS_U8 decodeByte(MMS_U8 value);
MMS_S32 unsignedByte(MMS_S8 value);
MMS_S32 readMultipleByteInt(P_MMS_DECODER pmmsdecoder, MMS_S32 length);
MMS_S32 readTextString(P_MMS_DECODER pmmsdecoder, MMS_S8 *text, MMS_S32 length);
MMS_S32 readUintvar(P_MMS_DECODER pmmsdecoder);
MMS_S32 readValueLength(P_MMS_DECODER pmmsdecoder);
MMS_VOID readWellKnownMedia(P_MMS_DECODER pmmsdecoder, MMS_S8 fvalue[128]);
MMS_VOID readContentTypeValue(P_MMS_DECODER pmmsdecoder, MMS_S8 value[128]);
MMS_U8 getaddresstype(MMS_S8 *value);
MMS_S32 readMMBodyMultiPartRelated(P_MMS_DECODER pmmsdecoder);
MMS_S32 readMMBodyMultiPartMixed(P_MMS_DECODER pmmsdecoder);
MMS_VOID readMMHeader(P_MMS_DECODER pmmsdecoder);
MMS_VOID decodeHeader(P_MMS_DECODER pmmsdecoder);
MMS_VOID decodeBody(P_MMS_DECODER pmmsdecoder);
/* encoder */
MMS_S32 EncodeMultiByteNumber(MMS_S32 ldate, MMS_S8 date[16]);
MMS_S32 EncodeUintvarNumber(MMS_S8 data[16], MMS_S32 lData);
MMS_U8 encodeContentType(MMS_S8 *ContentType);
MMS_VOID writeUintvar(P_MMS_ENCODER pmmsencoder, MMS_S32 value);
MMS_VOID writeValueLength(P_MMS_ENCODER pmmsencoder, MMS_S32 value);
MMS_S32 getNumContents(P_MMS_ENCODER pmmsencoder);
MMS_S32 getcontentlength(MMSContentList *list, MMS_S8 *app_path);
MMS_VOID encodeContent(P_MMS_ENCODER pmmsencoder, MMSContentList *list, MMS_S8 *app_path);
MMS_S32 Encodelist(P_MMS_ENCODER pmmsencoder, MMSContentList *list, MMS_S8 *app_path);
MMS_VOID mmsencodehead(P_MMS_ENCODER pmmsencoder);
MMS_VOID mmsencodebody(P_MMS_ENCODER pmmsencoder, MMS_S8 *app_path);
//extern void rvf_delay(MMS_U32 ticks);
#endif /* _MMSCORE_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -