diff options
author | NicoleYarroch <nicole@livio.io> | 2019-01-28 15:38:17 -0500 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2019-01-28 15:38:17 -0500 |
commit | 2c068fea7d6deed127741a36ce7db6887dc8cb6b (patch) | |
tree | 3bbcb2dd59f454f1835ded6f12001a232c3f7df3 | |
parent | 526cb1f5214a9c0969f2bc12e72d7cceb0674669 (diff) | |
download | sdl_ios-bugfix/issue_1079_iAP_to_Bluetooth_Fails.tar.gz |
Reverted changes made to the iAP transport classesbugfix/issue_1079_iAP_to_Bluetooth_Fails
-rw-r--r-- | SmartDeviceLink/SDLIAPSession.m | 14 | ||||
-rw-r--r-- | SmartDeviceLink/SDLIAPTransport.m | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/SmartDeviceLink/SDLIAPSession.m b/SmartDeviceLink/SDLIAPSession.m index 526c76cb9..4828ee9e0 100644 --- a/SmartDeviceLink/SDLIAPSession.m +++ b/SmartDeviceLink/SDLIAPSession.m @@ -64,11 +64,11 @@ NSTimeInterval const StreamThreadWaitSecs = 10.0; strongSelf.streamDelegate.streamErrorHandler = [strongSelf streamErroredHandler]; strongSelf.streamDelegate.streamOpenHandler = [strongSelf streamOpenedHandler]; if (strongSelf.isDataSession) { - strongSelf.streamDelegate.streamHasSpaceHandler = [strongSelf sdl_streamHasSpaceHandler]; + self.streamDelegate.streamHasSpaceHandler = [self sdl_streamHasSpaceHandler]; // Start I/O event loop processing events in iAP channel - strongSelf.ioStreamThread = [[NSThread alloc] initWithTarget:strongSelf selector:@selector(sdl_accessoryEventLoop) object:nil]; - [strongSelf.ioStreamThread setName:IOStreamThreadName]; - [strongSelf.ioStreamThread start]; + self.ioStreamThread = [[NSThread alloc] initWithTarget:self selector:@selector(sdl_accessoryEventLoop) object:nil]; + [self.ioStreamThread setName:IOStreamThreadName]; + [self.ioStreamThread start]; } else { // Set up control session -- no need for its own thread [self startStream:self.easession.outputStream]; @@ -92,14 +92,12 @@ NSTimeInterval const StreamThreadWaitSecs = 10.0; NSAssert(NSThread.isMainThread, @"%@ must only be called on the main thread", NSStringFromSelector(_cmd)); if (self.isDataSession) { [self.ioStreamThread cancel]; - __weak typeof(self) weakSelf = self; [self sdl_isIOThreadCanceled:self.canceledSemaphore completionHandler:^(BOOL success) { - __strong typeof(self) strongSelf = weakSelf; if (success == NO) { SDLLogE(@"Things are going to go seriously wrong"); } - strongSelf.ioStreamThread = nil; - strongSelf.isDataSession = NO; + self.ioStreamThread = nil; + self.isDataSession = NO; }]; } else { // Stop control session diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m index a168f590a..88632a664 100644 --- a/SmartDeviceLink/SDLIAPTransport.m +++ b/SmartDeviceLink/SDLIAPTransport.m @@ -177,7 +177,9 @@ int const ProtocolIndexTimeoutSeconds = 10; if (accessory.connectionID != self.session.accessory.connectionID) { SDLLogV(@"Accessory disconnected during control session (%@)", accessory); self.retryCounter = 0; - } else if ([accessory.serialNumber isEqualToString:self.session.accessory.serialNumber]) { + } + + if ([accessory.serialNumber isEqualToString:self.session.accessory.serialNumber]) { SDLLogV(@"Accessory disconnected during data session (%@)", accessory); [self sdl_destroySession]; } @@ -361,8 +363,8 @@ int const ProtocolIndexTimeoutSeconds = 10; } else { // We have surpassed the number of retries allowed - SDLLogW(@"Surpassed allowed retry attempts...Destroying the session"); - [self sdl_destroySession]; + SDLLogW(@"Surpassed allowed retry attempts."); + self.sessionSetupInProgress = NO; } } |