Answer the question
In order to leave comments, you need to log in
How to assemble a byte array correctly?
There was a task to form an array, I have 3 values \u200b\u200bthat need to be sent in one package via BLE. The first value is a letter and the two values are -100 .. 100. The letter is fine, but the numbers are wrong. Previously, the numbers were sent in the following way
// left and right values int -100 .. 100
value[0] = (byte) Left;
value[1] = (byte) Right;
// then value is sent over BLE
byte[] value = new byte[3];
value[0] = (byte) 'C';
value[1] = (byte) Left;
value[2] = (byte) Right;
// then value is sent over BLE
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question