📄 smgpbase.h
字号:
/**
* smgpbase.h
*
* Short Message Abstractive Library.(SMAL)
*
* Copyright 2003-2006 北京风起水流软件工作室
*
* http://www.zealware.com
*
* princetoad@gmail.com
*
*/
#ifndef _SMGP_BASE_H
#define _SMGP_BASE_H
class TCPSocket;
/// 底层SMGP协议实现类
/** 实现了底层的SMGP协议实现,实现Login,submit,deliver,ActiveTest消息和应答的组装和发送.
*/
//##ModelId=46B5D43C0015
class CSmgp
{
public:
//##ModelId=46B5D43C001F
int m_nSocketTimeout;
//##ModelId=46B5D43C0020
static unsigned long m_nSeq;
///< 网关支持的最高版本号
unsigned char smgversion;
public:
//##ModelId=46B5D43C0029
CSmgp( unsigned char version );
//##ModelId=46B5D43C002A
virtual ~CSmgp();
/**递增流水号
*/
//##ModelId=46B5D43C002C
static unsigned long IncreaseSeqId();
/**建立连接操作(Connect)
*/
//##ModelId=46B5D43C002D
int SendConnect(
TCPSocket * tsClient, ///< 通讯承载连接
unsigned long nSeqId, ///< 消息流水号
const char * pchSrcAddr, ///< 登录用户名(最长8位)
const char * pchPwd, ///< 登录口令(最长15位)
unsigned char uchLoginMode, ///< 登录模式
unsigned char uchVersion ///< 版本号
);
/**拆除连接操作Terminate)
*/
//##ModelId=46B5D43C0039
int SendTerminate(
TCPSocket * tsClient,
unsigned long nSeqId
);
/**提交短信操作(Submit)
*/
//##ModelId=46B5D43C003E
int SendSubmit(
TCPSocket * tsClient,
unsigned long nSeqId,
unsigned char uchMsgType,
unsigned char uchNeedreport,
unsigned char uchMsglevel,
const char * pchServiceid,
const char * pchFeetype,
const char * pchFeecode,
const char * pchFixedFee,
unsigned char uchMsgfmt,
const char * pchValidtime,
const char * pchAttime,
const char * pchSrcid,
const char * pchFeeterminalid,
unsigned char uchDestusrtl,
const char * pchDestterminalid,
unsigned char uchMsglen,
const char * pchMsgcontent,
const char * sReserve,
const char * sLinkID,
unsigned char uchSubmitMsgType,
unsigned char uchSPDealResult
);
/**送交短信应答(Deliver_Resp)
*/
//##ModelId=46B5D43C0056
int SendDeliverResp(
TCPSocket * tsClient,
unsigned long nSeqId,
const char * pchMsgid,
unsigned long nResult
);
/**连接活动测试
*/
//##ModelId=46B5D43C005B
int SendActiveTest(
TCPSocket * tsClient,
unsigned long nSeqId
);
/**发送拆除连接应答(Terminate_Response)包
*/
//##ModelId=46B5D43C005E
int SendTerminateResp(
TCPSocket * tsClient,
unsigned long nSeqId
);
/**发送活动连接测试应答(Active_Test_Response)包
*/
//##ModelId=46B5D43C0061
int SendActiveTestResp(
TCPSocket * tsClient,
unsigned long nSeqId
);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -