Skip to content

Commit

Permalink
iOS tv-casting-app: simplified discovery and connection APIs (project…
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadb-amazon authored Jan 8, 2024
1 parent 19ba3d9 commit cd14b8a
Show file tree
Hide file tree
Showing 40 changed files with 1,952 additions and 272 deletions.
293 changes: 279 additions & 14 deletions examples/tv-casting-app/APIs.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
objects = {

/* Begin PBXBuildFile section */
3C0474062B3F7E5F0012AE95 /* MTREndpointFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C0474052B3F7E5F0012AE95 /* MTREndpointFilter.h */; };
3C04740C2B4604CF0012AE95 /* MTRCryptoUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C04740B2B4604CF0012AE95 /* MTRCryptoUtils.h */; };
3C04740E2B4605B40012AE95 /* MTRCryptoUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C04740D2B4605B40012AE95 /* MTRCryptoUtils.mm */; };
3C2346212B362B4F00FA276E /* MTRCastingPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C2346202B362B4F00FA276E /* MTRCastingPlayer.h */; };
3C2346232B362B9500FA276E /* MTRCastingPlayerDiscovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C2346222B362B9500FA276E /* MTRCastingPlayerDiscovery.h */; };
3C2346252B362BBB00FA276E /* MTRCastingPlayerDiscovery.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C2346242B362BBB00FA276E /* MTRCastingPlayerDiscovery.mm */; };
3C2696FB2B4A5FC50026E771 /* MTREndpointFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C2696FA2B4A5FC50026E771 /* MTREndpointFilter.m */; };
3C26AC8C2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3C26AC8B2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp */; };
3C26AC902927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C26AC8F2927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm */; };
3C26AC9329282B8100BA6881 /* DeviceAttestationCredentialsHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C26AC9229282B8100BA6881 /* DeviceAttestationCredentialsHolder.m */; };
Expand All @@ -20,6 +27,8 @@
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 */; };
3C9437922B3B478E0096E5F4 /* MTRErrorUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C9437912B3B478E0096E5F4 /* MTRErrorUtils.h */; };
3C9437942B3B47A10096E5F4 /* MTRErrorUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C9437932B3B47A10096E5F4 /* MTRErrorUtils.mm */; };
3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8735286A555500771BAD /* libTvCastingCommon.a */; };
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8736286A555500771BAD /* libmbedtls.a */; settings = {ATTRIBUTES = (Required, ); }; };
Expand Down Expand Up @@ -48,7 +57,14 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
3C0474052B3F7E5F0012AE95 /* MTREndpointFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTREndpointFilter.h; sourceTree = "<group>"; };
3C04740B2B4604CF0012AE95 /* MTRCryptoUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCryptoUtils.h; sourceTree = "<group>"; };
3C04740D2B4605B40012AE95 /* MTRCryptoUtils.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCryptoUtils.mm; sourceTree = "<group>"; };
3C0D9CDF2920A30C00D3332B /* CommissionableDataProviderImpl.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = CommissionableDataProviderImpl.hpp; sourceTree = "<group>"; };
3C2346202B362B4F00FA276E /* MTRCastingPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCastingPlayer.h; sourceTree = "<group>"; };
3C2346222B362B9500FA276E /* MTRCastingPlayerDiscovery.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCastingPlayerDiscovery.h; sourceTree = "<group>"; };
3C2346242B362BBB00FA276E /* MTRCastingPlayerDiscovery.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCastingPlayerDiscovery.mm; sourceTree = "<group>"; };
3C2696FA2B4A5FC50026E771 /* MTREndpointFilter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MTREndpointFilter.m; sourceTree = "<group>"; };
3C26AC8B2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = DeviceAttestationCredentialsProviderImpl.hpp; sourceTree = "<group>"; };
3C26AC8F2927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceAttestationCredentialsProviderImpl.mm; sourceTree = "<group>"; };
3C26AC91292700AD00BA6881 /* DeviceAttestationCredentialsHolder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DeviceAttestationCredentialsHolder.h; sourceTree = "<group>"; };
Expand All @@ -69,6 +85,9 @@
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>"; };
3C81C75128F7A7DF001CB9D1 /* VideoPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VideoPlayer.h; sourceTree = "<group>"; };
3C9437882B364F5E0096E5F4 /* MTRCastingPlayer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCastingPlayer.mm; sourceTree = "<group>"; };
3C9437912B3B478E0096E5F4 /* MTRErrorUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRErrorUtils.h; sourceTree = "<group>"; };
3C9437932B3B47A10096E5F4 /* MTRErrorUtils.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRErrorUtils.mm; sourceTree = "<group>"; };
3CA1CA7728E243750023ED44 /* MediaPlaybackTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTypes.h; sourceTree = "<group>"; };
3CCB871D2869085400771BAD /* MatterTvCastingBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MatterTvCastingBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3CCB87202869085400771BAD /* MatterTvCastingBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterTvCastingBridge.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -112,6 +131,27 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
3C94378A2B3654720096E5F4 /* Core */ = {
isa = PBXGroup;
children = (
);
path = Core;
sourceTree = "<group>";
};
3C94378B2B36547A0096E5F4 /* Support */ = {
isa = PBXGroup;
children = (
);
path = Support;
sourceTree = "<group>";
};
3C94378C2B3654960096E5F4 /* Clusters */ = {
isa = PBXGroup;
children = (
);
path = Clusters;
sourceTree = "<group>";
};
3CCB87132869085400771BAD = {
isa = PBXGroup;
children = (
Expand All @@ -133,9 +173,18 @@
3CCB871F2869085400771BAD /* MatterTvCastingBridge */ = {
isa = PBXGroup;
children = (
3C94378A2B3654720096E5F4 /* Core */,
3C94378B2B36547A0096E5F4 /* Support */,
3C94378C2B3654960096E5F4 /* Clusters */,
3CCB87202869085400771BAD /* MatterTvCastingBridge.h */,
3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */,
3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */,
3C2346222B362B9500FA276E /* MTRCastingPlayerDiscovery.h */,
3C2346242B362BBB00FA276E /* MTRCastingPlayerDiscovery.mm */,
3C2346202B362B4F00FA276E /* MTRCastingPlayer.h */,
3C9437882B364F5E0096E5F4 /* MTRCastingPlayer.mm */,
3C0474052B3F7E5F0012AE95 /* MTREndpointFilter.h */,
3C2696FA2B4A5FC50026E771 /* MTREndpointFilter.m */,
3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */,
3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */,
3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */,
Expand All @@ -148,6 +197,12 @@
3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */,
3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */,
3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */,
3CF8532528E37ED800F07B9F /* MatterError.h */,
3CF8532628E37F1000F07B9F /* MatterError.mm */,
3C9437912B3B478E0096E5F4 /* MTRErrorUtils.h */,
3C9437932B3B47A10096E5F4 /* MTRErrorUtils.mm */,
3C04740B2B4604CF0012AE95 /* MTRCryptoUtils.h */,
3C04740D2B4605B40012AE95 /* MTRCryptoUtils.mm */,
3CCB873A286A593700771BAD /* CastingServerBridge.h */,
3CCB873D286A593700771BAD /* CastingServerBridge.mm */,
3C66FBFA2903279A00B63FE7 /* AppParameters.h */,
Expand All @@ -162,8 +217,6 @@
3C81C74B28F7A777001CB9D1 /* ContentApp.mm */,
3C81C75128F7A7DF001CB9D1 /* VideoPlayer.h */,
3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */,
3CF8532528E37ED800F07B9F /* MatterError.h */,
3CF8532628E37F1000F07B9F /* MatterError.mm */,
3C4E53B428E5593700F293E8 /* ContentLauncherTypes.h */,
3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */,
3CA1CA7728E243750023ED44 /* MediaPlaybackTypes.h */,
Expand Down Expand Up @@ -191,6 +244,8 @@
buildActionMask = 2147483647;
files = (
3C69204C2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h in Headers */,
3C2346212B362B4F00FA276E /* MTRCastingPlayer.h in Headers */,
3C2346232B362B9500FA276E /* MTRCastingPlayerDiscovery.h in Headers */,
3CD6D01A298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h in Headers */,
3CF71C0E2A992DA2003A5CE5 /* MTRDataSource.h in Headers */,
3C26AC8C2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp in Headers */,
Expand All @@ -202,9 +257,12 @@
3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */,
3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */,
3CCB8742286A593700771BAD /* ConversionUtils.hpp in Headers */,
3C9437922B3B478E0096E5F4 /* MTRErrorUtils.h in Headers */,
3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */,
3C0474062B3F7E5F0012AE95 /* MTREndpointFilter.h in Headers */,
3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */,
3C6920462AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h in Headers */,
3C04740C2B4604CF0012AE95 /* MTRCryptoUtils.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -315,13 +373,17 @@
3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */,
3CF71C0C2A992D25003A5CE5 /* MTRCastingApp.mm in Sources */,
3C4E53B028E4F28100F293E8 /* MediaPlaybackTypes.mm in Sources */,
3C04740E2B4605B40012AE95 /* MTRCryptoUtils.mm in Sources */,
3CD73F1E2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm in Sources */,
3CD73F222A9EA078009D82D1 /* MTRDeviceAttestationCredentials.mm in Sources */,
3C2346252B362BBB00FA276E /* MTRCastingPlayerDiscovery.mm in Sources */,
3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */,
3C9437942B3B47A10096E5F4 /* MTRErrorUtils.mm in Sources */,
3CE868F42946D76200FCB92B /* CommissionableDataProviderImpl.mm in Sources */,
3C26AC9329282B8100BA6881 /* DeviceAttestationCredentialsHolder.m in Sources */,
3C26AC902927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm in Sources */,
3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */,
3C2696FB2B4A5FC50026E771 /* MTREndpointFilter.m in Sources */,
3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */,
3CF71C122A993298003A5CE5 /* MTRCommissionableData.mm in Sources */,
3C4AE650286A7D4D005B52A4 /* OnboardingPayload.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,41 @@
*/
+ (MTRCastingApp * _Nullable)getSharedInstance;

- (dispatch_queue_t _Nullable)getWorkQueue;

- (dispatch_queue_t _Nullable)getClientQueue;

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

/**
* @brief (async) Starts the Matter server that the MTRCastingApp runs on and registers all the necessary delegates
*/
- (void)startWithCompletionBlock:(void (^_Nonnull __strong)(NSError * _Nullable __strong))completion;

/**
* @brief (async) Stops the Matter server that the MTRCastingApp runs on
*/
- (void)stopWithCompletionBlock:(void (^_Nonnull __strong)(NSError * _Nullable __strong))completion;

/**
* @brief true, if MTRCastingApp is running. false otherwise
*/
- (bool)isRunning;

/**
* @brief Starts the Matter server that the MTRCastingApp runs on and registers all the necessary delegates
* @brief Tears down all active subscriptions.
*/
- (MatterError * _Nonnull)start;
- (NSError * _Nullable)ShutdownAllSubscriptions;

/**
* @brief Stops the Matter server that the MTRCastingApp runs on
* @brief Clears app cache that contains the information about CastingPlayers previously connected to
*/
- (MatterError * _Nonnull)stop;
- (NSError * _Nullable)ClearCache;

@end

Expand Down
Loading

0 comments on commit cd14b8a

Please sign in to comment.