@@ -38,10 +38,9 @@ std::unique_ptr<PushAvStreamTransportManager> sPushAvStramTransportInstance;
38
38
std::unique_ptr<PushAvStreamTransportServer> sPushAvStramTransportClusterServerInstance ;
39
39
40
40
Protocols::InteractionModel::Status
41
- PushAvStreamTransportManager::AllocatePushTransport (const TransportOptionsDecodeableStruct & transportOptions,
42
- TransportConfigurationStruct & outTransporConfiguration)
41
+ PushAvStreamTransportManager::AllocatePushTransport (const TransportOptionsStruct & transportOptions, const uint16_t connectionID)
43
42
{
44
- PushAvStream stream{ outTransporConfiguration. connectionID , outTransporConfiguration , PushAvStreamTransportStatusEnum::kIdle };
43
+ PushAvStream stream{ connectionID, transportOptions, TransportStatusEnum:: kInactive , PushAvStreamTransportStatusEnum::kIdle };
45
44
46
45
/* Store the allocated stream persistently*/
47
46
pushavStreams.push_back (stream);
@@ -65,7 +64,7 @@ PushAvStreamTransportManager::ModifyPushTransport(const uint16_t connectionID,
65
64
{
66
65
if (stream.id == connectionID)
67
66
{
68
- ChipLogError (Zcl, " Modified Push AV Stream with ID: %d" , connectionID);
67
+ ChipLogProgress (Zcl, " Modified Push AV Stream with ID: %d" , connectionID);
69
68
return Status::Success;
70
69
}
71
70
}
@@ -82,8 +81,8 @@ Protocols::InteractionModel::Status PushAvStreamTransportManager::SetTransportSt
82
81
{
83
82
if (stream.id == connectionID)
84
83
{
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);
87
86
}
88
87
}
89
88
}
@@ -99,27 +98,8 @@ Protocols::InteractionModel::Status PushAvStreamTransportManager::ManuallyTrigge
99
98
{
100
99
if (stream.id == connectionID)
101
100
{
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);
123
103
}
124
104
}
125
105
return Status::Success;
@@ -148,7 +128,7 @@ PushAvStreamTransportStatusEnum PushAvStreamTransportManager::GetTransportStatus
148
128
{
149
129
if (stream.id == connectionID)
150
130
{
151
- return stream.status ;
131
+ return stream.connectionStatus ;
152
132
}
153
133
}
154
134
return PushAvStreamTransportStatusEnum::kUnknown ;
@@ -161,20 +141,20 @@ void PushAvStreamTransportManager::OnAttributeChanged(AttributeId attributeId)
161
141
162
142
void PushAvStreamTransportManager::Init ()
163
143
{
164
- ChipLogError (Zcl, " Push AV Stream Transport Initialized" );
144
+ ChipLogProgress (Zcl, " Push AV Stream Transport Initialized" );
165
145
}
166
146
CHIP_ERROR
167
147
PushAvStreamTransportManager::LoadCurrentConnections (std::vector<TransportConfigurationStructWithFabricIndex> & currentConnections)
168
148
{
169
- ChipLogError (Zcl, " Push AV Current Connections loaded" );
149
+ ChipLogProgress (Zcl, " Push AV Current Connections loaded" );
170
150
171
151
return CHIP_NO_ERROR;
172
152
}
173
153
174
154
CHIP_ERROR
175
155
PushAvStreamTransportManager::PersistentAttributesLoadedCallback ()
176
156
{
177
- ChipLogError (Zcl, " Persistent attributes loaded" );
157
+ ChipLogProgress (Zcl, " Persistent attributes loaded" );
178
158
179
159
return CHIP_NO_ERROR;
180
160
}
@@ -190,7 +170,15 @@ void emberAfPushAvStreamTransportClusterInitCallback(EndpointId endpoint)
190
170
sPushAvStramTransportInstance = std::make_unique<PushAvStreamTransportManager>();
191
171
sPushAvStramTransportInstance ->Init ();
192
172
173
+ BitFlags<Feature> features;
174
+
193
175
sPushAvStramTransportClusterServerInstance =
194
- std::make_unique<PushAvStreamTransportServer>(*sPushAvStramTransportInstance .get (), endpoint);
176
+ std::make_unique<PushAvStreamTransportServer>(*sPushAvStramTransportInstance .get (), endpoint, features );
195
177
sPushAvStramTransportClusterServerInstance ->Init ();
196
178
}
179
+
180
+ void emberAfPushAvStreamTransportClusterShutdownCallback (EndpointId endpoint)
181
+ {
182
+ sPushAvStramTransportClusterServerInstance = nullptr ;
183
+ sPushAvStramTransportInstance = nullptr ;
184
+ }
0 commit comments