⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smgpapidef.h

📁 中兴SMGP通信协议接口,API函数,编写该通信协议下的程序可调有其中的函数
💻 H
字号:
#ifndef TSSX_SMGP_H
#define TSSX_SMGP_H

#define OK					0   //成功
#define SYSTEM_BUSY			1   //系统忙
#define CONNECT_FAIL		2	//联接失败
#define SYSTEM_ERROR		3	//系统错误包括数据包长度错和请求标示错
#define INVALID_MSG_LEN		4	//非法短消息长度
#define INVALID_FEE_CODE 	5  	//非法资费代码
#define TOO_LONG_MSG		6  	//短消息长度超长
#define INVALID_SERVICE_ID	7  	//非法业务类型
#define TOO_QUICK_SPEED		8  	//发送速度太快
#define INVALID_IP_ADDR		9	//IP地址错
#define INVALID_SP_ID		10 	//非法cp编号
#define INVALID_MSG_FORMAT	11 	//非法消息格式 
#define INVALID_FEE_TYPE	12 	//非法资费类别
#define INVALID_VALID_TIME	13 	//非法存活有效期 
#define INVALID_AT_TIME		14 	//非法定时发送时间
#define INVALID_CHARGE_NUM	15 	//非法计费号码		
#define INVALID_DEST_NUM	16 	//非法目标号码
#define OPEN_DESTFILE_FAIL	17 	//不能打开目标号码文件
#define OPEN_MSGFILE_FAIL	18 	//不能打开短消息内容文件
#define INVALID_MSG_CONTENT	19 	//非法短消息
#define CONNECT_GW_FAIL		20 	//连接短消息网关失败
#define LOGIN_GW_FAIL		21 	//登录失败
#define RECV_REP_FAIL		22 	//接收结果数据包失败
#define SEND_QUEUE_FULL		23 	//发送队列满
#define EXCEED_SYSTEM_PRO	24 	//超出系统限制
#define CMD_ERR				25  //命令字错
#define SEQID_DUP			26	//序列号重复
#define VER_MISMATCH		29	//版本号不匹配
#define INVALID_MSG_TYPE	30	//非法消息类型
#define INVALID_MSG_LEVEL	31  //非法优先级
#define INVALID_TIME_FORMAT 35	//非法时间格式
#define INVALID_QUERY_TYPE	38 	//非法查询类型
#define INVALID_FIXED_CODE	40	//非法包月/封顶费
#define INVALID_USER		46 	//非法发送用户号码
#define OTHER_SYSTEM_ERR	99 	//系统错误
#define RESERVED_ERR		100 	//保留

#define ERROR_SOCKET_CREATE -100
#define ERROR_CONNECT		-101
#define ERROR_SOCKET_WRITE	-102
#define ERROR_SOCKET_READ	-103
#define ERROR_ICP_ID		-104
#define ERROR_AUTH			-105
#define ERROR_MSG_LEN		-106
#define ERROR_FEE_CODE		-107
#define ERROR_SERVICE_ID	-108
#define ERROR_FLOW_CONTROL	-109
#define ERROR_SOCKET_CLOSE	-110 

#define MSGID_LEN	21
#define DIAL_LEN	22
#define MAX_MSG_LEN	201
#define DATETIME_LEN	15
#define RESERVED_LEN	8

struct deliverresp{
        char            msgid[MSGID_LEN];
	unsigned char	msgformat;
	char		srctermid[DIAL_LEN];
	unsigned char 	isreport;
	unsigned char	msglength;
	char		msgcontent[MAX_MSG_LEN];
	char		desttermid[DIAL_LEN];
	char		recvtime[DATETIME_LEN];
	char		reserved[RESERVED_LEN];
};

struct SendBatchResp
{
	char msgid[MSGID_LEN];
	int errorcode;
	char phonenum[DIAL_LEN];
};

#define FILE_LEN	100
int InitSMGPAPI (char inifile[FILE_LEN]);
int login (int type);

#define SERVICEID_LEN	11
#define FEETYPE_LEN	3
#define FEECODE_LEN	7
#define LONG_DATETIME_LEN	18
#define MSGTYPE_LEN	2

int SMGPSendSingle (int needreply,int msglevel,char serviceid[SERVICEID_LEN],int msgformat,
        char feetype[FEETYPE_LEN],char feecode[FEECODE_LEN],char fixedcode[FEECODE_LEN],
	char validtime[LONG_DATETIME_LEN],char attime[LONG_DATETIME_LEN],char srctermid[DIAL_LEN],
	char chargetermid[DIAL_LEN],char desttermid[DIAL_LEN],int msglen,char *msgcontent,
	char msgid[MSGID_LEN],int *errorcode,char msgtype[MSGTYPE_LEN],char reserved[RESERVED_LEN]);

int SMGPSendBatch(int needreply,int msglevel,char serviceid[SERVICEID_LEN],int msgformat,
		  char feetype[FEETYPE_LEN],char feecode[FEECODE_LEN],char fixedcode[FEECODE_LEN],
		  char validtime[LONG_DATETIME_LEN],char attime[LONG_DATETIME_LEN],
                  char srctermid[DIAL_LEN],char chargetermid[DIAL_LEN],
		  char desttermidfile[FILE_LEN],char msglen,char *msgcontent,
		  char msgidfile[FILE_LEN],char msgtype[MSGTYPE_LEN],char reserved[RESERVED_LEN]);

int GetSendBatchResp (char msgidfile[FILE_LEN],int pos,struct SendBatchResp *sendbatchresp);

int SMGPDeliver(int Ntimeout,struct deliverresp *deli);

//int is_status_report(struct deliver *p_deliver);
//struct status_report *get_status_report(struct deliver *p_deliver);

int SMGPActiveTest(int *errcode);

int logout(int sockfd);

int sendactivetestresp(int sockfd);

int sendexitresp(int sockfd);

#endif
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -