diff options
author | NicoleYarroch <nicole@livio.io> | 2018-05-22 15:56:33 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2018-05-22 15:56:33 -0400 |
commit | 6f9e82f4a04dc2bea55fedd087ce5afa855c6923 (patch) | |
tree | b3e2d8898242421427f0b37ddf0f24f65eae7be8 | |
parent | 59dafb6a7250fce40d866cde16e5f03d974f4869 (diff) | |
download | sdl_ios-6f9e82f4a04dc2bea55fedd087ce5afa855c6923.tar.gz |
Added documentation to SDLProtocol
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r-- | SmartDeviceLink/SDLProtocol.h | 79 |
1 files changed, 77 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLProtocol.h b/SmartDeviceLink/SDLProtocol.h index 8567c0cf5..15e620dbc 100644 --- a/SmartDeviceLink/SDLProtocol.h +++ b/SmartDeviceLink/SDLProtocol.h @@ -24,22 +24,97 @@ extern NSString *const SDLProtocolSecurityErrorDomain; @interface SDLProtocol : NSObject <SDLProtocolListener, SDLTransportDelegate> +/** + * Deprecated debug logging tool. + */ @property (strong, nonatomic) NSString *debugConsoleGroupName; + +/** + * The transport layer for sending data between the app and Core + */ @property (nullable, weak, nonatomic) id<SDLTransportType> transport; + +/** + * A table for tracking all subscribed listeners + */ @property (nullable, strong, nonatomic) NSHashTable<id<SDLProtocolListener>> *protocolDelegateTable; + +/** + * A security manager for sending encrypted data. + */ @property (nullable, nonatomic, strong) id<SDLSecurityType> securityManager; + +/** + * The app's id + */ @property (nonatomic, copy) NSString *appId; -// Sending +#pragma mark - Sending + +/** + * Sends a start service message to Core + * + * @param serviceType A SDLServiceType object + * @param payload The data to send in the message + */ - (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload; + +/** + * Sends a secure start service message to Core + * + * @param serviceType A SDLServiceType object + * @param payload The data to send in the message + * @param completionHandler The handler is called when the secure service is started. If a secure service can not be started, an error message is also returned + */ - (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler; + +/** + * Sends an end service message to Core + * + * @param serviceType A SDLServiceType object + */ - (void)endServiceWithType:(SDLServiceType)serviceType; + +/** + * Sends an unencrypted RPC to Core + * + * @param message A SDLRPCMessage message + */ - (void)sendRPC:(SDLRPCMessage *)message; + +/** + * Sends an RPC to Core + * + * @param message A SDLRPCMessage message + * @param encryption Whether or not the message should be encrypted + * @param error A pointer to a NSError object + * @return YES if the message was created successfully, NO if not + */ - (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError **)error; + +/** + * Sends an unencrypted message to Core + * + * @param data The data to send + * @param serviceType A SDLServiceType object + */ - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; + +/** + * Sends an encrypted message to Core + * + * @param data The data to send + * @param serviceType A SDLServiceType object + */ - (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType; -// Recieving +#pragma mark - Recieving + +/** + * Turns received bytes into message objects. + * + * @param receivedData The data received from Core + */ - (void)handleBytesFromTransport:(NSData *)receivedData; @end |