Skip to content

Apply missing node features after receiving composition data#539

Merged
philips77 merged 1 commit intonordicsemi:mainfrom
kkellermann:improvement/apply-missing-node-features
Oct 10, 2023
Merged

Apply missing node features after receiving composition data#539
philips77 merged 1 commit intonordicsemi:mainfrom
kkellermann:improvement/apply-missing-node-features

Conversation

@kkellermann
Copy link
Copy Markdown
Contributor

This PR revises the processing of the composition data in the case of the node features. The current implementation discarded newly-received node features if NodeFeaturesState was already set once. In this PR, the individual node features are now checked for nil and, if necessary, replaced by the newly received composition data.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 19, 2023

CLA assistant check
All committers have signed the CLA.

@philips77
Copy link
Copy Markdown
Contributor

Hello,
May I ask what is the intention for the change? Do you first read statuses of different features before reading Composition Data?

@philips77
Copy link
Copy Markdown
Contributor

And sorry for the long response time. I didn't notice your PR during the holiday period.

@kkellermann
Copy link
Copy Markdown
Contributor Author

kkellermann commented Aug 30, 2023

Hello,

And sorry for the long response time. I didn't notice your PR during the holiday period.

no problem.

May I ask what is the intention for the change? Do you first read statuses of different features before reading Composition Data?

our nodes sometimes have large composition data and when we connect to another node as a proxy, we have some problems receiving the composition data. Now we enable the proxy after the provisioning. With an enabled proxy we are connecting us directly to the node to get a higher success rate for receiving the Data. However, the enabled proxy has the effect of initialising the node features. After that, there was no way to update the other features such as the friends feature.

@philips77
Copy link
Copy Markdown
Contributor

Do you read Composition Data Page 0 before you connect to that node using GATT bearer? Is the Proxy feature disabled at that moment?

@kkellermann
Copy link
Copy Markdown
Contributor Author

No, we do not read Page 0 until we are connected to the GATT bearer. After provisioning, the node's proxy is disabled by default. So, we first send the message to enable the proxy. If the proxy is enabled, we connect directly to the node so that a message does not have to be routed through multiple nodes. With a direct connection, we request Page 0, which leads to a higher success rate.

@philips77
Copy link
Copy Markdown
Contributor

OK, I finally get it now. By sending ConfigGATTProxySet and receiving ConfigGATTProxyStatus the features property is created with default values:
https://github.com/NordicSemiconductor/IOS-nRF-Mesh-Library/blob/3c6cde5f07929872d11542dd27441776bf697580/nRFMeshProvision/Layers/Foundation%20Layer/ConfigurationClientHandler.swift#L313-L317
where ensureFeatures is:
https://github.com/NordicSemiconductor/IOS-nRF-Mesh-Library/blob/3c6cde5f07929872d11542dd27441776bf697580/nRFMeshProvision/Mesh%20Model/Node.swift#L895-L901

Then, the features received in the Composition Data are not applied, as the object exist.

@kkellermann
Copy link
Copy Markdown
Contributor Author

Then, the features received in the Composition Data are not applied, as the object exist.

Correct, that was the problem.
After requesting the Composition Data, we run some configurations for the node, such as enabling/disabling friend or secure network beaconing feature. But if the node functions are not applied within the Composition Data, we do not know whether the feature such as the friend feature is supported or not.

Do you see any problems with the adjustments of this PR?

@philips77
Copy link
Copy Markdown
Contributor

The only issue I can imagine is that the Composition Data should not change, that's why there's this check.
Actually, as I discussed here, perhaps it would be better to discard new completely when cid is already known, that is if Page 0 was applied.

But anyway, your suggestion is OK. I'll merge the PR when I'm done with my current changes.

@philips77 philips77 merged commit 73ea101 into nordicsemi:main Oct 10, 2023
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.

3 participants