📄 gatewayproxyprotocol.h
字号:
/////////////////////////////////////////////////////////////////////
// Project : GatewayProxy
// File: BaseWnd.h
// SMS and http protocol module of this project
// 2005/03/27
/////////////////////////////////////////////////////////////////////
#ifndef GATEWAYPROXY_PROTOCOL_H_
#define GATEWAYPROXY_PROTOCOL_H_
//---------------- Inculde ------------------
#include "AEE.h"
//-------------------------------------------
//---------------- Define -------------------
#define GATEWAYPROXY_VERSION 0x0001
#define PROTOCOL_CLSID_LEN 8
#define PROTOCOL_IMSI_LEN 15
#define PROTOCOL_APPNAME_LEN 20
#define PROTOCOL_POLICYTEXT_LEN 30
#define PROTOCOL_SEPARATOR ':'
//ErrorCode=1%ClassID=1100&BillingCount=2%BillingPolicy=2:普通包月1元&6:按次计费1元
/*
ErrorCode定义
0-有定购关系
1-无定购关系
10-查询参数不正确
100-业务不存在
200-其它错误
*/
#define CODE_ORDER_POLICY 0
#define CODE_ALL_POLICY 1
#define CODE_PARAM_ERROR 10
#define CODE_NONE_POLICY 100
#define CODE_ERROR 200
#define UNKNOW_ERRORCODE 0xFFFF;
#define CODE_ORDER_EXIST 0
#define CODE_ORDER_SUCCESS 1
#define CODE_ORDER_FAIL 200
#define PROTOCOL_ERRORCODE_START "ErrorCode="
#define PROTOCOL_ERRORMSG_START "ErrorMsg="
#define PROTOCOL_BILLINGPOLICY_START "BillingPolicy="
#define PROTOCOL_BILLINGCOUNT_START "BillingCount="
#define PROTOCOL_PRODUCTCOUNT_START "ProductCount="
#define PROTOCOL_CATALOGCOUNT_START "CatalogCount="
#define PROTOCOL_CATALOGID_START "CatID="
#define PROTOCOL_CLASSID_START "ClassID="
#define PROTOCOL_BILLINGPOLICY_SEPARATOR1 '%'
#define PROTOCOL_BILLINGPOLICY_SEPARATOR2 '&'
#define PROTOCOL_TYPE_MIN 100
#define PROTOCOL_TYPE_ORDERNOTIFY 401 //定购通知
#define PROTOCOL_TYPE_CHARGENOTIFY 402 //续费提示通知
#define PROTOCOL_TYPE_MAN 499
#define POLICY_MONTH 0x0001 //包月
#define POLICY_QUARTER 0x0002 //包季
#define POLICY_YEAR 0x0003 //包年
#define POLICY_TIMES 0x0004 //计次
#define POLICY_TIME 0x0005 //时长
#define POLICY_FLUX 0x0006 //流量
#define POLICY_FOREVER 0xFFFF //永久
#define INFO_RENEW 0x0F//续定标记
#define INFO_CANCEL 0xF0//退定标记
//-------------------------------------------
typedef struct
{
// Action type
uint16 wType;
// CLASSID field
AEECLSID clsApp;
// IMSI field
char szIMSI[PROTOCOL_IMSI_LEN+1];
// Text field (reserve)
//char szText[PROTOCOL_SMSTEXT_LEN+1];
}SMSInfo;
//Billing Policy资费策略
typedef struct
{
//Policy ID
uint32 cls;
//Plicy string
AECHAR wszName[PROTOCOL_APPNAME_LEN + 1];
//定购关系
AECHAR wszPolicy[PROTOCOL_POLICYTEXT_LEN + 1];
//是否能退定续定标记
boolean isCancel;
boolean isRenew;
}AppInfo;
typedef struct
{
//Policy ID
uint16 wId;
//Plicy string
AECHAR wszPolicy[PROTOCOL_POLICYTEXT_LEN + 1];
//是否可续定
boolean bIsRenewable;
}BillingPolicy;
boolean PROTOCOL_SMSDecode(char *pszText, SMSInfo *pInfo);
BillingPolicy *PROTOCOL_BillPolicyDecode(char *pszText, uint16 &nCount, uint16 &nErrorCode);
AppInfo *PROTOCOL_AppDownloadDecode(char *pszText, uint16 &nCount, uint16 &nErrorCode);
AppInfo *PROTOCOL_ServiceDecode(char *pszText, uint16 &nCount, uint16 &nErrorCode);
uint16 PROTOCOL_ResultDecode(char *pszText/*, AECHAR *&pResultMsg*/);
uint32 PROTOCOL_HEXSTRToUINT32(const char *pszText);
uint16 PROTOCOL_BillInfoDecode(char *pszText);
#endif /* #ifndef GATEWAYPROXY_PROTOCOL_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -