Skip to content

Commit 78751fe

Browse files
sayondeepesp
authored and
esp
committed
Update to latest spec changes
1 parent 1babf8b commit 78751fe

File tree

9 files changed

+186
-120
lines changed

9 files changed

+186
-120
lines changed

examples/all-clusters-app/all-clusters-common/include/push-av-stream-transport-delegate-impl.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ namespace PushAvStreamTransport {
3030
struct PushAvStream
3131
{
3232
uint16_t id;
33-
TransportConfigurationStruct transportConfig;
34-
PushAvStreamTransportStatusEnum status;
33+
TransportOptionsStruct transportOptions;
34+
TransportStatusEnum transportStatus;
35+
PushAvStreamTransportStatusEnum connectionStatus;
3536
};
3637

3738
/**
@@ -40,8 +41,8 @@ struct PushAvStream
4041
class PushAvStreamTransportManager : public PushAvStreamTransportDelegate
4142
{
4243
public:
43-
Protocols::InteractionModel::Status AllocatePushTransport(const TransportOptionsDecodeableStruct & transportOptions,
44-
TransportConfigurationStruct & outTransporConfiguration);
44+
Protocols::InteractionModel::Status AllocatePushTransport(const TransportOptionsStruct & transportOptions,
45+
const uint16_t connectionID);
4546
Protocols::InteractionModel::Status DeallocatePushTransport(const uint16_t connectionID);
4647
Protocols::InteractionModel::Status ModifyPushTransport(const uint16_t connectionID,
4748
const TransportOptionsDecodeableStruct & transportOptions);
@@ -51,7 +52,6 @@ class PushAvStreamTransportManager : public PushAvStreamTransportDelegate
5152
Protocols::InteractionModel::Status
5253
ManuallyTriggerTransport(const uint16_t connectionID, TriggerActivationReasonEnum activationReason,
5354
const Optional<Structs::TransportMotionTriggerTimeControlStruct::DecodableType> & timeControl);
54-
Protocols::InteractionModel::Status FindTransport(const Optional<DataModel::Nullable<uint16_t>> & connectionID);
5555

5656
CHIP_ERROR ValidateStreamUsage(StreamUsageEnum streamUsage, const Optional<DataModel::Nullable<uint16_t>> & videoStreamId,
5757
const Optional<DataModel::Nullable<uint16_t>> & audioStreamId);
@@ -70,7 +70,6 @@ class PushAvStreamTransportManager : public PushAvStreamTransportDelegate
7070

7171
private:
7272
std::vector<PushAvStream> pushavStreams;
73-
std::vector<TransportConfigurationStruct> configList;
7473
};
7574

7675
} // namespace PushAvStreamTransport

examples/all-clusters-app/all-clusters-common/src/push-av-stream-transport-delegate-impl.cpp

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ std::unique_ptr<PushAvStreamTransportManager> sPushAvStramTransportInstance;
3838
std::unique_ptr<PushAvStreamTransportServer> sPushAvStramTransportClusterServerInstance;
3939

4040
Protocols::InteractionModel::Status
41-
PushAvStreamTransportManager::AllocatePushTransport(const TransportOptionsDecodeableStruct & transportOptions,
42-
TransportConfigurationStruct & outTransporConfiguration)
41+
PushAvStreamTransportManager::AllocatePushTransport(const TransportOptionsStruct & transportOptions, const uint16_t connectionID)
4342
{
44-
PushAvStream stream{ outTransporConfiguration.connectionID, outTransporConfiguration, PushAvStreamTransportStatusEnum::kIdle };
43+
PushAvStream stream{ connectionID, transportOptions, TransportStatusEnum::kInactive, PushAvStreamTransportStatusEnum::kIdle };
4544

4645
/*Store the allocated stream persistently*/
4746
pushavStreams.push_back(stream);
@@ -65,7 +64,7 @@ PushAvStreamTransportManager::ModifyPushTransport(const uint16_t connectionID,
6564
{
6665
if (stream.id == connectionID)
6766
{
68-
ChipLogError(Zcl, "Modified Push AV Stream with ID: %d", connectionID);
67+
ChipLogProgress(Zcl, "Modified Push AV Stream with ID: %d", connectionID);
6968
return Status::Success;
7069
}
7170
}
@@ -82,8 +81,8 @@ Protocols::InteractionModel::Status PushAvStreamTransportManager::SetTransportSt
8281
{
8382
if (stream.id == connectionID)
8483
{
85-
stream.transportConfig.transportStatus = transportStatus;
86-
ChipLogError(Zcl, "Set Transport Status for Push AV Stream with ID: %d", connectionID);
84+
stream.transportStatus = transportStatus;
85+
ChipLogProgress(Zcl, "Set Transport Status for Push AV Stream with ID: %d", connectionID);
8786
}
8887
}
8988
}
@@ -99,27 +98,8 @@ Protocols::InteractionModel::Status PushAvStreamTransportManager::ManuallyTrigge
9998
{
10099
if (stream.id == connectionID)
101100
{
102-
stream.status = PushAvStreamTransportStatusEnum::kBusy;
103-
ChipLogError(Zcl, "Transport triggered for Push AV Stream with ID: %d", connectionID);
104-
}
105-
}
106-
return Status::Success;
107-
}
108-
109-
Protocols::InteractionModel::Status
110-
PushAvStreamTransportManager::FindTransport(const Optional<DataModel::Nullable<uint16_t>> & connectionID)
111-
{
112-
configList.clear();
113-
for (PushAvStream & stream : pushavStreams)
114-
{
115-
if (connectionID.Value().IsNull())
116-
{
117-
configList.push_back(stream.transportConfig);
118-
}
119-
else if (connectionID.Value().Value() == stream.id)
120-
{
121-
ChipLogError(Zcl, "Transport Found for Push AV Stream with ID: %d", connectionID.Value().Value());
122-
configList.push_back(stream.transportConfig);
101+
stream.connectionStatus = PushAvStreamTransportStatusEnum::kBusy;
102+
ChipLogProgress(Zcl, "Transport triggered for Push AV Stream with ID: %d", connectionID);
123103
}
124104
}
125105
return Status::Success;
@@ -148,7 +128,7 @@ PushAvStreamTransportStatusEnum PushAvStreamTransportManager::GetTransportStatus
148128
{
149129
if (stream.id == connectionID)
150130
{
151-
return stream.status;
131+
return stream.connectionStatus;
152132
}
153133
}
154134
return PushAvStreamTransportStatusEnum::kUnknown;
@@ -161,20 +141,20 @@ void PushAvStreamTransportManager::OnAttributeChanged(AttributeId attributeId)
161141

162142
void PushAvStreamTransportManager::Init()
163143
{
164-
ChipLogError(Zcl, "Push AV Stream Transport Initialized");
144+
ChipLogProgress(Zcl, "Push AV Stream Transport Initialized");
165145
}
166146
CHIP_ERROR
167147
PushAvStreamTransportManager::LoadCurrentConnections(std::vector<TransportConfigurationStructWithFabricIndex> & currentConnections)
168148
{
169-
ChipLogError(Zcl, "Push AV Current Connections loaded");
149+
ChipLogProgress(Zcl, "Push AV Current Connections loaded");
170150

171151
return CHIP_NO_ERROR;
172152
}
173153

174154
CHIP_ERROR
175155
PushAvStreamTransportManager::PersistentAttributesLoadedCallback()
176156
{
177-
ChipLogError(Zcl, "Persistent attributes loaded");
157+
ChipLogProgress(Zcl, "Persistent attributes loaded");
178158

179159
return CHIP_NO_ERROR;
180160
}
@@ -190,7 +170,15 @@ void emberAfPushAvStreamTransportClusterInitCallback(EndpointId endpoint)
190170
sPushAvStramTransportInstance = std::make_unique<PushAvStreamTransportManager>();
191171
sPushAvStramTransportInstance->Init();
192172

173+
BitFlags<Feature> features;
174+
193175
sPushAvStramTransportClusterServerInstance =
194-
std::make_unique<PushAvStreamTransportServer>(*sPushAvStramTransportInstance.get(), endpoint);
176+
std::make_unique<PushAvStreamTransportServer>(*sPushAvStramTransportInstance.get(), endpoint, features);
195177
sPushAvStramTransportClusterServerInstance->Init();
196178
}
179+
180+
void emberAfPushAvStreamTransportClusterShutdownCallback(EndpointId endpoint)
181+
{
182+
sPushAvStramTransportClusterServerInstance = nullptr;
183+
sPushAvStramTransportInstance = nullptr;
184+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2025 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
group("push-av-stream-transport-server") {
15+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2025 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This is the equivalent to app_config_dependent_sources.gni
16+
TARGET_SOURCES(
17+
${APP_TARGET}
18+
PRIVATE
19+
"${CLUSTER_DIR}/push-av-stream-transport-server.cpp"
20+
"${CLUSTER_DIR}/push-av-stream-transport-server.h"
21+
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2025 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
app_config_dependent_sources = [
15+
"push-av-stream-transport-server.cpp",
16+
"push-av-stream-transport-server.h",
17+
]

0 commit comments

Comments
 (0)