summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kinney <michaelakinney@comcast.net>2021-01-28 14:54:27 -0500
committerMichael Kinney <michaelakinney@comcast.net>2021-01-28 14:54:27 -0500
commit0d13f0ed622b7418b703d591e1878a4ba77f694c (patch)
tree155fb809beacb7a899358651a36f6febdce38fb3
parentd81a887102fa0b948e8b4c057ed1e442a72d1bf2 (diff)
downloadsdl_ios-0d13f0ed622b7418b703d591e1878a4ba77f694c.tar.gz
update header api documentation
-rw-r--r--SmartDeviceLink/private/SDLIAPControlSession.h11
-rw-r--r--SmartDeviceLink/private/SDLIAPDataSession.h9
-rw-r--r--SmartDeviceLink/private/SDLIAPSession.h48
3 files changed, 44 insertions, 24 deletions
diff --git a/SmartDeviceLink/private/SDLIAPControlSession.h b/SmartDeviceLink/private/SDLIAPControlSession.h
index 5e65fbe25..8480358d8 100644
--- a/SmartDeviceLink/private/SDLIAPControlSession.h
+++ b/SmartDeviceLink/private/SDLIAPControlSession.h
@@ -7,6 +7,7 @@
//
#import <Foundation/Foundation.h>
+
#import "SDLIAPSession.h"
@class EAAccessory;
@@ -27,13 +28,15 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Creates a new control session.
*
- * @param accessory The accessory to connect to.
+ * @param accessory The accessory to connect to.
* @param delegate The control session delegate
* @return A SDLIAPControlSession object
*/
- (instancetype)initWithAccessory:(nullable EAAccessory *)accessory delegate:(id<SDLIAPControlSessionDelegate>)delegate forProtocol:(NSString *)protocol;
-// document
+/**
+ * Closes the SDLIAPSession used by the SDLIAPControlSession
+ */
- (void) closeSession;
/**
@@ -42,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (assign, nonatomic, readonly, getter=isSessionInProgress) BOOL sessionInProgress;
/**
- * The accessory with which to open a session.
+ * The accessory used to create and the EASession.
*/
@property (nullable, strong, nonatomic, readonly) EAAccessory *accessory;
@@ -54,5 +57,3 @@ NS_ASSUME_NONNULL_BEGIN
@end
NS_ASSUME_NONNULL_END
-
-
diff --git a/SmartDeviceLink/private/SDLIAPDataSession.h b/SmartDeviceLink/private/SDLIAPDataSession.h
index 6bae38efb..25b84ddab 100644
--- a/SmartDeviceLink/private/SDLIAPDataSession.h
+++ b/SmartDeviceLink/private/SDLIAPDataSession.h
@@ -43,17 +43,18 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithAccessory:(nullable EAAccessory *)accessory delegate:(id<SDLIAPDataSessionDelegate>)delegate forProtocol:(NSString *)protocol;
/**
+ * Closes the SDLIAPSession used by the SDLIAPControlSession
+ */
+- (void) closeSession;
+
+/**
* Sends data to Core via the data session.
*
* @param data The data to send to Core
*/
- (void)sendData:(NSData *)data;
-// document
-- (void) closeSession;
-
@end
NS_ASSUME_NONNULL_END
-
diff --git a/SmartDeviceLink/private/SDLIAPSession.h b/SmartDeviceLink/private/SDLIAPSession.h
index 96c0bb428..274db478e 100644
--- a/SmartDeviceLink/private/SDLIAPSession.h
+++ b/SmartDeviceLink/private/SDLIAPSession.h
@@ -28,21 +28,23 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (instancetype)initWithAccessory:(nullable EAAccessory *)accessory forProtocol:(NSString *)protocol iAPSessionDelegate:(id<SDLIAPSessionDelegate>)iAPSessionDelegate;
-// document
-- (void) closeSession;
-
-// document
-- (void)write:(NSMutableData *) data length: (NSUInteger) length withCompletionHandler:(void (^)(NSInteger bytesWritten))completionHandler;
-
/**
- * The accessory with which to open a session. Should be refactored to remove need to make this public
+ * The accessory that was used when creating a SLDLIAPSession instance.
*/
@property (nullable, strong, nonatomic, readonly) EAAccessory *accessory;
/**
- * The unique protocol string used to create the session with the accessory.
+ * @returns True if both inputStream and outputStream are open
*/
-@property (nullable, strong, nonatomic, readonly) NSString *protocolString;
+@property(readonly) BOOL bothStreamsOpen;
+
+/**
+ * Closes the EASession inputStream and the outputStream.
+ * Sets bothStreamsOpen flag to false.
+ * Stops SDLIAPSesssion operation by removing streams from the run loop
+ * By design a SDLIAPSession instance cannot be reopened.
+ */
+- (void) closeSession;
/**
* The unique ID assigned to the session between the app and accessory. If no session exists the value will be 0.
@@ -50,18 +52,34 @@ NS_ASSUME_NONNULL_BEGIN
@property (assign, nonatomic, readonly) NSUInteger connectionID;
/**
- * Returns whether the session has open I/O streams.
+ * @returns True if the outputStream has space available to write data
*/
-@property (assign, nonatomic, readonly, getter=isSessionInProgress) BOOL sessionInProgress;
-
-// document
@property(readonly) BOOL hasSpaceAvailable;
-@property(readonly) BOOL bothStreamsOpen;
+
+/**
+ * @returns True if the sessions EAAccessory is connected
+ */
@property(readonly) BOOL isConnected;
+/**
+ * @returns True if either the inputStream or the outputStream is open
+ */
+@property (assign, nonatomic, readonly, getter=isSessionInProgress) BOOL sessionInProgress;
+
+/**
+ * The unique protocol string used to create the session with the accessory.
+ */
+@property (nullable, strong, nonatomic, readonly) NSString *protocolString;
+
+/**
+ *
+ * @param data The data written to the EASession outputStream
+ * @param length The number of data bytes to write
+ * @param completionHandler The number of data bytes actually written
+ */
+- (void)write:(NSMutableData *) data length: (NSUInteger) length withCompletionHandler:(void (^)(NSInteger bytesWritten))completionHandler;
@end
NS_ASSUME_NONNULL_END
-