summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2018-05-23 09:25:10 -0400
committerNicoleYarroch <nicole@livio.io>2018-05-23 09:25:10 -0400
commita6c65f21bd79e47926cc908d5c7935b3b3b93cc6 (patch)
tree71daa6966c8322986074a27620dfae38a9ab7d01
parent9cc36ade385f5d7f05422bb04fbab76bea2f383c (diff)
downloadsdl_ios-a6c65f21bd79e47926cc908d5c7935b3b3b93cc6.tar.gz
Added documentation to the SDLProxy class
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLink/SDLProtocol.h2
-rw-r--r--SmartDeviceLink/SDLProxy.h87
2 files changed, 81 insertions, 8 deletions
diff --git a/SmartDeviceLink/SDLProtocol.h b/SmartDeviceLink/SDLProtocol.h
index 7c7b71df9..35055fbf6 100644
--- a/SmartDeviceLink/SDLProtocol.h
+++ b/SmartDeviceLink/SDLProtocol.h
@@ -40,7 +40,7 @@ extern NSString *const SDLProtocolSecurityErrorDomain;
@property (nullable, weak, nonatomic) id<SDLTransportType> transport;
/**
- * A table for tracking all subscribed listeners
+ * A table for tracking all subscribers
*/
@property (nullable, strong, nonatomic) NSHashTable<id<SDLProtocolListener>> *protocolDelegateTable;
diff --git a/SmartDeviceLink/SDLProxy.h b/SmartDeviceLink/SDLProxy.h
index 7c702c9e5..2863eef23 100644
--- a/SmartDeviceLink/SDLProxy.h
+++ b/SmartDeviceLink/SDLProxy.h
@@ -20,36 +20,109 @@ NS_ASSUME_NONNULL_BEGIN
BOOL _isConnected;
}
+/**
+ * The protocol that handles sending and receiving messages from Core.
+ */
@property (nullable, strong, nonatomic) SDLProtocol *protocol;
+
+/**
+ * The transport type used to connect the app to Core.
+ */
@property (nullable, strong, nonatomic) id<SDLTransportType> transport;
+
+/**
+ * A set of all subscribers.
+ */
@property (readonly, copy, nonatomic) NSSet<NSObject<SDLProxyListener> *> *proxyListeners;
+
+/**
+ * Closes an open session if no start service ACK message received from Core within a given amount of time.
+ */
@property (strong, nonatomic) SDLTimer *startSessionTimer;
+
+/**
+ * The proxy version number.
+ */
@property (readonly, copy, nonatomic) NSString *proxyVersion;
+/**
+ * Convenience init.
+ *
+ * @param transport The type of network connection
+ * @param delegate The subscriber
+ * @return A SDLProxy object
+ */
- (id)initWithTransport:(id<SDLTransportType>)transport delegate:(id<SDLProxyListener>)delegate;
+/**
+ * Creates a SDLProxy object with an iap (USB / Bluetooth) transport network connection.
+ *
+ * @param delegate The subscriber
+ * @return A SDLProxy object
+ */
+ (SDLProxy *)iapProxyWithListener:(id<SDLProxyListener>)delegate;
+
+/**
+ * Creates a SDLProxy object with a TCP (WiFi) transport network connection.
+ *
+ * @param delegate The subscriber
+ * @param ipaddress The IP address of Core
+ * @param port The port address of Core
+ * @return A SDLProxy object
+ */
+ (SDLProxy *)tcpProxyWithListener:(id<SDLProxyListener>)delegate tcpIPAddress:(NSString *)ipaddress tcpPort:(NSString *)port;
+/**
+ * Adds a delegate.
+ *
+ * @param delegate The delegate to add
+ */
- (void)addDelegate:(NSObject<SDLProxyListener> *)delegate;
+
+/**
+ * Removes a delegate.
+ *
+ * @param delegate The delegate to remove
+ */
- (void)removeDelegate:(NSObject<SDLProxyListener> *)delegate;
+/**
+ * Sends a RPC to Core.
+ *
+ * @param message A SDLRPCMessage object
+ */
- (void)sendRPC:(SDLRPCMessage *)message;
+/**
+ * Parses a dictionary object and notifies the subscribed delegates of the messages sent by Core. Some messages are also intercepted and handled by the library.
+ *
+ * @param dictionary The message data
+ */
- (void)handleRPCDictionary:(NSDictionary<NSString *, id> *)dictionary;
+/**
+ * Parses a SDLProtocolMessage object and notifies the subscribed delegates of the messages sent by Core. Some messages are also intercepted and handled by the library.
+ *
+ * @param msgData The message data
+ */
- (void)handleProtocolMessage:(SDLProtocolMessage *)msgData;
+/**
+ * Adds the security manangers needed to send encrypted data.
+ *
+ * @param securityManagerClasses The security manager classes
+ * @param appId The app's id
+ */
- (void)addSecurityManagers:(NSArray<Class> *)securityManagerClasses forAppId:(NSString *)appId;
/**
- * Puts data into a file on the module
- * Performs a putFile for a given input stream, performed in chunks, for handling very large files.
- * @param inputStream A stream containing the data to put to the module.
- * @param putFileRPCRequest A SDLPutFile object containing the parameters for the put(s)
- * @discussion The proxy will read from the stream based on the max MTU size and send them in individual putFile requests.
- * This may result in multiple responses being received, one for each request.
- * Note: the length parameter of the putFileRPCRequest will be ignored. The proxy will substitute the number of bytes read from the stream.
+ * Puts data into a file on the module. Performs a putFile for a given input stream, performed in chunks, for handling very large files.
+ *
+ * @param inputStream A stream containing the data to put to the module.
+ * @param putFileRPCRequest A SDLPutFile object containing the parameters for the put(s)
+ *
+ * @discussion: The proxy will read from the stream based on the max MTU size and send them in individual putFile requests. This may result in multiple responses being received, one for each request.
+ * @note: The length parameter of the putFileRPCRequest will be ignored. The proxy will substitute the number of bytes read from the stream.
*/
- (void)putFileStream:(NSInputStream *)inputStream withRequest:(SDLPutFile *)putFileRPCRequest;