You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.
Presently the OpenThread code-base provides no way to detect breaking changes in the API at compile time. For OpenWeave, this leads to brittleness in the Device Layer when particular device adaptations target different versions of OpenThread.
To resolve this within OpenWeave, the following conditional compilation pattern is proposed:
In a common Device Layer header file, conditionally define the preprocessor macro WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION if it is not already defined. The value of the macro should be a date-time in the form yyyymmddHHMMSS.
Set the default value for WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION to have the time of the most recent commit to OpenThread known to work with OpenWeave.
As breaking API changes occur in OpenThread, wrap the affected code in OpenWeave in #if statements comparing WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION against the time the change was introduced into OpenThread master; specifically, the timestamp of the merge commit. E.g.:
#if WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION >= <...commit time...>
... new API code ...
#else
... old API code ...
#endif
Update the default value for WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION to the most recent compatible commit whenever new conditional code is introduced.
For any Device Layer adaptation that uses an earlier version of OpenThread, override WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION for that platform with the commit time of the version being used. This declaration should also be defaulted, so that application developers can override with their own value if they choose to.
For extra credit, modify the platform makefiles to fetch the highest master commit date from the OpenThread source directory using the following command and pass it as -DWEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION=xxxx in CPPFLAGS to configure when building OpenWeave:
date --utc --date=@`git show -s --format=%ct \`git merge-base HEAD master\`` '+%Y%m%d%H%M%S'
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Presently the OpenThread code-base provides no way to detect breaking changes in the API at compile time. For OpenWeave, this leads to brittleness in the Device Layer when particular device adaptations target different versions of OpenThread.
To resolve this within OpenWeave, the following conditional compilation pattern is proposed:
In a common Device Layer header file, conditionally define the preprocessor macro WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION if it is not already defined. The value of the macro should be a date-time in the form yyyymmddHHMMSS.
Set the default value for WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION to have the time of the most recent commit to OpenThread known to work with OpenWeave.
As breaking API changes occur in OpenThread, wrap the affected code in OpenWeave in #if statements comparing WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION against the time the change was introduced into OpenThread master; specifically, the timestamp of the merge commit. E.g.:
Update the default value for WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION to the most recent compatible commit whenever new conditional code is introduced.
For any Device Layer adaptation that uses an earlier version of OpenThread, override WEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION for that platform with the commit time of the version being used. This declaration should also be defaulted, so that application developers can override with their own value if they choose to.
For extra credit, modify the platform makefiles to fetch the highest master commit date from the OpenThread source directory using the following command and pass it as -DWEAVE_DEVICE_CONFIG_OPENTHREAD_API_REVISION=xxxx in CPPFLAGS to configure when building OpenWeave:
The text was updated successfully, but these errors were encountered: