c++ - Qt: receive serial port data as unsigned char -
c++ - Qt: receive serial port data as unsigned char -
with main app i'm sending bytes , i'm sending them unsigned chars (0x80 , above). created 1 little supporting app receives these data, writes them terminal , sends them confirmation of successful transfer. code in back upwards app:
switch(c) // c beingness byte received qbytearray { case 0xff: cout << "header 1" << endl; break; case -1: cout << "0xff = 255 = -1" << endl; break; } //other case statements , default omitted
if send 0xff through serial port, "0xff = 255 = -1" on cout. understand number represented 1111 1111 (and in fact 255 equals -1 in case) post here on sof. how supposed receive code "header 1" on terminal?
c++ qt qtserialport
Comments
Post a Comment