I want to send an integer data to the RN4871 microchip with bluetooth low energy, whenever I want to send an integer data, I read the ASCII response. Is there a way to send an Integer data? For example, I want to send the number 59, I read it as 0x3B, I want to read the integer value 59 that I sent directly, is this possible?
Asked
Active
Viewed 244 times
1 Answers
1
Using a Hex to Decimal Converter you can see that the hexadecimal value 0x3B
actually is the decimal value of 59. This means that the value gets transmitted correctly and you just need to print it in the right format on the receiving side.

Michael Kotzjan
- 2,093
- 2
- 14
- 23
-
thanks for your answer but 0x3B on the receiving side does not make any sense, the receiving side wants to see the number 59 I wrote directly so that it can continue with the transaction with this number. – orcunor Jun 28 '21 at 06:42
-
I understand you, but 0x3B is 59, just the representation of the value is different. I assume you print the received value to see 0x3B? – Michael Kotzjan Jun 28 '21 at 06:49
-
I made an application. I want to send the integer values entered in the textbox as they are. If 59 is entered, I want the recipient to see it as 59, not as 0x3B. 0x3B doesn't work for them. They want to get it as 59. – orcunor Jun 28 '21 at 07:26
-
They do not want to convert the data on the receiving side. They want to see it as 1 if 1 is entered and 5 if 5 is entered. They want to type a 16 digit number into the textbox like this: 1203211051274321 and they want it to come like this, not translated in the ASCII table – orcunor Jun 28 '21 at 07:28
-
`0x3B == 59`, no conversation required. It's just the representation you see when printing the number. The byte value is the same! When using BLE in android for example, all values are represented as Hex values. – Michael Kotzjan Jun 28 '21 at 07:31
-
Yes, I know, but what the customer wants is to enter an integer number and they want to see an integer number. If 1 is entered, they want to see 1, if 5 is entered, they want to see 5, and they will perform an operation based on this integer value. 0x3B does not work for them, for example, they want to send 21, but the equivalent of 21 in the table is 'NAK'. Well, they don't want that, they want to see 21. – orcunor Jun 28 '21 at 07:44
-
It is not possible to send an Integer value via BLE. All BLE data will be sent as bytes. Even if you send a string it will be send as bytes. The receiver has to do the correct operation with the received data. If your customer is not willing to do this I have no other answer for you, I'm sorry. Maybe someone else has a better solution for you – Michael Kotzjan Jun 28 '21 at 07:50