Skip to content

Commit

Permalink
iOS tv-casting-app: refactored Initialization (project-chip#29002)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadb-amazon authored Sep 6, 2023
1 parent ba45f9c commit cd41f0b
Show file tree
Hide file tree
Showing 27 changed files with 1,300 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53B128E5184C00F293E8 /* TargetNavigatorTypes.mm */; };
3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */; };
3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C66FBFB290327BB00B63FE7 /* AppParameters.mm */; };
3C6920462AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */; };
3C6920482AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */; };
3C69204C2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */; };
3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C74B28F7A777001CB9D1 /* ContentApp.mm */; };
3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */; };
3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand All @@ -27,9 +30,20 @@
3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB873D286A593700771BAD /* CastingServerBridge.mm */; };
3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB873E286A593700771BAD /* ConversionUtils.mm */; };
3CD6D01A298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD6D019298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h */; };
3CD73F172A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */; };
3CD73F192A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */; };
3CD73F1C2A9E8396009D82D1 /* MTRCommissionableDataProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */; };
3CD73F1E2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */; };
3CD73F202A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */; };
3CD73F222A9EA078009D82D1 /* MTRDeviceAttestationCredentials.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */; };
3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CE5ECCD2A673B30007CF331 /* CommissioningCallbackHandlers.h */; };
3CE5ECD02A673E2C007CF331 /* CommissioningCallbackHandlers.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CE5ECCF2A673E2C007CF331 /* CommissioningCallbackHandlers.m */; };
3CE868F42946D76200FCB92B /* CommissionableDataProviderImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CE868F32946D76200FCB92B /* CommissionableDataProviderImpl.mm */; };
3CF71C0A2A992D0D003A5CE5 /* MTRCastingApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */; };
3CF71C0C2A992D25003A5CE5 /* MTRCastingApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */; };
3CF71C0E2A992DA2003A5CE5 /* MTRDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */; };
3CF71C102A99312D003A5CE5 /* MTRCommissionableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */; };
3CF71C122A993298003A5CE5 /* MTRCommissionableData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */; };
3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF8532628E37F1000F07B9F /* MatterError.mm */; };
/* End PBXBuildFile section */

Expand All @@ -48,6 +62,9 @@
3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentLauncherTypes.mm; sourceTree = "<group>"; };
3C66FBFA2903279A00B63FE7 /* AppParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppParameters.h; sourceTree = "<group>"; };
3C66FBFB290327BB00B63FE7 /* AppParameters.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppParameters.mm; sourceTree = "<group>"; };
3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationCredentialsProvider.h; sourceTree = "<group>"; };
3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationCredentialsProvider.mm; sourceTree = "<group>"; };
3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommonCaseDeviceServerInitParamsProvider.h; sourceTree = "<group>"; };
3C81C74B28F7A777001CB9D1 /* ContentApp.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentApp.mm; sourceTree = "<group>"; };
3C81C74E28F7A7AE001CB9D1 /* ContentApp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentApp.h; sourceTree = "<group>"; };
3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VideoPlayer.m; sourceTree = "<group>"; };
Expand All @@ -64,9 +81,20 @@
3CCB873D286A593700771BAD /* CastingServerBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CastingServerBridge.mm; sourceTree = "<group>"; };
3CCB873E286A593700771BAD /* ConversionUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConversionUtils.mm; sourceTree = "<group>"; };
3CD6D019298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommissionerDiscoveryDelegateImpl.h; sourceTree = "<group>"; };
3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRRotatingDeviceIdUniqueIdProvider.h; sourceTree = "<group>"; };
3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRRotatingDeviceIdUniqueIdProvider.mm; sourceTree = "<group>"; };
3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommissionableDataProvider.h; sourceTree = "<group>"; };
3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommissionableDataProvider.mm; sourceTree = "<group>"; };
3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationCredentials.h; sourceTree = "<group>"; };
3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationCredentials.mm; sourceTree = "<group>"; };
3CE5ECCD2A673B30007CF331 /* CommissioningCallbackHandlers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommissioningCallbackHandlers.h; sourceTree = "<group>"; };
3CE5ECCF2A673E2C007CF331 /* CommissioningCallbackHandlers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CommissioningCallbackHandlers.m; sourceTree = "<group>"; };
3CE868F32946D76200FCB92B /* CommissionableDataProviderImpl.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CommissionableDataProviderImpl.mm; sourceTree = "<group>"; };
3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCastingApp.h; sourceTree = "<group>"; };
3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCastingApp.mm; sourceTree = "<group>"; };
3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDataSource.h; sourceTree = "<group>"; };
3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommissionableData.h; sourceTree = "<group>"; };
3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommissionableData.mm; sourceTree = "<group>"; };
3CF8532528E37ED800F07B9F /* MatterError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterError.h; sourceTree = "<group>"; };
3CF8532628E37F1000F07B9F /* MatterError.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MatterError.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -106,6 +134,20 @@
isa = PBXGroup;
children = (
3CCB87202869085400771BAD /* MatterTvCastingBridge.h */,
3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */,
3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */,
3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */,
3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */,
3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */,
3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */,
3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */,
3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */,
3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */,
3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */,
3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */,
3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */,
3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */,
3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */,
3CCB873A286A593700771BAD /* CastingServerBridge.h */,
3CCB873D286A593700771BAD /* CastingServerBridge.mm */,
3C66FBFA2903279A00B63FE7 /* AppParameters.h */,
Expand Down Expand Up @@ -148,13 +190,21 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
3C69204C2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h in Headers */,
3CD6D01A298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h in Headers */,
3CF71C0E2A992DA2003A5CE5 /* MTRDataSource.h in Headers */,
3C26AC8C2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp in Headers */,
3CD73F1C2A9E8396009D82D1 /* MTRCommissionableDataProvider.h in Headers */,
3CF71C0A2A992D0D003A5CE5 /* MTRCastingApp.h in Headers */,
3CD73F172A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h in Headers */,
3CF71C102A99312D003A5CE5 /* MTRCommissionableData.h in Headers */,
3CD73F202A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h in Headers */,
3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */,
3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */,
3CCB8742286A593700771BAD /* ConversionUtils.hpp in Headers */,
3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */,
3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */,
3C6920462AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -256,18 +306,24 @@
files = (
3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */,
3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */,
3C6920482AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm in Sources */,
3CE5ECD02A673E2C007CF331 /* CommissioningCallbackHandlers.m in Sources */,
3CD73F192A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm in Sources */,
3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */,
3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */,
3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */,
3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */,
3CF71C0C2A992D25003A5CE5 /* MTRCastingApp.mm in Sources */,
3C4E53B028E4F28100F293E8 /* MediaPlaybackTypes.mm in Sources */,
3CD73F1E2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm in Sources */,
3CD73F222A9EA078009D82D1 /* MTRDeviceAttestationCredentials.mm in Sources */,
3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */,
3CE868F42946D76200FCB92B /* CommissionableDataProviderImpl.mm in Sources */,
3C26AC9329282B8100BA6881 /* DeviceAttestationCredentialsHolder.m in Sources */,
3C26AC902927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm in Sources */,
3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */,
3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */,
3CF71C122A993298003A5CE5 /* MTRCommissionableData.mm in Sources */,
3C4AE650286A7D4D005B52A4 /* OnboardingPayload.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -418,6 +474,7 @@
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = (
"${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common/include",
"${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common",
"$(CHIP_ROOT)/src",
"$(CHIP_ROOT)/src/include",
"$(CHIP_ROOT)/src/lib",
Expand Down Expand Up @@ -498,6 +555,7 @@
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = (
"${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common/include",
"${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common",
"$(CHIP_ROOT)/src",
"$(CHIP_ROOT)/src/include",
"$(CHIP_ROOT)/src/lib",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
*
* Copyright (c) 2023 Project CHIP Authors
*
* 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 "MTRDataSource.h"
#import "MatterError.h"

#ifndef MTRCastingApp_h
#define MTRCastingApp_h

/**
* @brief MTRCastingApp represents an app that can cast content to a Casting Player.
*/
@interface MTRCastingApp : NSObject

/**
* Returns a shared instance of the MTRCastingApp
*/
+ (MTRCastingApp * _Nullable)getSharedInstance;

/**
* @brief Initializes the MTRCastingApp with appParameters
*
* @param dataSource provides all the parameters required to initialize the MTRCastingApp
*/
- (MatterError * _Nonnull)initializeWithDataSource:(id<MTRDataSource> _Nonnull)dataSource;

/**
* @brief Starts the Matter server that the MTRCastingApp runs on and registers all the necessary delegates
*/
- (MatterError * _Nonnull)start;

/**
* @brief Stops the Matter server that the MTRCastingApp runs on
*/
- (MatterError * _Nonnull)stop;

@end

#endif /* MTRCastingApp_h */
Loading

0 comments on commit cd41f0b

Please sign in to comment.