Skip to content

Instantly share code, notes, and snippets.

@zenom
Created February 21, 2015 22:12
Show Gist options
  • Save zenom/d3b055324e6bd3090967 to your computer and use it in GitHub Desktop.
Save zenom/d3b055324e6bd3090967 to your computer and use it in GitHub Desktop.
ORSSerialRequest *request =
[ORSSerialRequest requestWithDataToSend:requestData
userInfo:nil
timeoutInterval:2.0
responseEvaluator:^BOOL(NSData *inputData) {
if ([inputData length] != 8) return NO;
NSData *headerData = [inputData subdataWithRange:NSMakeRange(0, 4)];
NSString *header = [[NSString alloc] initWithData:headerData encoding:NSASCIIStringEncoding];
return [header isEqualToString:@"data"];
}];
let request = ORSSerialRequest(dataToSend: NSData!, userInfo: nil, timeoutInterval: 2.0,
responseEvaluator: (inputData: NSData!) in { return true})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment