GCKCastChannel.h
1 // Copyright 2013 Google Inc.
2 
3 #import <GoogleCast/GCKDefines.h>
4 
5 #import <Foundation/Foundation.h>
6 
7 @class GCKError;
8 
9 GCK_ASSUME_NONNULL_BEGIN
10 
24 GCK_EXPORT
25 @interface GCKCastChannel : NSObject
26 
28 @property(nonatomic, copy, readonly) NSString *protocolNamespace;
29 
31 @property(nonatomic, assign, readonly) BOOL isConnected;
32 
38 @property(nonatomic, assign, readonly) BOOL isWritable;
39 
45 - (instancetype)initWithNamespace:(NSString *)protocolNamespace;
46 
50 - (instancetype)init NS_UNAVAILABLE;
51 
58 - (void)didReceiveTextMessage:(NSString *)message;
59 
67 - (BOOL)sendTextMessage:(NSString *)message
68  error:(GCKError *GCK_NULLABLE_TYPE *GCK_NULLABLE_TYPE)error;
69 
75 - (NSInteger)generateRequestID;
76 
83 - (NSNumber * GCK_NULLABLE_TYPE)generateRequestNumber;
84 
89 - (void)didConnect;
90 
95 - (void)didDisconnect;
96 
105 - (void)didChangeWritableState:(BOOL)isWritable;
106 
107 @end
108 
109 GCK_ASSUME_NONNULL_END
A subclass of NSError for framework errors.
Definition: GCKError.h:366
instancetype NS_UNAVAILABLE()
Default initializer is not available.
NSString * protocolNamespace
The channel&#39;s namespace.
Definition: GCKCastChannel.h:28
BOOL isWritable
A flag indicating whether this channel is currently writable.
Definition: GCKCastChannel.h:38
BOOL isConnected
A flag indicating whether this channel is currently connected.
Definition: GCKCastChannel.h:31
void didDisconnect()
Called when this channel has been disconnected, indicating that messages can no longer be exchanged w...
A virtual communication channel for exchanging messages between a Cast sender and a Cast receiver...
Definition: GCKCastChannel.h:25
void didConnect()
Called when this channel has been connected, indicating that messages can now be exchanged with the C...
NSInteger generateRequestID()
Generates a request ID for a new message.
NSNumber *GCK_NULLABLE_TYPE generateRequestNumber()
A convenience method which wraps the result of generateRequestID in an NSNumber.