Hello.

I am using the qextserialPort and I have some doubts about how programmer the send and the receive data.

I followed some thread in the forum but I couldnt find how programmer to receive and send data by the same port in the same local machine.

I think that the port have to be configured and opened only once is this correct? And if I configure the port in a program and then i want to wait data from another program to read it, can i do it with a simple while datas availables?

I did this but when a run both programs in the same PC is not working. I write the code because maybe you can understand me better seeing it.

This is the read function in the program that what to read datas, and the port it was configured and open it before this code:

QString ManejadorRS232::read()
{

char buff[1024];
int numBytes;
QString mensaje ;

numBytes = port->bytesAvailable();

while(numBytes<=0)
numBytes = port->bytesAvailable();
if(numBytes > 0)
{
if(numBytes > 1024) numBytes = 1024;

int i = port->read(buff, numBytes);
buff[i] = '\0';
mensaje = buff;


}
return mensaje;
}


This is the code to write in the other programm which is not configured and opened the port becuase is the same port( the COM1):

void ManejadorRS232::write(QString mensaje)
{
int i = port->write(mensaje.toAscii(),
mensaje.length());

}


Could someone help me?.

Thank you