weliem / blessed-bluez

BLE library using Java and Bluez
MIT License
82 stars 25 forks source link

Send Write Command is impossible #8

Closed kotrs closed 3 years ago

kotrs commented 3 years ago

I try to send command with writeCharacteristic method with without_response parameter. But the slave device receive Write Request instead of Write Command.

weliem commented 3 years ago

That's odd, because this is the relevant code:

 options.put("type", writeType == WriteType.WITH_RESPONSE ? "request" : "command");
 nativeCharacteristic.writeValue(bytesToWrite, options);

What version of Bluez are you using and what hardware?

kotrs commented 3 years ago

Bluez version 5.50 on Armbian Debian Buster HW Banana Pi M2 Zero I don't know if this is the problem. Because, I need to get data from smart watch. Mobile phone app sends Write Command always. But when I send Write Request from Linux device it works for configuration changes (theme, wear hand, measure interval and so on) but not for gain data. It is strange. The problem is elsewhere maybe.

weliem commented 3 years ago

No idea what the problem could be. Perhaps the driver of the M2 Zero?

Any luck fixing this issue?

kotrs commented 3 years ago

Yes, I fixed it. Bluez version 5.50 does not support WriteType parameter. I think that version 5.51 supports it...I use 5.53 and it works.

weliem commented 3 years ago

Ah great to hear it is solved!