Created
February 21, 2015 22:12
-
-
Save zenom/d3b055324e6bd3090967 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]; | |
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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