S Steve-h Member Feb 10, 2022 #1 I am receiving data sent as a notification but it is not what I am expecting. I am sending a number between 0x0000 and 0xFFFF. What I extract from the data received map for each event is for example [B@2ed290e2 or [B@22a48fa9 or [B@2b8accf If I look at the data with nRF Connect I see the value I am expecting. Is this perhaps because of the format it is presented in, do I need to convert it from something into hex ?
I am receiving data sent as a notification but it is not what I am expecting. I am sending a number between 0x0000 and 0xFFFF. What I extract from the data received map for each event is for example [B@2ed290e2 or [B@22a48fa9 or [B@2b8accf If I look at the data with nRF Connect I see the value I am expecting. Is this perhaps because of the format it is presented in, do I need to convert it from something into hex ?
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2022 #2 This is the default string representation of bytes arrays. Use ByteConverter library to convert the arrays to hex strings: Code: Copy Dim b() As Byte = Data.Get(...) Dim bc As ByteConverter Log(bc.HexFromBytes(b)) Upvote 0
This is the default string representation of bytes arrays. Use ByteConverter library to convert the arrays to hex strings: Code: Copy Dim b() As Byte = Data.Get(...) Dim bc As ByteConverter Log(bc.HexFromBytes(b))
S Steve-h Member Feb 10, 2022 #3 Thank you for that. I guess it was obvious to some but not to me. After some weeks puzzling over this I now see the numbers I was expecting and have two way communication. Upvote 0
Thank you for that. I guess it was obvious to some but not to me. After some weeks puzzling over this I now see the numbers I was expecting and have two way communication.