-
Notifications
You must be signed in to change notification settings - Fork 83
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
Provide additional details to data processor #538
Conversation
data: ByteArray, | ||
serviceUuid: Uuid?, | ||
characteristicUuid: Uuid?, | ||
descriptorUuid: Uuid?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is likely to get more fields added in the future, would be nice to wrap these up in a class
of some sort. Would still be breaking now, but would make it non-breaking to add fields in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admittedly I'm taking a "move fast and break things" mindset with this, partly because it feels warranted while pre-1.x — but mostly because I want to eventually ditch the data processor entirely in favor of #539. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added @ObsoleteKableApi
to help warn consumers that this API will likely experience churn.
Logging.DataProcessor
now has 4 additional parameters:operation: Operation?
(either:Write
,Read
orChange
)service: Uuid?
characteristic: Uuid?
descriptor: Uuid?
These appear after the existing
data: ByteArray
parameter:This allows library consumers to change their data processing behavior based on the characteristic or descriptor that the
data
was associated with.For library consumers that don't need the new parameters, they'll need to update their custom data processors as follows:
Closes #532
Unit tests were added because the logging message builder had to go through an overhaul to add this support, so the unit tests provided some confidence that the output remained as expected.