Hi,

I'm trying to send a message through a TCP socket. The message contains numbers:

Qt Code:
  1. char* pacDades = new char[50];
  2. int iLong = 25;
  3. pacData[0] = (char)iLong;
  4. pacData[1] = '$';
  5. pacData[2] = '0';
  6. pacData[3] = '$';
  7. quint16 qNum = 150;
  8. quint8 qNumFotosMSB = (qNum >> 8);
  9. qNumMSB += 48;
  10. quint8 qNumFotosLSB = qNum;
  11. qNumLSB += 48;
  12. pacData[4] = (char)qNumMSB;
  13. pacData[5] = (char)qNumLSB;
  14.  
  15. qint64 qNumBytes = m_qSocket.write(pacData,qLong);
To copy to clipboard, switch view to plain text mode 

When I recive the data,
Qt Code:
  1. qNumImatgesLSB = qTextos.at(1).at(1).toAscii();
To copy to clipboard, switch view to plain text mode 

"qNumImatgesLSB" is -58 instead of 150.

What I'm doing wrong?

Thanks,