Reading Bytes in Python from Bluetooth, encode problem

Viewed 143

I'm trying to get some values from bluetooth in Python, my problem basically is when I tried to read the data from bluetooth, in this two lines:

value = bytes(await connection.client.read_gatt_char(read_characteristic))
print(value)

it prints: b'\x91'

I tried to use: valueprint = str(value).encode()

But just printed me this: "b'\x91'"

Then I tried print("Value: {0}%".format(int(value[0])))

But it gave me 145 which is not the value that I sent, I put a value 657 to run some test.

0 Answers
Related