Closed
Description
When discovering services and characteristics for services, the service struct's characteristic array is updated as characteristics are discovered.
However, when reading a characteristic or descriptor value, the objects value member is not updated. The value is only returned from the function. It seems like the library should also update the value for characteristics and descriptors after reading them. This is of course assuming a non-error response from HCI.
I can make the updates and submit a PR if this change seems meaningful. The code I am referring to is:
linux/gatt/client.go
// ReadCharacteristic reads a characteristic value from a server. [Vol 3, Part G, 4.8.1]
func (p *Client) ReadCharacteristic(c *ble.Characteristic) ([]byte, error) {
p.Lock()
defer p.Unlock()
return p.ac.Read(c.ValueHandle)
}
// ReadDescriptor reads a characteristic descriptor from a server. [Vol 3, Part G, 4.12.1]
func (p *Client) ReadDescriptor(d *ble.Descriptor) ([]byte, error) {
p.Lock()
defer p.Unlock()
return p.ac.Read(d.Handle)
}
Metadata
Metadata
Assignees
Labels
No labels