Skip to content

Commit dafeb87

Browse files
authored
Merge branch 'master' into granbery/power_topology_test_scripts
2 parents 101bb17 + 977d90e commit dafeb87

File tree

10 files changed

+478
-169
lines changed

10 files changed

+478
-169
lines changed

src/app/clusters/network-commissioning/network-commissioning.cpp

+14-9
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetw
477477
}
478478
if (ssid.size() > DeviceLayer::Internal::kMaxWiFiSSIDLength)
479479
{
480-
// This should not happen, it means it's a broken driver.
480+
// Clients should never use too large a SSID.
481481
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::ConstraintError);
482482
SetLastNetworkingStatusValue(MakeNullable(Status::kUnknownError));
483483
return;
@@ -491,10 +491,10 @@ void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetw
491491
}
492492
else if (mFeatureFlags.Has(Feature::kThreadNetworkInterface))
493493
{
494-
// Not allowed to populate SSID for Thread.
495-
if (!req.ssid.HasValue())
494+
// SSID present on Thread violates the `[WI]` conformance.
495+
if (req.ssid.HasValue())
496496
{
497-
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::ConstraintError);
497+
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::InvalidCommand);
498498
return;
499499
}
500500

@@ -559,7 +559,7 @@ void Instance::HandleAddOrUpdateWiFiNetwork(HandlerContext & ctx, const Commands
559559
return;
560560
}
561561
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_PDC
562-
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::ConstraintError);
562+
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::InvalidCommand);
563563
return;
564564
}
565565

@@ -1202,11 +1202,16 @@ void Instance::OnFailSafeTimerExpired()
12021202
mpWirelessDriver->RevertConfiguration();
12031203
mAsyncCommandHandle.Release();
12041204

1205-
// Reset state on failsafe expiry.
1205+
// Mark the network list changed since `mpWirelessDriver->RevertConfiguration()` may have updated it.
12061206
ReportNetworksListChanged();
1207-
SetLastNetworkId(ByteSpan{});
1208-
SetLastConnectErrorValue(NullNullable);
1209-
SetLastNetworkingStatusValue(NullNullable);
1207+
1208+
// If no networks are left, clear-out errors;
1209+
if (mpBaseDriver && (CountAndRelease(mpBaseDriver->GetNetworks()) == 0))
1210+
{
1211+
SetLastNetworkId(ByteSpan{});
1212+
SetLastConnectErrorValue(NullNullable);
1213+
SetLastNetworkingStatusValue(NullNullable);
1214+
}
12101215
}
12111216

12121217
CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context)

src/app/tests/suites/certification/Test_TC_S_2_2.yaml

+12-42
Original file line numberDiff line numberDiff line change
@@ -643,48 +643,18 @@ tests:
643643
to 60 000 000 (60 000s) and a set of extension fields appropriate to
644644
AC1."
645645
verification: |
646-
./chip-tool scenes add-scene 0x0001 1 60000000 "Test Name" '[{"clusterId": value, "attributeValueList":[{"attributeId": value, "attributeValue": value}]}' nodeId endpointId
647-
648-
Note: The number of ExtensionFieldSets, the value of clusterId of each ExtensionFieldSet, the number of attributes in attributeValueList and their values varies for each application
649-
650-
Verify the "status is success" on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform:
651-
[1670970505.887060][5742:5744] CHIP:DMG: InvokeResponseMessage =
652-
[1670970505.887118][5742:5744] CHIP:DMG: {
653-
[1670970505.887172][5742:5744] CHIP:DMG: suppressResponse = false,
654-
[1670970505.887231][5742:5744] CHIP:DMG: InvokeResponseIBs =
655-
[1670970505.887307][5742:5744] CHIP:DMG: [
656-
[1670970505.887366][5742:5744] CHIP:DMG: InvokeResponseIB =
657-
[1670970505.887444][5742:5744] CHIP:DMG: {
658-
[1670970505.887507][5742:5744] CHIP:DMG: CommandDataIB =
659-
[1670970505.887576][5742:5744] CHIP:DMG: {
660-
[1670970505.887713][5742:5744] CHIP:DMG: CommandPathIB =
661-
[1670970505.887804][5742:5744] CHIP:DMG: {
662-
[1670970505.887940][5742:5744] CHIP:DMG: EndpointId = 0x1,
663-
[1670970505.888093][5742:5744] CHIP:DMG: ClusterId = 0x5,
664-
[1670970505.888242][5742:5744] CHIP:DMG: CommandId = 0x0,
665-
[1670970505.888385][5742:5744] CHIP:DMG: },
666-
[1670970505.888692][5742:5744] CHIP:DMG:
667-
[1670970505.888769][5742:5744] CHIP:DMG: CommandFields =
668-
[1670970505.888852][5742:5744] CHIP:DMG: {
669-
[1670970505.889030][5742:5744] CHIP:DMG: 0x0 = 0,
670-
[1670970505.889183][5742:5744] CHIP:DMG: 0x1 = 1,
671-
[1670970505.889406][5742:5744] CHIP:DMG: 0x2 = 1,
672-
[1670970505.889515][5742:5744] CHIP:DMG: },
673-
[1670970505.889603][5742:5744] CHIP:DMG: },
674-
[1670970505.889684][5742:5744] CHIP:DMG:
675-
[1670970505.889745][5742:5744] CHIP:DMG: },
676-
[1670970505.889821][5742:5744] CHIP:DMG:
677-
[1670970505.889878][5742:5744] CHIP:DMG: ],
678-
[1670970505.889953][5742:5744] CHIP:DMG:
679-
[1670970505.890009][5742:5744] CHIP:DMG: InteractionModelRevision = 1
680-
[1670970505.890066][5742:5744] CHIP:DMG: },
681-
[1670970505.890212][5742:5744] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0005 Command=0x0000_0000
682-
[1670970505.890328][5742:5744] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Command 0x0000_0000
683-
[1670970505.890458][5742:5744] CHIP:TOO: AddSceneResponse: {
684-
[1670970505.890551][5742:5744] CHIP:TOO: status: 0
685-
[1670970505.890608][5742:5744] CHIP:TOO: groupId: 1
686-
[1670970505.890717][5742:5744] CHIP:TOO: sceneId: 1
687-
[1670970505.890774][5742:5744] CHIP:TOO: }
646+
./chip-tool scenesmanagement add-scene 0x0001 0x01 60000000 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4001", "attributeValue": "0x01"}]}]' 1 1
647+
648+
Verify DUT sends a AddSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to G1 and the SceneID field set to 0x01 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform:
649+
650+
[1706763610.675038][4232:4234] CHIP:DMG: },
651+
[1706763610.675108][4232:4234] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0000
652+
[1706763610.675134][4232:4234] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0000
653+
[1706763610.675187][4232:4234] CHIP:TOO: AddSceneResponse: {
654+
[1706763610.675215][4232:4234] CHIP:TOO: status: 0
655+
[1706763610.675229][4232:4234] CHIP:TOO: groupID: 1
656+
[1706763610.675244][4232:4234] CHIP:TOO: sceneID: 1
657+
[1706763610.675258][4232:4234] CHIP:TOO: }
688658
cluster: "LogCommands"
689659
command: "UserPrompt"
690660
PICS: PICS_SKIP_SAMPLE_APP

src/app/tests/suites/certification/Test_TC_S_2_3.yaml

+33-44
Original file line numberDiff line numberDiff line change
@@ -376,50 +376,39 @@ tests:
376376
set to G1 and the SceneID field set to 0x01."
377377
PICS: S.S.C01.Rsp && PICS_SKIP_SAMPLE_APP
378378
verification: |
379-
./chip-tool scenesmanagement view-scene GroupId SceneId Node-Id EndpointId
380-
381-
Note: The number of ExtensionFieldSets, the value of clusterId of each ExtensionFieldSet, the number of attributes in attributeValueList and their values varies for each application
382-
383-
Verify that the extension fields in the log match the ones expected in the following log:
384-
[1705680224.968551][5827:5829] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001
385-
[1705680224.968559][5827:5829] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001
386-
CHIP:TOO: ViewSceneResponse: {
387-
CHIP:TOO: status: 0
388-
CHIP:TOO: groupID: 1
389-
CHIP:TOO: sceneID: 1
390-
CHIP:TOO: transitionTime: 1000
391-
CHIP:TOO: sceneName:
392-
CHIP:TOO: extensionFieldSets: 3 entries
393-
CHIP:TOO: [1]: {
394-
CHIP:TOO: ClusterID: XX
395-
CHIP:TOO: AttributeValueList: X entries
396-
CHIP:TOO: [1]: {
397-
CHIP:TOO: AttributeID: XX
398-
CHIP:TOO: AttributeValue:XX
399-
CHIP:TOO: }
400-
CHIP:TOO: }
401-
CHIP:TOO: [2]: {
402-
CHIP:TOO: ClusterID: XX
403-
CHIP:TOO: AttributeValueList: X entries
404-
CHIP:TOO: [1]: {
405-
CHIP:TOO: AttributeID: XX
406-
CHIP:TOO: AttributeValue: XX
407-
CHIP:TOO: }
408-
CHIP:TOO: }
409-
CHIP:TOO: [3]: {
410-
CHIP:TOO: ClusterID: XX
411-
CHIP:TOO: AttributeValueList: XX entries
412-
CHIP:TOO: [X]: {
413-
CHIP:TOO: AttributeID: XX
414-
CHIP:TOO: AttributeValue: XX
415-
CHIP:TOO: }
416-
...
417-
CHIP:TOO: [X]: {
418-
CHIP:TOO: AttributeID: XX
419-
CHIP:TOO: AttributeValue: XX
420-
CHIP:TOO: }
421-
CHIP:TOO: }
422-
CHIP:TOO: }
379+
./chip-tool scenesmanagement view-scene 0x0101 0x01 1 1
380+
381+
Verify DUT sends a ViewSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to 1000 and a set of extension fields appropriate to AC1 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform:
382+
383+
384+
NOTE: The values below are expected to match the values from the specific AC tested
385+
386+
[1708071897.294470][7731:7733] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001
387+
[1708071897.294486][7731:7733] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001
388+
[1708071897.294520][7731:7733] CHIP:TOO: ViewSceneResponse: {
389+
[1708071897.294527][7731:7733] CHIP:TOO: status: 0
390+
[1708071897.294530][7731:7733] CHIP:TOO: groupID: 257
391+
[1708071897.294533][7731:7733] CHIP:TOO: sceneID: 1
392+
[1708071897.294536][7731:7733] CHIP:TOO: transitionTime: 1000
393+
[1708071897.294540][7731:7733] CHIP:TOO: sceneName: scene name
394+
[1708071897.294554][7731:7733] CHIP:TOO: extensionFieldSets: 2 entries
395+
[1708071897.294569][7731:7733] CHIP:TOO: [1]: {
396+
[1708071897.294574][7731:7733] CHIP:TOO: ClusterID: 6
397+
[1708071897.294580][7731:7733] CHIP:TOO: AttributeValueList: 1 entries
398+
[1708071897.294589][7731:7733] CHIP:TOO: [1]: {
399+
[1708071897.294593][7731:7733] CHIP:TOO: AttributeID: 1
400+
[1708071897.294596][7731:7733] CHIP:TOO: AttributeValue: 1
401+
[1708071897.294599][7731:7733] CHIP:TOO: }
402+
[1708071897.294603][7731:7733] CHIP:TOO: }
403+
[1708071897.294611][7731:7733] CHIP:TOO: [2]: {
404+
[1708071897.294615][7731:7733] CHIP:TOO: ClusterID: 8
405+
[1708071897.294621][7731:7733] CHIP:TOO: AttributeValueList: 1 entries
406+
[1708071897.294628][7731:7733] CHIP:TOO: [1]: {
407+
[1708071897.294633][7731:7733] CHIP:TOO: AttributeID: 0
408+
[1708071897.294636][7731:7733] CHIP:TOO: AttributeValue: 100
409+
[1708071897.294639][7731:7733] CHIP:TOO: }
410+
[1708071897.294643][7731:7733] CHIP:TOO: }
411+
[1708071897.294647][7731:7733] CHIP:TOO: }
423412
cluster: "LogCommands"
424413
command: "UserPrompt"
425414
arguments:

src/app/tests/suites/certification/Test_TC_S_2_5.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ tests:
250250
to 20000 (20s) and no extension field sets."
251251
PICS: S.S.C00.Rsp
252252
verification: |
253-
scenesmanagement add-scene 0x0001 0x01 20 scene1 [] 1 1
253+
./chip-tool scenesmanagement add-scene 0x0001 0x01 20000 scene1 [] 1 1
254254
255255
Verify the AddSceneResponse with following fields:
256256
Status is SUCCESS
@@ -412,7 +412,7 @@ tests:
412412
field sets. If RemainingCapacity is 0, continue to Step 8a."
413413
PICS: S.S.C00.Rsp
414414
verification: |
415-
./chip-tool scenesmanagement add-scene 0x0001 0x03 20 scene1 [] 1 1
415+
./chip-tool scenesmanagement add-scene 0x0001 0x03 20000 scene1 [] 1 1
416416
417417
Verify the AddSceneResponse with following fields:
418418
Status is SUCCESS

0 commit comments

Comments
 (0)