Skip to content

Commit

Permalink
Merge pull request #1463 from smartdevicelink/bugfix/issue-1240-rever…
Browse files Browse the repository at this point in the history
…t-tweak-iap-transport-delay

Revert removing the data session delay
  • Loading branch information
joeljfischer committed Oct 28, 2019
2 parents 54700f0 + 6c3cccd commit ffc68af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
3 changes: 0 additions & 3 deletions SmartDeviceLink/SDLIAPDataSession.m
Expand Up @@ -110,9 +110,6 @@ - (void)sdl_stopAndDestroySession {
[self sdl_isIOThreadCanceled:self.canceledSemaphore completionHandler:^(BOOL success) {
if (success == NO) {
SDLLogE(@"Destroying thread (IOStreamThread) for data session when I/O streams have not yet closed.");

// FIX: Try to close the session if the canceledSemaphore is never triggered by the `sdl_accessoryEventLoop`
[self sdl_closeSession];
}
self.ioStreamThread = nil;
[super cleanupClosedSession];
Expand Down
14 changes: 5 additions & 9 deletions SmartDeviceLink/SDLIAPTransport.m
Expand Up @@ -98,8 +98,11 @@ - (void)sdl_accessoryConnected:(NSNotification *)notification {
return;
}

double retryDelay = self.sdl_retryDelay;
SDLLogD(@"Accessory Connected (%@), Opening in %0.03fs", notification.userInfo[EAAccessoryKey], retryDelay);

self.retryCounter = 0;
[self sdl_connect:newAccessory];
[self performSelector:@selector(sdl_connect:) withObject:nil afterDelay:retryDelay];
}

/**
Expand Down Expand Up @@ -501,21 +504,14 @@ - (BOOL)createSessionWithAccessory:(EAAccessory *)accessory protocolString:(NSSt

if ([protocolString isEqualToString:MultiSessionProtocolString] && SDL_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9")) {
self.dataSession = [[SDLIAPDataSession alloc] initWithAccessory:accessory delegate:self forProtocol:protocolString];

SDLLogD(@"Accessory Connected (%@), Opening immediately", accessory);
[self.dataSession startSession];
return YES;
} else if ([protocolString isEqualToString:ControlProtocolString]) {
self.controlSession = [[SDLIAPControlSession alloc] initWithAccessory:accessory delegate:self];

double retryDelay = [self sdl_retryDelay];
SDLLogD(@"Accessory Connected (%@), Opening in %0.03fs", accessory, retryDelay);
[self.controlSession performSelector:@selector(startSession) withObject:nil afterDelay:retryDelay];
[self.controlSession startSession];
return YES;
} else if ([protocolString isEqualToString:LegacyProtocolString]) {
self.dataSession = [[SDLIAPDataSession alloc] initWithAccessory:accessory delegate:self forProtocol:protocolString];

SDLLogD(@"Accessory Connected (%@), Opening immediately", accessory);
[self.dataSession startSession];
return YES;
}
Expand Down

0 comments on commit ffc68af

Please sign in to comment.