Skip to content

[BLE] Update parameters passed to onDataSent, onUpdatesEnabled/Disabled, and onConfirmationReceived callbacks #13727

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

Closed
wants to merge 6 commits into from

Conversation

AGlass0fMilk
Copy link
Member

@AGlass0fMilk AGlass0fMilk commented Oct 6, 2020

Summary of changes

Update parameters passed to onDataSent, onUpdatesEnabled/Disabled, and onConfirmationReceived callbacks.

Each of these callbacks are now given the related connection ID and attribute handle.

Individual callback-registering functions in the GattServer API are deprecated by this PR.

Resolves #13726

Impact of changes

Any use of GattServer::onDataSent, GattServer::onUpdatesEnabled, GattServer::onUpdatesDisabled, GattServer::onConfirmationReceived is now deprecated and will be removed in a future release.

Migration actions required

Update applications calling the deprecated functions to use the new GattServer::EventHandler API.

Documentation

None


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@pan- @paul-szczepanek-arm


@AGlass0fMilk AGlass0fMilk changed the title Update parameters passed to onDataSent, onUpdatesEnabled/Disabled, and onConfirmationReceived callbacks [BLE] Update parameters passed to onDataSent, onUpdatesEnabled/Disabled, and onConfirmationReceived callbacks Oct 6, 2020
@ciarmcom ciarmcom requested review from pan-, paul-szczepanek-arm and a team October 6, 2020 21:00
@ciarmcom
Copy link
Member

ciarmcom commented Oct 6, 2020

@AGlass0fMilk, thank you for your changes.
@paul-szczepanek-arm @pan- @ARMmbed/mbed-os-maintainers please review.

pan-
pan- previously requested changes Oct 7, 2020
Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not in favor of doing a breaking change right now.
To move this PR forward can you add callbacks into the EventHandler class and mark the onXXX as deprecated ?

@mergify mergify bot dismissed pan-’s stale review October 7, 2020 21:15

Pull request has been modified.

@AGlass0fMilk
Copy link
Member Author

@pan- I have implemented changes to deprecate the individual callback-registering functions in GattServer and have introduced new ones with more flexible parameters in the GattServer::EventHandler API.

pan-
pan- previously requested changes Oct 9, 2020
Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AGlass0fMilk Thank you for the PR. It all looks good except for one thing. Can you use const references instead of const pointers for callback parameters in EventHandler ?
I would prefer to remain consistent with what has been done in Gap::EventHandler

@AGlass0fMilk
Copy link
Member Author

@AGlass0fMilk Thank you for the PR. It all looks good except for one thing. Can you use const references instead of const pointers for callback parameters in EventHandler ?
I would prefer to remain consistent with what has been done in Gap::EventHandler

See 862669c

@mergify mergify bot dismissed pan-’s stale review October 9, 2020 15:21

Pull request has been modified.

.connHandle = connHandle,
.attHandle = attributeHandle
});
eventHandler->onUpdatesEnabled(&params);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to update the call site too. Passing pointers won't work.

@AGlass0fMilk
Copy link
Member Author

Merging this with #13734 since they are closely tied.

@mergify mergify bot removed the needs: work label Oct 9, 2020
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

Successfully merging this pull request may close these issues.

BLE: Data sent event parameter is useless information
3 participants