增加了UDP通信和部分复合管控交互消息定义

This commit is contained in:
zjk
2024-10-24 18:15:56 +08:00
parent dfd13848ef
commit e2bfa98754
6 changed files with 306 additions and 11 deletions
+19 -6
View File
@@ -2,7 +2,7 @@
* @Author: zhaojingkui 1553836110@qq.com
* @Date: 2024-10-22 16:47:01
* @LastEditors: zhaojingkui 1553836110@qq.com
* @LastEditTime: 2024-10-22 17:14:48
* @LastEditTime: 2024-10-22 18:03:29
* @FilePath: /H100PowerManger/src/pPowerManger/PowerManger.h
* @Description:
*
@@ -17,32 +17,45 @@
#ifndef PowerManger_HEADER
#define PowerManger_HEADER
#define UNIX
#include "MOOS/libMOOS/Thirdparty/AppCasting/AppCastingMOOSApp.h"
#include "MOOS/libMOOS/Utils/MOOSThread.h"
#include "MOOS/libMOOS/Comms/XPCUdpSocket.h"
#include "ccuUdpMsg.h"
#define IPORT 5000
#define MAX_UDP_PKT_SIZE 65535
class PowerManger : public AppCastingMOOSApp
{
public:
PowerManger();
~PowerManger();
public:
bool ListenLoopCCU();
protected: // Standard MOOSApp functions to overload
bool OnNewMail(MOOSMSG_LIST &NewMail);
bool Iterate();
bool OnConnectToServer();
bool OnStartUp();
protected: // Standard AppCastingMOOSApp function to overload
bool buildReport();
protected:
void registerVariables();
protected: // app function
// bool _ListenCB();
XPCUdpSocket* setUdpScoket(long lPort);
protected: // app variables
long m_lPort;
unsigned int m_nReceiveBufferSizeKB;
unsigned int m_nSendBufferSizeKB;
XPCUdpSocket *m_pCcuUdpComm;
private: // Configuration variables
CMOOSThread m_ListenThread;
CMOOSThread m_SendThread;
// CMOOSThread m_SendThread;
private: // State variables
};