mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 05:00:11 +00:00
[vendor-info] add vendor OUI support (#12991)
This commit introduces support for configuring and retrieving a vendor OUI-24 (Organizationally Unique Identifier). It defines the new `OPENTHREAD_CONFIG_NET_DIAG_VENDOR_OUI` configuration option and adds the `otThreadGetVendorOui()` and `otThreadSetVendorOui()` APIs. When specified, the vendor OUI is included in the `BorderAgent` mDNS/DNS-SD TXT data under the `vo` key. The `VendorInfo` class is updated to manage the OUI value. This commit also adds the `vendor oui` CLI command to get or set this property. Finally, it updates the tests to validate the presence and correctness of the new `vo` key in the TXT data.
This commit is contained in:
@@ -125,6 +125,7 @@
|
||||
#define OPENTHREAD_CONFIG_NET_DIAG_VENDOR_MODEL "Nexus Simulation"
|
||||
#define OPENTHREAD_CONFIG_NET_DIAG_VENDOR_NAME "RD:OpenThread by Google Nest"
|
||||
#define OPENTHREAD_CONFIG_NET_DIAG_VENDOR_SW_VERSION "OT-simul-nexus"
|
||||
#define OPENTHREAD_CONFIG_NET_DIAG_VENDOR_OUI 0x020100
|
||||
#define OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 256
|
||||
#define OPENTHREAD_CONFIG_PARENT_SEARCH_BACKOFF_INTERVAL (10 * 60)
|
||||
|
||||
@@ -1461,6 +1461,14 @@ void ValidateMeshCoPTxtData(TxtData &aTxtData, Node &aNode, bool aExpectVendorIn
|
||||
aTxtData.ValidateKey("mn", expectedModelName);
|
||||
VerifyOrQuit(info.mHasModelName);
|
||||
VerifyOrQuit(StringMatch(info.mModelName, expectedModelName));
|
||||
|
||||
if (aNode.Get<VendorInfo>().IsOuiSpecified())
|
||||
{
|
||||
uint8_t ouiData[3];
|
||||
|
||||
BigEndian::WriteUint24(aNode.Get<VendorInfo>().GetOui(), ouiData);
|
||||
aTxtData.ValidateKey("vo", ouiData);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user