📄 smscom.h
字号:
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the DLL_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// DLL_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef DLL_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif
// This class is exported from the DLL.dll
class DLL_API CDLL {
public:
CDLL(void);
// TODO: add your methods here.
};
extern DLL_API int nDLL;
DLL_API int fnDLL(void);
#define GSM_7BIT 0
#define GSM_8BIT 4
#define GSM_UCS2 8
typedef struct {
char SCA[16]; // 短消息服务中心号码(SMSC地址)
char TPA[16]; // 目标号码或回复号码(TP-DA或TP-RA)
char TP_PID; // 用户信息协议标识(TP-PID)
char TP_DCS; // 用户信息编码方式(TP-DCS)
char TP_SCTS[16]; // 服务时间戳字符串(TP_SCTS), 接收时用到
char TP_UD[161]; // 原始用户信息(编码前或解码后的TP-UD)
char index; // 短消息序号,在读取时用到
}SM_PARAM;
DLL_API void WriteComm(HANDLE m_hCom, void *pData, int nLength);
DLL_API int ReadComm(HANDLE m_hCom,void *pData, int nLength);
DLL_API int gsmString2Bytes(const char* pSrc, unsigned char* pDst, int nSrcLength);
DLL_API int gsmSerializeNumbers(const char* pSrc, char* pDst, int nSrcLength);
DLL_API bool gsmSendMessage(HANDLE m_hCom,const SM_PARAM* pSrc);
DLL_API int gsmReadOneMessage(HANDLE m_hCom,SM_PARAM *pMsg);
DLL_API int gsmReadMessage(HANDLE m_hCom,SM_PARAM* pMsg);
DLL_API int gsmInvertNumbers(const char* pSrc, char* pDst, int nSrcLength);
DLL_API int gsmEncodeUcs2(const char* pSrc, unsigned char* pDst, int nSrcLength);
DLL_API int gsmEncodePdu(const SM_PARAM* pSrc, char* pDst);
DLL_API int gsmEncode7bit(const char* pSrc, unsigned char* pDst, int nSrcLength);
DLL_API bool gsmDeleteMessage(HANDLE m_hCom,const int index);
DLL_API int gsmDecodeUcs2(const unsigned char* pSrc, char* pDst, int nSrcLength);
DLL_API int gsmDecodePdu(const char* pSrc, SM_PARAM* pDst);
DLL_API int gsmDecode7bit(const unsigned char* pSrc, char* pDst, int nSrcLength);
DLL_API int gsmBytes2String(const unsigned char* pSrc, char* pDst, int nSrcLength);
DLL_API bool getcenternumber(HANDLE m_hCom,char*pcenternumber);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -