Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to validate/interact with a value before it gets put in AttributeTable #152

Closed
Erik1000 opened this issue Oct 30, 2024 · 7 comments

Comments

@Erik1000
Copy link

Erik1000 commented Oct 30, 2024

Currently, you can only passively monitor the GattEvent. This is problematic in the case of GattEvent::Write because there is no way you can validate or inspect the value of the write event before it gets put into the AttributeTable and can then be read again.
It would be nice to hook into the write event to validate the value and (in case of error) discard it.

related to #151

@Erik1000
Copy link
Author

Erik1000 commented Oct 30, 2024

I think in general it would be nice to be able to handle the actual values read and written better. For example, manually hook into reads and writes and controlling which value is sent or stored.
Perhaps something like GattServer::next without storing or reading.

@jamessizeland
Copy link
Collaborator

@petekubiak has been looking at some of this, we're talking about some kind of middleware layer with callbacks essentially right?

@Erik1000
Copy link
Author

Yes, something like that seems like a good idea

@petekubiak
Copy link
Collaborator

I think this links closely with #135 - a draft PR (#133) is open to suggest ideas for how this might be achieved.

@petekubiak
Copy link
Collaborator

#151 is now up for review - I would be interested to hear your thoughts on the approach

@petekubiak
Copy link
Collaborator

@Erik1000 are you happy for this issue to be closed?

@Erik1000
Copy link
Author

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants