mirror of
https://github.com/espressif/openthread.git
synced 2026-08-26 04:09:52 +00:00
[border-agent] add APIs to enable/disable ephemeral key feature (#11119)
This commit adds OT APIs to enable/disable the ephemeral key feature and get IsEnabled state of it. Currently a dbus method is provided to enable/disable the Ephemeral Key feature and it is implemented with the module `BorderAgent` in ot-br-posix. After we move the MeshCoP Service Publisher into OT core, we won't use the `BorderAgent` module anymore. So we put the get/set methods into OT core first. In addition, the MeshCoP service published has a state bitmap which has a bit to indicate if Ephemeral Key feature is supported. So we have to put this data into OT core.
This commit is contained in:
@@ -211,6 +211,17 @@ void TestBorderAgentEphemeralKey(void)
|
||||
node1.Get<Mac::Mac>().SetPanId(node0.Get<Mac::Mac>().GetPanId());
|
||||
node1.Get<ThreadNetif>().Up();
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Log("Check Border Agent ephemeral key feature enabled");
|
||||
|
||||
node0.Get<MeshCoP::BorderAgent>().SetEphemeralKeyFeatureEnabled(false);
|
||||
VerifyOrQuit(!node0.Get<MeshCoP::BorderAgent>().IsEphemeralKeyFeatureEnabled());
|
||||
VerifyOrQuit(node0.Get<MeshCoP::BorderAgent>().SetEphemeralKey(kEphemeralKey, /* aTimeout */ 0, kUdpPort) ==
|
||||
kErrorNotCapable);
|
||||
|
||||
node0.Get<MeshCoP::BorderAgent>().SetEphemeralKeyFeatureEnabled(true);
|
||||
VerifyOrQuit(node0.Get<MeshCoP::BorderAgent>().IsEphemeralKeyFeatureEnabled());
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Log("Check Border Agent ephemeral key initial state");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user