www.pudn.com > GsmToUart.rar > GsmToUartDlg.h


// GsmToUartDlg.h : header file 
// 
 
#if !defined(AFX_GSMTOUARTDLG_H__231DE67C_DE29_4EC3_95B9_A7A261B5E168__INCLUDED_) 
#define AFX_GSMTOUARTDLG_H__231DE67C_DE29_4EC3_95B9_A7A261B5E168__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
 
	// 用户信息编码方式 
	#define GSM_7BIT        0 
	#define GSM_8BIT        4 
	#define GSM_UCS2        8 
     
	// 短消息参数结构,编码/解码共用 
	// 其中,字符串以0结尾 
	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; 
 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CGsmToUartDlg dialog 
 
class CGsmToUartDlg : public CDialog 
{ 
// Construction 
public: 
	char tmpReceiveData[128]; 
	int ComOpenFlag; 
	HANDLE hCom1; 
	int ComUseEnable; 
	int GsmDecode8bit(const unsigned char *pSrc, char *pDst, int nSrcLength); 
	int GsmEncode8bit(const char *pSrc, unsigned char *pDst, int nSrcLength); 
	int ReadComm(void * pData , int nLength); 
	void WriteComm(CString tmpSend, int nLength); 
	BOOL GsmDeleteMessage(const int index); 
	int GsmReadMessage(SM_PARAM* pMsg); 
	BOOL GsmSendMessage(const SM_PARAM* pSrc); 
	int GsmDecodePdu(const char* pSrc, SM_PARAM* pDst); 
	int GsmEncodePdu(const SM_PARAM* pSrc, char* pDst); 
	int GsmSerializeNumbers(const char* pSrc, char* pDst, int nSrcLength); 
	int GsmInvertNumbers(const char* pSrc, char* pDst, int nSrcLength); 
	int GsmBytes2String(const unsigned char* pSrc, char* pDst, int nSrcLength); 
	int GsmString2Bytes(const char* pSrc, unsigned char* pDst, int nSrcLength); 
	int GsmDecodeUcs2(const unsigned char* pSrc, char* pDst, int nSrcLength); 
	int GsmEncodeUcs2(const char* pSrc, unsigned char* pDst, int nSrcLength); 
	int GsmDecode7bit(const unsigned char* pSrc, char* pDst, int nSrcLength); 
	int GsmEncode7bit(const char* pSrc, unsigned char* pDst, int nSrcLength); 
	CGsmToUartDlg(CWnd* pParent = NULL);	// standard constructor 
 
// Dialog Data 
	//{{AFX_DATA(CGsmToUartDlg) 
	enum { IDD = IDD_GSMTOUART_DIALOG }; 
	CString	m_nViewSmsRead; 
	CString	m_nViewSmsSend; 
	CString	m_nPhoneNumber; 
	CString	m_nResultAt; 
	CString	m_nCommandAt; 
	CString	m_nSignalintensity; 
	CString	m_nSmsSerNumber; 
	CString	m_nSmsSendNumber; 
	//}}AFX_DATA 
 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CGsmToUartDlg) 
	protected: 
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support 
	//}}AFX_VIRTUAL 
 
// Implementation 
protected: 
	HICON m_hIcon; 
 
	CString nComBaud; 
	CString nComSel; 
	CString nComData; 
	int nComStop; 
	int nComParity; 
	int nComShake; 
	int dwBaud; 
	int dwData; 
 
 
	// Generated message map functions 
	//{{AFX_MSG(CGsmToUartDlg) 
	virtual BOOL OnInitDialog(); 
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 
	afx_msg void OnPaint(); 
	afx_msg HCURSOR OnQueryDragIcon(); 
	afx_msg void OnRunAt(); 
	afx_msg void OnSendSms(); 
	afx_msg void OnReadSms(); 
	afx_msg void OnClosePhone(); 
	afx_msg void OnOnlinePhone(); 
	afx_msg void OnUartSetting(); 
	afx_msg void OnOpenUart(); 
	afx_msg void OnCloseUart(); 
	afx_msg void OnTimer(UINT nIDEvent); 
	afx_msg void OnHelpAt(); 
	afx_msg void OnLoadsms(); 
	afx_msg void OnSavesms(); 
	afx_msg void OnViewnotreadsms(); 
	afx_msg void OnDeletesms(); 
	afx_msg void OnSetsmssernumber(); 
	afx_msg void OnGetsmssernumber(); 
	afx_msg void OnClearatresult(); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_GSMTOUARTDLG_H__231DE67C_DE29_4EC3_95B9_A7A261B5E168__INCLUDED_)