# HG changeset patch # User Jeandet Alexis # Date 2015-10-01 14:25:21 # Node ID 597f74f8955c79595e17782180baea8373b9fe6e # Parent 81feb673e028e6a30bc3950aa125a024ae7a99fc GRESB: RMAP Write working. diff --git a/spwplugin/GR-ESB/gr_esb_bridge.cpp b/spwplugin/GR-ESB/gr_esb_bridge.cpp --- a/spwplugin/GR-ESB/gr_esb_bridge.cpp +++ b/spwplugin/GR-ESB/gr_esb_bridge.cpp @@ -278,6 +278,9 @@ GR_ESB_Manager::GR_ESB_Manager(socexplor { this->Read_soc = new QTcpSocket(this); this->Write_soc = new QTcpSocket(this); + this->sourceLogicalAddress=32; + this->destinationLogicalAddress=254; + this->destinationKey=2; } GR_ESB_Manager::~GR_ESB_Manager() @@ -351,12 +354,12 @@ bool GR_ESB_Manager::connectBridge() int timeout=60; if(this->Read_soc->state()==QTcpSocket::UnconnectedState) { - this->Read_soc->connectToHost(IP,gresb_Conf[virtualLinkIndex].Read_port); + this->Read_soc->connectToHost(IP,gresb_Conf[virtualLinkIndex].Write_port); this->Read_soc->waitForConnected(30000); } if(this->Write_soc->state()==QTcpSocket::UnconnectedState) { - this->Write_soc->connectToHost(IP,gresb_Conf[virtualLinkIndex].Write_port); + this->Write_soc->connectToHost(IP,gresb_Conf[virtualLinkIndex].Read_port); this->Write_soc->waitForConnected(30000); } while((this->Read_soc->state()!=QTcpSocket::ConnectedState) && (this->Write_soc->state()!=QTcpSocket::ConnectedState)) @@ -405,9 +408,9 @@ bool GR_ESB_Manager::sendPacket(char *pa { SPWpacket[0]=0; //Protocol = spw memcpy(SPWpacket+4,packet,size); - SPWpacket[1]=size & 0x0FF; + SPWpacket[1]=(size>>16) & 0x0FF; SPWpacket[2]=(size>>8) & 0x0FF; - SPWpacket[3]=(size>>16) & 0x0FF; + SPWpacket[3]=size & 0x0FF; } this->handleMutex->lock(); result = ((size+4) == this->Write_soc->write(SPWpacket,size+4)); diff --git a/spwplugin/GR-ESB/gr_esb_bridge.h b/spwplugin/GR-ESB/gr_esb_bridge.h --- a/spwplugin/GR-ESB/gr_esb_bridge.h +++ b/spwplugin/GR-ESB/gr_esb_bridge.h @@ -8,8 +8,8 @@ struct gresb_Conf_str { - qint32 Read_port; - qint32 Write_port; + qint32 Transmit_port; + qint32 Receive_port; };