Binary operation
-
Hi everyone,
I am facing the following issue:
I am succesfully reading raw bytes from a Qserialport but cannot find how
to manipulate these bytes on a binary basis.I tried several format from QBytearray to QDatastream but can never apply a
binary operator (NOT,OR,AND) to the bytes received.Thks in advance for your coop,
Jean-Pierre
-
Hi everyone,
I am facing the following issue:
I am succesfully reading raw bytes from a Qserialport but cannot find how
to manipulate these bytes on a binary basis.I tried several format from QBytearray to QDatastream but can never apply a
binary operator (NOT,OR,AND) to the bytes received.Thks in advance for your coop,
Jean-Pierre
-
Hi everyone,
I am facing the following issue:
I am succesfully reading raw bytes from a Qserialport but cannot find how
to manipulate these bytes on a binary basis.I tried several format from QBytearray to QDatastream but can never apply a
binary operator (NOT,OR,AND) to the bytes received.Thks in advance for your coop,
Jean-Pierre
-
-
since qint8 is typedef for signed char, do you mean
qint8 andVal = value & 0x000111; qint8 orVal = value | 0x10101010; qint8 notVal = ~value;
http://en.cppreference.com/w/cpp/language/operator_arithmetic
-
since qint8 is typedef for signed char, do you mean
qint8 andVal = value & 0x000111; qint8 orVal = value | 0x10101010; qint8 notVal = ~value;
http://en.cppreference.com/w/cpp/language/operator_arithmetic
-