// KwLoRaToolDlg.h: 头文件 // #pragma once #include "MyButton.h" // CKwLoRaToolDlg 对话框 class CKwLoRaToolDlg : public CDialogEx { // 构造 public: CKwLoRaToolDlg(CWnd* pParent = nullptr); // 标准构造函数 // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_KWLORATOOL_DIALOG }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 // 实现 protected: HICON m_hIcon; // 生成的消息映射函数 virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() public: int ShowParams(); int GetParams(); afx_msg void OnTimer(UINT_PTR nIDEvent); int DelayInit(); CMFCButton m_button1; CMFCButton m_Button_Conn; CMFCButton m_MFCButton_EN_CMD; CMFCButton m_MFCButton_SCAN_COM; CMFCButton m_MFCButton_EXPORT_CONFIG; CMFCButton m_MFCButton_CLEAR_LOG; CMFCButton m_MFCButton_SEND_NID; CMFCButton m_MFCButton_SEND_ADDR; CMFCButton m_MFCButton_SEND_EN_ADDR; CMFCButton m_MFCButton_SEND_ENCYPT; CMFCButton m_MFCButton_SEND_RELAY; CMFCButton m_MFCButton_SEND_T_FREQ; CMFCButton m_MFCButton_SEND_R_FREQ; CMFCButton m_MFCButton_SEND_RF_POWER; CMFCButton m_MFCButton_SEND_RF_BW; CMFCButton m_MFCButton_SEND_LORA_FACTOR; CMFCButton m_MFCButton_SEND_LORA_FEC_RATE; CMFCButton m_MFCButton_SEND_COM_BAUDRATE; CMFCButton m_MFCButton_SEND_COM_FORMAT; CMFCButton m_MFCButton_SEND_DEFAULT; CMFCButton m_MFCButton_SEND_RESET; CMFCButton m_MFCButton_RAED; CMFCButton m_MFCButton_WRITE; afx_msg void OnBnClickedButtonConn(); afx_msg void OnBnClickedButtonEnCmd(); afx_msg void OnBnClickedButtonScanCom(); afx_msg void OnBnClickedButtonExportConfig(); afx_msg void OnBnClickedButtonSendNid(); afx_msg void OnBnClickedButtonSendAddr(); afx_msg void OnBnClickedButtonSendEnAddr(); afx_msg void OnBnClickedButtonSendEncypt(); afx_msg void OnBnClickedButtonSendRelay(); afx_msg void OnBnClickedButtonSendTFreq(); afx_msg void OnBnClickedButtonSendRFreq(); afx_msg void OnBnClickedButtonSendRfpower(); afx_msg void OnBnClickedButtonSendRfbw(); afx_msg void OnBnClickedButtonSendFactor(); afx_msg void OnBnClickedButtonSendFecRate(); afx_msg void OnBnClickedButtonSendComBaudrate(); afx_msg void OnBnClickedButtonSendComFormat(); afx_msg void OnBnClickedButtonSendDefault(); afx_msg void OnBnClickedButtonSendReset(); afx_msg void OnBnClickedButtonRead(); afx_msg void OnBnClickedButtonWrite(); afx_msg void OnBnClickedButtonClearLog(); afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData); CComboBox m_combo_com_sel; int UpdateComList(); typedef unsigned char uchar; typedef struct tagWLConfig { uint32_t RF_T_Freq; //Hz uint32_t RF_R_Freq; //Hz uint16_t nChnSpacing; //kHz uint16_t nCycleTime; // // uchar ModemType; // 0: FSK, 1: LoRa uchar workMode; // 0, None 1, Uni, 2 Thr, 3 Multi1, 4 Multi2, 5 MulMa uchar nChannel; uchar bMaster; uchar nRadioAddr; uchar bEnableMulti; uchar Tx_Power; // dBm 5 - 22 dBm uchar LoraBandWidth; // [0: 125 kHz, 1: 250 kHz, 2: 500 kHz, 3: Reserved ] uchar LoRaFactor; // [SF5 .. SF 12] uchar LoRaCodingRate; // [1 : 4/5, 2: 4/6, 3: 4/7, 4: 4/8 ] uint8_t NetWorkAddr; uint16_t DeviceAddr; uchar bEnableAddr; uchar bEnableEncrypt; uchar bEnableRelay; uchar LoRaPreambleLen; // 2 - 12 uchar bAutoPower; //自动功率 uchar bAutoReSend; //自动重发 // uchar ; // // uchar }stWLConfig, * pstWLConfig; stWLConfig myWLConfig; };