Skip to content
Snippets Groups Projects
Commit 3321199b authored by Andrea Orlati's avatar Andrea Orlati
Browse files

small fix of Medicina Vertex Library

parent d8ead43e
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@
LNAPort="10001"
VertexIPAddress="192.168.51.2"
VertexPort="2096"
VertexCommand="proc kkc\n"
VertexCommand="proc kkc"
WatchDogResponseTime="10000000"
WatchDogSleepTime="10000000"
LNASamplingTime="250000"
......
......@@ -19,7 +19,7 @@
LNAPort="10001"
VertexIPAddress="192.168.51.2"
VertexPort="2096"
VertexCommand="proc kkc\n"
VertexCommand="proc kkc"
WatchDogResponseTime="10000000"
WatchDogSleepTime="10000000"
LNASamplingTime="25000000"
......
......@@ -18,7 +18,7 @@ public:
virtual ~CMedicinaVertex();
inline IRA::CString getLastErrorMessage() const { return m_lastErrorMessage; }
bool sendTo(const void *buffer,int size);
bool sendTo(const IRA::CString& buffer,int size);
protected:
IRA::CString m_vertexAddr;
......
......@@ -9,12 +9,17 @@ CMedicinaVertex::~CMedicinaVertex()
{
}
bool CMedicinaVertex::sendTo(const void *buffer,int size)
bool CMedicinaVertex::sendTo(const IRA::CString& buffer,int size)
{
int count;
char readout[128];
IRA::CString sendBuffer;
int sendSize;
m_err.Reset();
try {
sendBuffer=buffer;
sendBuffer+=" \n";
sendSize=sendBuffer.GetLength();
if (m_sock.Create(m_err,IRA::CSocket::STREAM)!=IRA::CSocket::SUCCESS) {
m_lastErrorMessage.Format("Cannot create socket with error code %d",m_err.getErrorCode());
return false;
......@@ -23,7 +28,7 @@ bool CMedicinaVertex::sendTo(const void *buffer,int size)
m_lastErrorMessage.Format("Cannot connect with error code %d",m_err.getErrorCode());
return false;
}
if (m_sock.Send(m_err,buffer,size)!=(int)size) {
if (m_sock.Send(m_err,(const char *)sendBuffer,sendSize)!=(int)sendSize) {
m_lastErrorMessage.Format("Error code %d while sending data",m_err.getErrorCode());
return false;
}
......
......@@ -136,7 +136,7 @@ void MedicinaKBandDualFCore::setMode(const char * mode) throw (
setLO(lo);
if (m_medConfig.getVertexCommand()!="") {
int size=m_medConfig.getVertexCommand().GetLength();
if (!vertex.sendTo((const char *)m_medConfig.getVertexCommand(),size)) {
if (!vertex.sendTo(m_medConfig.getVertexCommand(),size)) {
ACS_LOG(LM_FULL_INFO,"MedicinaKBandDualFCore::setMode()",
(LM_ERROR,"Vertex Communication Error: %s",(const char *)vertex.getLastErrorMessage()));
CUSTOM_LOG(LM_FULL_INFO,"MedicinaKBandDualFCore::setMode()",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment