?? const.h
字號:
/**
* const.h
*
* Short Message Abstractive Library.(SMAL)
*
* Copyright 2003-2006 北京風起水流軟件工作室
*
* http://www.zealware.com
*
* princetoad@gmail.com
*
*/
#ifndef _SMAL_CONST_H
#define _SMAL_CONST_H
/** Version definition
*/
static const unsigned char CMPP2_VERSION = 0x20; ///< CMPP2.0協議版本號
static const unsigned char CMPP3_VERSION = 0x30; ///< CMPP3.0協議版本號
static const unsigned char CNGP2_VERSION = 0x20; ///《CNGP2.0協議版本號
static const unsigned char SMGP138_VERSION = 0x13; ///< SMGP1.38
static const unsigned char SMGP20_VERSION = 0x20; ///< SMGP2.0
static const unsigned char SMGP30_VERSION = 0x30; ///< SMGP3.0
static const unsigned char IMPP_VERSION = 0x10; ///< IMPP1.0
static const unsigned char SMPP34_VERSION = 0x34; ///< SMPP3.4版本號
/** Protocol advice value defination
*/
static const int SMGP_ACTIVETEST_RETRYINTERVAL = 180; ///< 重發時間間隔
static const int SMGP_ATTIVETEST_RESPTIMEOUT = 60; ///< Response超時時間
static const int SMGP_ACTIVETEST_RETRYCOUNT = 3; ///< 重發次數
static const int SMGP_SUBMIT_RETRYINTERVAL = 60; ///< SUBMIT消息重發時間間隔
static const int SMGP_SUBMIT_RETRYCOUNT = 3; ///< SUBMIT重發次數
static const int SMGP_SUBMIT_RESPTIMEOUT = 60; ///< SUBMITResponse超時時間
static const int SMGP_SUBMIT_SLIDINGWINDOW_SIZE = 16; ///< 滑動窗口大小
/** Socket error
*/
static const int SOCKET_TIMEOUT = 5; ///< socket超時(收發)
static const int SOCKET_CLOSED = -1; ///< socket關閉(連接)
/** Application error
*/
static const int SMS_UNLOGOIN = 16001; ///< 客戶端沒有登錄.
static const int SMS_ALREADY_STARTED = 16002; ///< 網關已經啟動
static const int SMS_UNSTARTED = 16003; ///< 網關沒有啟動
static const int SMS_EXPIRED = 16004; ///< 超過試用期
enum SMAL_ERROR_CODE {
e_ERROR_NOAVAILABLECONNECTION = 16005
};
/** AsiaInfo ISMG Definition
*/
static const unsigned char ASIA_MT = 0x00; ///< 亞信網關MT連接版本號
static const unsigned char ASIA_MO = 0x01; ///< 亞信網關MO連接版本號
/** StatusReport
*/
static const unsigned char NEED_SREPORT = 1; ///< 要求返回狀態報告
static const unsigned char NO_SREPORT = 0; ///< 不要求返回狀態報告
static const unsigned char IS_SREPORT = 1; ///< 是狀態報告消息
static const unsigned char NOT_SREPORT = 0; ///< 不是狀態報告消息
/** cmpp3 about
*/
static const int MAX_QUEUESIZE = 100000; ///< 堆棧的最大長度
static const int TERMINALTYPE_TRUENUMBER = 0; ///< 終端類型 - 真實號碼
static const int TERMINALTYPE_FALSENUMBER = 1; ///< 終端類型 - 偽碼
static const int DEFAULT_DESTTERMINALCOUNT = 1; ///< 默認的目標號碼數
static const int DEFAULT_TPPID = 0; ///< 默認的TPPID值
static const int DEFAULT_TPUDHI = 0; ///< 默認的TPUDHI值
static const int DEFAULT_FEETERMINALTYPE = 0; ///< 默認的付費用戶類型
static const int MAX_LINE = 4192;
#ifdef CMPP3_MSISDN24_RESULT1
typedef unsigned char PINTResult;
static const int LENGTH_OF_RESULT_IN_RESPONSE = 1; ///< Result長度1
static const int LENGTH_OF_MSISDN_IN_MOMT = 24; ///< MSISDN長度24
static const int LENGTH_OF_CONNECT_RESPONSE = 18;
static const int LENGTH_OF_MOMT_RESPONSE = 9;
static const int LENGTH_OF_CANCEL_RESPONSE = 1;
static const int LENGTH_OF_STATUSREPORT = /*71-11*/60;
static const int LENGTH_OF_PADDING_IN_SUBMIT = 0;
#else
typedef unsigned long PINTResult;
static const int LENGTH_OF_RESULT_IN_RESPONSE = 4; ///< Result長度4
static const int LENGTH_OF_MSISDN_IN_MOMT = 32; ///< MSISDN長度32
static const int LENGTH_OF_CONNECT_RESPONSE = 21;
static const int LENGTH_OF_MOMT_RESPONSE = 12;
static const int LENGTH_OF_CANCEL_RESPONSE = 4;
static const int LENGTH_OF_STATUSREPORT = 71;
static const int LENGTH_OF_PADDING_IN_SUBMIT = 0;
#endif
/** SMGP
*/
static const unsigned char DEFAULT_MTMSGTYPE = 6;
/** 輔助線程參數索引
*/
enum ThreadIndex
{
LOG_INDEX,
MT_INDEX,
MONITER_INDEX
};
enum JobType {
e_JOB_SendSubmit,
e_JOB_OnMTFailed,
e_JOB_OnMTSucceed,
e_JOB_OnDeliver,
e_JOB_OnActiveTestResponse,
e_JOB_OnActiveTest,
e_JOB_OnCancelResponse,
e_JOB_OnQueryResponse,
e_JOB_OnStatusReport,
e_JOB_OnTerminate,
e_JOB_OnSubmitResponse,
e_JOB_OnSubmiting,
NumOfJobs
};
enum CMPP_COMMAND {
e_CMPP_CONNECT = 0x00000001,
e_CMPP_TERMINATE = 0x00000002,
e_CMPP_SUBMIT = 0x00000004,
e_CMPP_DELIVER = 0x00000005,
e_CMPP_QUERY = 0x00000006,
e_CMPP_CANCEL = 0x00000007,
e_CMPP_ACTIVE_TEST = 0x00000008,
e_CMPP_CONNECT_RESP = 0x80000001,
e_CMPP_TERMINATE_RESP = 0x80000002,
e_CMPP_SUBMIT_RESP = 0x80000004,
e_CMPP_DELIVER_RESP = 0x80000005,
e_CMPP_QUERY_RESP = 0x80000006,
e_CMPP_CANCEL_RESP = 0x80000007,
e_CMPP_ACTIVE_TEST_RESP = 0x80000008,
NumOfCMPPCommand
};
enum CNGP_COMMAND {
e_CNGP_CONNECT = 0x00000001,
e_CNGP_SUBMIT = 0x00000002,
e_CNGP_DELIVER = 0x00000003,
e_CNGP_ACTIVE_TEST = 0x00000004,
e_CNGP_TERMINATE = 0x00000006,
e_CNGP_CONNECT_RESP = 0x80000001,
e_CNGP_SUBMIT_RESP = 0x80000002,
e_CNGP_DELIVER_RESP = 0x80000003,
e_CNGP_ACTIVE_TEST_RESP = 0x80000004,
e_CNGP_TERMINATE_RESP = 0x80000006,
};
enum SMGP_COMMAND {
/**
客戶端登錄請求
*/
e_SMGP_LOGIN = 0x00000001,
/**
提交短消息
*/
e_SMGP_SUBMIT = 0x00000002,
/**
下發短消息
*/
e_SMGP_DELIVER = 0x00000003,
/**
鏈路檢測
*/
e_SMGP_ACTIVE_TEST = 0x00000004,
/**
退出請求
*/
e_SMGP_EXIT = 0x00000006,
/**
SP統計查詢請求
*/
e_SMGP_QUERY = 0x00000007,
/**
客戶端登錄應答
*/
e_SMGP_LOGIN_RESP = 0x80000001,
/**
提交短消息應答
*/
e_SMGP_SUBMIT_RESP = 0x80000002,
/**
下發短消息應答
*/
e_SMGP_DELIVER_RESP = 0x80000003,
/**
鏈路檢測應答
*/
e_SMGP_ACTIVE_TEST_RESP = 0x80000004,
/**
退出應答
*/
e_SMGP_EXIT_RESP = 0x80000006,
/**
SP統計查詢應答
*/
e_SMGP_QUERY_RESP = 0x80000007
};
enum SMGP_TLV_TAG {
e_SMGP_TP_pid = 0x001,
e_SMGP_TP_udhi = 0x0002,
e_SMGP_LinkID = 0x0003,
e_SMGP_ChargeUserType = 0x0004,
e_SMGP_ChargeTermType = 0x0005,
e_SMGP_ChargeTermPseudo = 0x0006,
e_SMGP_DestTermType = 0x0007,
e_SMGP_DestTermPseudo = 0x0008,
e_SMGP_PkTotal = 0x0009,
e_SMGP_PkNumber = 0x000A,
e_SMGP_SubmitMsgType = 0x000B,
e_SMGP_SPDealResult = 0x000C,
e_SMGP_SrcTermType = 0x000D,
e_SMGP_SrcTermPseudo = 0x000E,
e_SMGP_NodesCount = 0x000F,
e_SMGP_MsgSrc = 0x0010,
e_SMGP_SrcType = 0x0011,
e_SMGP_MServiceID = 0x0012
};
enum CNGP_TLV_TAG {
e_CNGP_ProtocolID = 0x0100,
e_CNGP_CongestionState = 0x0428
};
enum IMPP_COMMAND {
/**
客戶端登錄請求
*/
e_IMPP_LOGIN = 0x00000001,
/**
提交短消息
*/
e_IMPP_SUBMIT = 0x00000002,
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -