Qt Code:
  1. void rs485::rs485DataAquisition(QByteArray data) //0-SubSystem---------1-Pid--------2-Value
  2. {
  3. QByteArray receivedData;
  4. unsigned char address;
  5.  
  6. qDebug() << "rs485DataAquisition()" << data.toHex();
  7.  
  8. if(data.toHex() < "0x06")
  9.  
  10. if( data.toHex() < _ENGINEROOM_SUBS )
  11. {//Engine Compartment Elements
  12.  
  13. qDebug() << "Engine Compartment Elements";
  14.  
  15. if(data.size() == 1)
  16. {
  17. qDebug() << "Reading request..";
  18.  
  19. if(rs485WriteData(_READ_ENGINEADDRESS, data.toHex())) // I get the error here, the second parameter of this function is unsigned char
  20. {
  21. rs485Delay();
  22.  
  23. qDebug() << "NOW -> rs485CheckAck()";
To copy to clipboard, switch view to plain text mode