Skip to content

Commit

Permalink
[dbus] add force option for deactivate API
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhyang committed Oct 12, 2024
1 parent 3e9be20 commit 76cce5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/dbus/server/dbus_thread_object_rcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2009,9 +2009,20 @@ void DBusThreadObjectRcp::DeactivateEphemeralKeyModeHandler(DBusRequest &aReques
{
otError error = OT_ERROR_NONE;
auto threadHelper = mHost.GetThreadHelper();
bool force;
auto args = std::tie(force);

VerifyOrExit(mBorderAgent.GetEphemeralKeyEnabled(), error = OT_ERROR_NOT_CAPABLE);

if (DBusMessageToTuple(*aRequest.GetMessage(), args) == OTBR_ERROR_NONE)
{
if (force)
{
otBorderAgentDisconnect(threadHelper->GetInstance());
ExitNow();
}
}

switch (otBorderAgentGetState(threadHelper->GetInstance()))
{
case OT_BORDER_AGENT_STATE_STOPPED:
Expand Down
1 change: 1 addition & 0 deletions src/dbus/server/introspect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@

<!-- DeactivateEphemeralKeyMode: Deactivate ePSKc mode. -->
<method name="DeactivateEphemeralKeyMode">
<arg name="force" type="b" direction="in"/>
</method>

<!-- MeshLocalPrefix: The /64 mesh-local prefix. -->
Expand Down

0 comments on commit 76cce5f

Please sign in to comment.