Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert removing the data session delay #1463

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions SmartDeviceLink/SDLIAPDataSession.m
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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