Send signed byte array with Bleak #465
-
Is it possible to send a signed byte array with Bleak? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Can you give more details on the use case? Maybe use something like |
Beta Was this translation helpful? Give feedback.
-
Coming from Bluetooth development in Java, I sent bytearrays like this You can do So, I create an object with My question is, how can I send a signed bytearray with Bleak? |
Beta Was this translation helpful? Give feedback.
Coming from Bluetooth development in Java, I sent bytearrays like this
byte[] array = new byte[-90, 118, 92, 0, 0, -12
I need to this in Python too, and I came across the module array.
You can do
array = array('b, [-90, 118, 92, 0, 0, -12])
instead ofbytearray([-90, 118, 92, 0, 0, -12])
, because bytearray in Python can only contain 0-256.So, I create an object with
array = array('b, [-90, 118, 92, 0, 0, -12])
and try to doawait client_write_gatt_char(uuid_write, array)
.This returns an MarshallingError like this:
List, Tuple, Bytearray, or Dictionary required for Dbus array.
My question is, how can I send a signed bytearray with Bleak?