Hi,
maybe this is a really stupid question and in that case I apologize in advance...
I am trying to receive on B4J mqtt client an HEX array payload. the issue (which I am sure has been already discussed but I did not find a clear answer) is that the method
Sub mqtt_MessageArrived (Topic As String, Payload() As Byte)
has the Payload() input parameter as Byte (signed byte -127 -> 128) so if the HEX number I get is below 128 then I get it right in the function payload : for example if I publish from another client (in this case I am using MqttBox) the Hex number 0x7F (127), the payload() array contains one element and its value is 127 (0x7F).
If from the test client I publish an hex number higher than 127 I get two elements in the array..For example with 0x80 published (128 decimal) the payload byte I get in the messagearrived function is a two elements array with element 0 equal to 0xFFFFFFC2 and element 1 equale to 0xFFFFFF80
Is there a way to get an unsigned bytes array ?
thanks
maybe this is a really stupid question and in that case I apologize in advance...
I am trying to receive on B4J mqtt client an HEX array payload. the issue (which I am sure has been already discussed but I did not find a clear answer) is that the method
Sub mqtt_MessageArrived (Topic As String, Payload() As Byte)
has the Payload() input parameter as Byte (signed byte -127 -> 128) so if the HEX number I get is below 128 then I get it right in the function payload : for example if I publish from another client (in this case I am using MqttBox) the Hex number 0x7F (127), the payload() array contains one element and its value is 127 (0x7F).
If from the test client I publish an hex number higher than 127 I get two elements in the array..For example with 0x80 published (128 decimal) the payload byte I get in the messagearrived function is a two elements array with element 0 equal to 0xFFFFFFC2 and element 1 equale to 0xFFFFFF80
Is there a way to get an unsigned bytes array ?
thanks