Hi Guys,
I've been playing with B4A, ESP32, using Mongoose OS and BLE.
According to Mongoose OS I need to write the length of the packet that I want to transmit into a specific characteristic. The length should be a 32bit integer. I am not sure how to format the length correctly. I've attached Java code that I know works. Can someone tell me how to format it in B4A?
byte b[] = {0x00, 0x00, 0x00, ((byte) Length)};
length_tx_Characteristic.setValue(b);
// Write the length characteristic
mBluetoothLEService.writeCharacteristic(length_tx_Characteristic);
I guess that I will be using the following basic code to send it:
manager.WriteData("5f6d4f53-5f52-5043-5f53-56435f49445f", "5f6d4f53-5f52-5043-5f74-785f63746c5f", <4 bytes length>)
I've been playing with B4A, ESP32, using Mongoose OS and BLE.
According to Mongoose OS I need to write the length of the packet that I want to transmit into a specific characteristic. The length should be a 32bit integer. I am not sure how to format the length correctly. I've attached Java code that I know works. Can someone tell me how to format it in B4A?
byte b[] = {0x00, 0x00, 0x00, ((byte) Length)};
length_tx_Characteristic.setValue(b);
// Write the length characteristic
mBluetoothLEService.writeCharacteristic(length_tx_Characteristic);
I guess that I will be using the following basic code to send it:
manager.WriteData("5f6d4f53-5f52-5043-5f53-56435f49445f", "5f6d4f53-5f52-5043-5f74-785f63746c5f", <4 bytes length>)