增加了通信协议解析的功能
This commit is contained in:
@@ -181,6 +181,7 @@ bool PowerManger::ListenLoopCCU()
|
||||
{
|
||||
unsigned char Buff[MAX_UDP_PKT_SIZE];
|
||||
cout << "------------------" << endl;
|
||||
cout << "SIZEOF" << sizeof(msg_CcuStateFbMsg) << endl;
|
||||
while(!m_ListenThread.IsQuitRequested())
|
||||
{
|
||||
int nRead = m_pCcuUdpComm->iRecieveMessage(Buff,sizeof(Buff));
|
||||
@@ -201,16 +202,17 @@ bool PowerManger::ListenLoopCCU()
|
||||
//处理消息
|
||||
switch (id)
|
||||
{
|
||||
case 0x0051: //CCU_STATE_FB 0x0051
|
||||
case CCU_STATE_FB_ID: //CCU_STATE_FB 0x0051
|
||||
msg_CcuStateFbMsg s;
|
||||
if(m_udpComm.getCcuState((char *)Buff,s))
|
||||
{
|
||||
cout << "------------------" << endl;
|
||||
cout << "id:" << s.header.id << endl;
|
||||
// cout << "id:" << s.header.id << endl;
|
||||
cout << "currentWorkCondition:" << (double)s.currentWorkCondition << endl;
|
||||
cout << "fcuState:" << s.fcuState << endl;
|
||||
cout << "fcuFaultLeve:" << s.fcuFaultLeve << endl;
|
||||
cout << "powerLimit:" << s.powerLimit << endl;
|
||||
cout << "fcuState:" << (double)s.fcuState << endl;
|
||||
cout << "fcuFaultLeve:" << (double)s.fcuFaultLeve << endl;
|
||||
cout << "powerLimit:" << (double)s.powerLimit << endl;
|
||||
cout << "checkCode:" << (double)s.checkCode << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -219,7 +221,7 @@ bool PowerManger::ListenLoopCCU()
|
||||
m_udpComm.sError.clear();
|
||||
}
|
||||
break;
|
||||
case 0x0040: //CCU_SET_PARM_FB 0x0040
|
||||
case CCU_SET_PARM_FB_ID: //CCU_SET_PARM_FB 0x0040
|
||||
msg_CcuSetParmFbMsg p;
|
||||
if(m_udpComm.getCcuSetParmFb((char *)Buff,p))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user