Skip to content

Provide mechanism to define characteristic read callback #337

Open
@kortschak

Description

@kortschak

Currently, reads do not give any opportunity to allow event-driven behaviour. This is worked around in the examples by periodically writing to the value data in the characteristic, but this is a brittle approach when the application is more than very simple, and introduces the possibility of data and logic races.

To address this, there should be a read call-back mechanism that allows application logic to be run prior to sending bytes over the air. An example of how to do this for HCI is here. It should be relatively straightforward to inject a callback path in the Windows code, and from a relatively shallow look into BlueZ, there appears to be a way to inject this into the Linux code as well, though my understanding of D-Bus Bluetooth is weak (I have seen examples of this kind of thing in the python BlueZ stack).

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