-
Notifications
You must be signed in to change notification settings - Fork 37
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
Capturing the correct nodeId #125
Comments
Turns out this is easy to fix. Return the DeviceID from awaitCommissionDevice()
then in AppCommissioningService
When using the default certificate generator, this will return the same deviceId passed in. But if it is cloud generated, it will ignore the one passed in and return the cloud one. |
This is a FabricManagement issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First a little background.... GSAFM is establishing a PASE session using the deviceId. That works and it is convenient, but note that this ID (in the CHIP code this is remodeNodeID, not deviceId) can be anything you want it to be, it does not determine the deviceId. To make this more obvious you might want to use two different numbers, one for remodeNodeID and a different on for deviceId.
Another item to note is the deviceId is encoded into the NOC certificate and that is the source of truth for the deviceID.
GSAFM commissions the device using the default internally generated certificates. When you are using those, GSAFM is in control of the deviceId. It picks a deviceId and sends it into awaitCommissionDevice(). The default certificate code will generate a certificate containing that deviceId, and happily send it off to the device. And everything will work.
At the end of the commission process onCommissioningComplete() gets called reporting the nodeId (deviceId) and it then discards it. This works because GSAFM knows what deviceId it put into the certificate.
then it exit out of awaitCommissionDevice() and ends up here using the DeviceID stored in a local variable.
This is all good and works with default certificate generation.
But what if you aren't using default certificate generation and instead generate them in the cloud? In that case the DeviceID GSAFM generates and sends into awaitCommissionDevice() simply gets ignored. onCommissioningComplete() then gets called with the cloud assigned DeviceID.
So the problem I'm trying to solve is, how do I get this information out of onCommissioningComplete() and back up into the control flow in onCommissioningRequested().
I would be very useful if GSAFM were adjusted to pick up the DeviceId from onCommissioningComplete() and not carry it through onCommissioningRequested() in a local variable. Retrieving it from onCommissioningComplete() works for both the default certificates and cloud generated ones.
The text was updated successfully, but these errors were encountered: