-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Darwin] Adding more metrics to capture BLE during setup #32793
[Darwin] Adding more metrics to capture BLE during setup #32793
Conversation
anush-apple
commented
Mar 29, 2024
- Added more metrics across BLE phase in Darwin
- Fixed MetricsCollector to only capture first event of any kind
- Reset metrics before any API is started
- Fixed bug where duration was not being calculated correctly
- Added more metrics across BLE phase in Darwin - Fixed MetricsCollector to only capture first event of any kind - Reset metrics before any API is started - Fixed bug where duration was not being calculated correctly
PR #32793: Size comparison from 6ed5dd3 to 494a72f Decreases (1 build for efr32)
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
// Since OnPairingComplete(failure_code) might not be invoked in all cases, use this opportunity to inform of failed commissioning | ||
// and default the error to timeout since that is best guess in this layer. | ||
if (status == chip::Controller::DevicePairingDelegate::Status::SecurePairingFailed && [strongDelegate respondsToSelector:@selector(controller:commissioningComplete:nodeID:metrics:)]) { | ||
OnCommissioningComplete(mDeviceNodeId, CHIP_ERROR_TIMEOUT); |
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.
This needs to be documented clearly in the APIs. Given what the documentation says right now, API consumers will absolutely not expect a commissioningComplete callback here.
// Since OnPairingComplete(failure_code) might not be invoked in all cases, use this opportunity to inform of failed commissioning | ||
// and default the error to timeout since that is best guess in this layer. | ||
if (status == chip::Controller::DevicePairingDelegate::Status::SecurePairingFailed && [strongDelegate respondsToSelector:@selector(controller:commissioningComplete:nodeID:metrics:)]) { | ||
OnCommissioningComplete(mDeviceNodeId, CHIP_ERROR_TIMEOUT); |
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.
But if the API consumer tries to set up a new PASE session while the old setup is in progress, what happens? That will clobber mDeviceNodeId
, right? Because we set it before we try to do the new PASE setup, which I think will fail out sync in that case...
This really needs an actual sound model for how this stuff works, so we don't get stuck with behavior clients expect that is broken and we can't change.
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.
Yup, but I am not sure how to fix this without changing the C++ layer. Ideally, if the callbacks can be fixed to pass on the NodeId, it will eliminate this issue
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.
Well, one option is to set this only if we successfully kick off an async pairing operation, right? As in, don't set this until the call into the C++ returns success.
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.
But in that case, the callback above won't be invoked and clobbering the NodeId for the latest one should be fine. Right?
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.
So the situation is:
- Start PASE with node id 1.
- Try to start PASE with node id 2, that fails to start (because the core SDK can only do one thing at a time for now), but sets mDeviceNodeId to 2.
- Now PASE to node id 1 fails, reports OnCommissioningComplete for node id 2.
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.
Ah I see, I can fix it in next iteration