Closed dwmoffatt closed 3 years ago
The write_characteristic
function should do this: https://able.readthedocs.io/en/latest/#able.BluetoothDispatcher.write_characteristic
that function calls this https://github.com/b3b/able/blob/b75a5a9c435799aaa2aa467676097860fbdc2ffb/able/utils.py#L4 which returns nothing as it doesn't convert the python String
force_convertible_to_java_array
converts string to list:
>>> from able.utils import force_convertible_to_java_array
>>> force_convertible_to_java_array('test string')
['t', 'e', 's', 't', ' ', 's', 't', 'r', 'i', 'n', 'g']
Let me re-try it then. Last time I did it, it wasn't working.
Yes, it wasn't working. Array of strings is not suitable for jnius.convert_pyarray_to_java
.
Fixed, now it is possible to use write_characteristic
with a string data.
Sweet! I will update and try it out.
In java you can send string data via the write characteristic, in able you are unable to via the write characteristic.
Had to write my own function to do it.