-
Notifications
You must be signed in to change notification settings - Fork 170
Description
Hey, thanks for this library!
Currently WriteWithoutResponse
for Bluez doesn't specify a type
when writing:
Lines 224 to 230 in 5c61529
func (c DeviceCharacteristic) WriteWithoutResponse(p []byte) (n int, err error) { | |
err = c.characteristic.Call("org.bluez.GattCharacteristic1.WriteValue", 0, p, map[string]dbus.Variant(nil)).Err | |
if err != nil { | |
return 0, err | |
} | |
return len(p), nil | |
} |
In Bluez, the type of write is set at this call: https://github.com/bluez/bluez/blob/c6dcf6b714501768ab7ea293e75d945be0eec188/doc/org.bluez.GattCharacteristic.rst#L97-L111
If it is unset, Bluez seems to chose one based on the properties of the characteristic: https://github.com/bluez/bluez/blob/c6dcf6b714501768ab7ea293e75d945be0eec188/src/gatt-client.c#L1066-L1113
I might be missing something, but it seems like the function is currently more like a WriteAuto
which picks the first fitting type.
As for how to resolve it, I'm not sure. This logic is actually quite useful, but it should probably live under a different name, and explicit command/request functions could be added/fixed as needed.