B4X FEED messagearrived mqtt payload question about Hex array

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: messagearrived mqtt payload question about Hex array است. این موضوع تا کنون 36 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع messagearrived mqtt payload question about Hex array
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
36
پسندها
0
آخرین ارسال توسط PracticalSoft
Jun 6, 2020
11,559
4,422
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...



 

عقب
بالا