8000 Reading a characteristic or descriptor value returns the value but does not update the object · Issue #12 · go-ble/ble · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Reading a characteristic or descriptor value returns the value but does not update the object #12
Closed
@estutzenberger

Description

@estutzenberger

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0