##// END OF EJS Templates
GRESB: RMAP Write working.
Jeandet Alexis -
r72:597f74f8955c GRESB
parent child
Show More
@@ -278,6 +278,9 GR_ESB_Manager::GR_ESB_Manager(socexplor
278 {
278 {
279 this->Read_soc = new QTcpSocket(this);
279 this->Read_soc = new QTcpSocket(this);
280 this->Write_soc = new QTcpSocket(this);
280 this->Write_soc = new QTcpSocket(this);
281 this->sourceLogicalAddress=32;
282 this->destinationLogicalAddress=254;
283 this->destinationKey=2;
281 }
284 }
282
285
283 GR_ESB_Manager::~GR_ESB_Manager()
286 GR_ESB_Manager::~GR_ESB_Manager()
@@ -351,12 +354,12 bool GR_ESB_Manager::connectBridge()
351 int timeout=60;
354 int timeout=60;
352 if(this->Read_soc->state()==QTcpSocket::UnconnectedState)
355 if(this->Read_soc->state()==QTcpSocket::UnconnectedState)
353 {
356 {
354 this->Read_soc->connectToHost(IP,gresb_Conf[virtualLinkIndex].Read_port);
357 this->Read_soc->connectToHost(IP,gresb_Conf[virtualLinkIndex].Write_port);
355 this->Read_soc->waitForConnected(30000);
358 this->Read_soc->waitForConnected(30000);
356 }
359 }
357 if(this->Write_soc->state()==QTcpSocket::UnconnectedState)
360 if(this->Write_soc->state()==QTcpSocket::UnconnectedState)
358 {
361 {
359 this->Write_soc->connectToHost(IP,gresb_Conf[virtualLinkIndex].Write_port);
362 this->Write_soc->connectToHost(IP,gresb_Conf[virtualLinkIndex].Read_port);
360 this->Write_soc->waitForConnected(30000);
363 this->Write_soc->waitForConnected(30000);
361 }
364 }
362 while((this->Read_soc->state()!=QTcpSocket::ConnectedState) && (this->Write_soc->state()!=QTcpSocket::ConnectedState))
365 while((this->Read_soc->state()!=QTcpSocket::ConnectedState) && (this->Write_soc->state()!=QTcpSocket::ConnectedState))
@@ -405,9 +408,9 bool GR_ESB_Manager::sendPacket(char *pa
405 {
408 {
406 SPWpacket[0]=0; //Protocol = spw
409 SPWpacket[0]=0; //Protocol = spw
407 memcpy(SPWpacket+4,packet,size);
410 memcpy(SPWpacket+4,packet,size);
408 SPWpacket[1]=size & 0x0FF;
411 SPWpacket[1]=(size>>16) & 0x0FF;
409 SPWpacket[2]=(size>>8) & 0x0FF;
412 SPWpacket[2]=(size>>8) & 0x0FF;
410 SPWpacket[3]=(size>>16) & 0x0FF;
413 SPWpacket[3]=size & 0x0FF;
411 }
414 }
412 this->handleMutex->lock();
415 this->handleMutex->lock();
413 result = ((size+4) == this->Write_soc->write(SPWpacket,size+4));
416 result = ((size+4) == this->Write_soc->write(SPWpacket,size+4));
@@ -8,8 +8,8
8
8
9 struct gresb_Conf_str
9 struct gresb_Conf_str
10 {
10 {
11 qint32 Read_port;
11 qint32 Transmit_port;
12 qint32 Write_port;
12 qint32 Receive_port;
13 };
13 };
14
14
15
15
General Comments 0
You need to be logged in to leave comments. Login now