-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GetCommissionerNodeId command supports for yaml tests, chip-tool …
…and darwin-framework-tool (#24737)
- Loading branch information
1 parent
99e1c12
commit 6feefe9
Showing
25 changed files
with
1,131 additions
and
12,961 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
examples/chip-tool/commands/pairing/GetCommissionerNodeIdCommand.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "../common/CHIPCommand.h" | ||
|
||
class GetCommissionerNodeIdCommand : public CHIPCommand | ||
{ | ||
public: | ||
GetCommissionerNodeIdCommand(CredentialIssuerCommands * credIssuerCommands) : | ||
CHIPCommand("get-commissioner-node-id", credIssuerCommands) | ||
{} | ||
|
||
/////////// CHIPCommand Interface ///////// | ||
CHIP_ERROR RunCommand() override | ||
{ | ||
chip::NodeId id; | ||
ReturnErrorOnFailure(GetIdentityNodeId(GetIdentity(), &id)); | ||
ChipLogProgress(chipTool, "Commissioner Node Id 0x:" ChipLogFormatX64, ChipLogValueX64(id)); | ||
|
||
ReturnErrorOnFailure(RemoteDataModelLogger::LogGetCommissionerNodeId(id)); | ||
SetCommandExitStatus(CHIP_NO_ERROR); | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(10); } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
examples/darwin-framework-tool/commands/pairing/GetCommissionerNodeIdCommand.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "../common/CHIPCommandBridge.h" | ||
|
||
class GetCommissionerNodeIdCommand : public CHIPCommandBridge | ||
{ | ||
public: | ||
GetCommissionerNodeIdCommand() : CHIPCommandBridge("get-commissioner-node-id") {} | ||
|
||
/////////// CHIPCommand Interface ///////// | ||
CHIP_ERROR RunCommand() override; | ||
|
||
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(0); } | ||
}; |
33 changes: 33 additions & 0 deletions
33
examples/darwin-framework-tool/commands/pairing/GetCommissionerNodeIdCommand.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
#import <Matter/Matter.h> | ||
|
||
#include "GetCommissionerNodeIdCommand.h" | ||
|
||
CHIP_ERROR GetCommissionerNodeIdCommand::RunCommand() | ||
{ | ||
auto * controller = CurrentCommissioner(); | ||
VerifyOrReturnError(nil != controller, CHIP_ERROR_INCORRECT_STATE); | ||
|
||
auto id = [controller.controllerNodeId unsignedLongLongValue]; | ||
ChipLogProgress(chipTool, "Commissioner Node Id 0x:" ChipLogFormatX64, ChipLogValueX64(id)); | ||
|
||
SetCommandExitStatus(CHIP_NO_ERROR); | ||
return CHIP_NO_ERROR; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.