I am just discovering rxandroidble and can reliably send a single command to the BLE device after connection
However I am struggling to find the best way to write a chain of commands, ie if I have a series of 3 commands that need to be sent
Of course this can be done by nesting the sends, but Im sure there is a better approach!!
Single command send code is
rxBleMainConection.writeCharacteristic(COMS_WRITE_CHAR_UUID,bytes).toObservable()
.subscribe(
characteristicValue -> {
// Written characteristic value.
Log.d(TAG,"Written command: " + Arrays.toString(characteristicValue));
},
throwable -> {
// Handle an error here.
Log.d(TAG,"Error writing command");
throwable.printStackTrace();
}
);
What is the best way to send a series of say 5 commands?