diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-08-15 10:50:46 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-08-15 10:50:46 -0400 |
commit | 671277a6b34b74cc4ccc981cf4f04c9714f51020 (patch) | |
tree | 3d5bd91e50c400565130ff3e84162646c8cdf1f6 | |
parent | 36f4db82a593b93d95854051af5475d32f360d70 (diff) | |
download | sdl_ios-feature/616_constructed_payloads.tar.gz |
Fixes for protocol payload NAK incorrect parsingfeature/616_constructed_payloads
* Fixes SMM starts
* Fix Audio start service ack having an extra private parameter
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadNak.m | 3 | ||||
-rw-r--r-- | SmartDeviceLink/SDLProtocol.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLStreamingMediaManager.h | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLStreamingMediaManager.m | 8 |
5 files changed, 9 insertions, 7 deletions
diff --git a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m index 44db4d33b..ac969d07b 100644 --- a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m +++ b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m @@ -17,7 +17,6 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLControlFramePayloadAudioStartServiceAck () @property (assign, nonatomic, readwrite) int64_t mtu; -@property (copy, nonatomic, readwrite, nullable) NSString *protocolVersion; @end diff --git a/SmartDeviceLink/SDLControlFramePayloadNak.m b/SmartDeviceLink/SDLControlFramePayloadNak.m index 2c353cbf8..4402dea47 100644 --- a/SmartDeviceLink/SDLControlFramePayloadNak.m +++ b/SmartDeviceLink/SDLControlFramePayloadNak.m @@ -72,6 +72,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)sdl_parse:(NSData *)data { BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes); BsonArray *arrayObject = bson_object_get_array(&payloadObject, SDLControlFrameRejectedParams); + if (arrayObject == NULL) { + return; + } NSMutableArray<NSString *> *rejectedParams = [NSMutableArray array]; char *paramString; diff --git a/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink/SDLProtocol.m index 0238db5ad..0596f24db 100644 --- a/SmartDeviceLink/SDLProtocol.m +++ b/SmartDeviceLink/SDLProtocol.m @@ -593,7 +593,7 @@ typedef NSNumber SDLServiceTypeBox; - (void)sdl_logControlNAKPayload:(SDLProtocolMessage *)nakMessage { if (nakMessage.header.version >= 5) { - SDLControlFramePayloadNak *endServiceNakPayload = [[SDLControlFramePayloadNak alloc] initWithData:nakMessage.data]; + SDLControlFramePayloadNak *endServiceNakPayload = [[SDLControlFramePayloadNak alloc] initWithData:nakMessage.payload]; NSArray<NSString *> *rejectedParams = endServiceNakPayload.rejectedParams; if (rejectedParams.count > 0) { NSString *log = [NSString stringWithFormat:@"Start Service NAK'd, service type: %@, rejectedParams: %@", @(nakMessage.header.serviceType), rejectedParams]; diff --git a/SmartDeviceLink/SDLStreamingMediaManager.h b/SmartDeviceLink/SDLStreamingMediaManager.h index 214c32c55..f9689f828 100644 --- a/SmartDeviceLink/SDLStreamingMediaManager.h +++ b/SmartDeviceLink/SDLStreamingMediaManager.h @@ -138,7 +138,7 @@ typedef void (^SDLStreamingEncryptionStartBlock)(BOOL success, BOOL encryption, @param codec The codec requested to be used @param startBlock A block that will be called with the result of attempting to start a video session */ -- (void)startVideoSessionWithTLS:(SDLEncryptionFlag)encryptionFlag height:(int32_t)height width:(int32_t)width protocol:(nullable SDLVideoStreamingProtocol *)protocol codec:(nullable SDLVideoStreamingCodec *)codec startBlock:(SDLStreamingEncryptionStartBlock)startBlock; +- (void)startVideoSessionWithTLS:(SDLEncryptionFlag)encryptionFlag height:(int32_t)height width:(int32_t)width startBlock:(SDLStreamingEncryptionStartBlock)startBlock; /** * This method will stop a running video session if there is one running. diff --git a/SmartDeviceLink/SDLStreamingMediaManager.m b/SmartDeviceLink/SDLStreamingMediaManager.m index b53621801..ff9d9d319 100644 --- a/SmartDeviceLink/SDLStreamingMediaManager.m +++ b/SmartDeviceLink/SDLStreamingMediaManager.m @@ -121,17 +121,17 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Streaming media lifecycle - (void)startVideoSessionWithStartBlock:(SDLStreamingStartBlock)startBlock { - [self startVideoSessionWithHeight:SDLControlFrameInt32NotFound width:SDLControlFrameInt32NotFound protocol:nil codec:nil startBlock:startBlock]; + [self startVideoSessionWithHeight:SDLControlFrameInt32NotFound width:SDLControlFrameInt32NotFound startBlock:startBlock]; } -- (void)startVideoSessionWithHeight:(int32_t)height width:(int32_t)width protocol:(nullable SDLVideoStreamingProtocol *)protocol codec:(nullable SDLVideoStreamingCodec *)codec startBlock:(SDLStreamingStartBlock)startBlock { - [self startVideoSessionWithTLS:SDLEncryptionFlagNone height:height width:width protocol:protocol codec:codec startBlock:^(BOOL success, BOOL encryption, NSError *_Nullable error) { +- (void)startVideoSessionWithHeight:(int32_t)height width:(int32_t)width startBlock:(SDLStreamingStartBlock)startBlock { + [self startVideoSessionWithTLS:SDLEncryptionFlagNone height:height width:width startBlock:^(BOOL success, BOOL encryption, NSError *_Nullable error) { startBlock(success, error); }]; } - (void)startVideoSessionWithTLS:(SDLEncryptionFlag)encryptionFlag startBlock:(SDLStreamingEncryptionStartBlock)startBlock { - [self startVideoSessionWithTLS:encryptionFlag height:SDLControlFrameInt32NotFound width:SDLControlFrameInt32NotFound protocol:nil codec:nil startBlock:startBlock]; + [self startVideoSessionWithTLS:encryptionFlag height:SDLControlFrameInt32NotFound width:SDLControlFrameInt32NotFound startBlock:startBlock]; } - (void)startVideoSessionWithTLS:(SDLEncryptionFlag)encryptionFlag height:(int32_t)height width:(int32_t)width startBlock:(SDLStreamingEncryptionStartBlock)startBlock { |