Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdecenzo committed Mar 24, 2023
1 parent 97b0807 commit 6f16b46
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ CastingServer::GetDiscoveredCommissioner(int index, chip::Optional<TargetVideoPl
void CastingServer::ReadServerClustersForNode(NodeId nodeId)
{
ChipLogProgress(NotSpecified, "ReadServerClustersForNode nodeId=0x" ChipLogFormatX64, ChipLogValueX64(nodeId));
Init();
CHIP_ERROR err = Init();
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "Init error: %" CHIP_ERROR_FORMAT, err.Format());
}

for (const auto & binding : BindingTable::GetInstance())
{
ChipLogProgress(NotSpecified,
Expand Down Expand Up @@ -472,7 +477,11 @@ void CastingServer::DeviceEventCallback(const DeviceLayer::ChipDeviceEvent * eve
// given a fabric index, try to determine the video-player nodeId by searching the binding table
NodeId CastingServer::GetVideoPlayerNodeForFabricIndex(FabricIndex fabricIndex)
{
Init();
CHIP_ERROR err = Init();
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "GetVideoPlayerNodeForFabricIndex Init error: %" CHIP_ERROR_FORMAT, err.Format());
}
for (const auto & binding : BindingTable::GetInstance())
{
ChipLogProgress(NotSpecified,
Expand All @@ -494,7 +503,11 @@ NodeId CastingServer::GetVideoPlayerNodeForFabricIndex(FabricIndex fabricIndex)
// given a nodeId, try to determine the video-player fabric index by searching the binding table
FabricIndex CastingServer::GetVideoPlayerFabricIndexForNode(NodeId nodeId)
{
Init();
CHIP_ERROR err = Init();
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "GetVideoPlayerFabricIndexForNode Init error: %" CHIP_ERROR_FORMAT, err.Format());
}
for (const auto & binding : BindingTable::GetInstance())
{
ChipLogProgress(NotSpecified,
Expand Down

0 comments on commit 6f16b46

Please sign in to comment.