Created
April 18, 2011 23:53
-
-
Save mgile/926548 to your computer and use it in GitHub Desktop.
OBD2Kit Handling the delegate for responses
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
- (void)scanTool:(FLScanTool*)scanTool didReceiveResponse:(NSArray*)responses { | |
[responses retain]; | |
FLECUSensor* sensor = nil; | |
for (FLScanToolResponse* response in responses) { | |
sensor = [FLECUSensor sensorForPID:response.pid]; | |
[sensor setCurrentResponse:response]; | |
if (response.pid == 0x0C) { | |
// Update RPM Display | |
rpmLabel.text = [NSString stringWithFormat:@"%@ %@", [sensor valueStringForMeasurement1:NO], [sensor imperialUnitString]]; | |
[rpmLabel setNeedsDisplay]; | |
} | |
else if(response.pid == 0x0D) { | |
// Update Speed Display | |
speedLabel.text = [NSString stringWithFormat:@"%@ %@", [sensor valueStringForMeasurement1:NO], [sensor imperialUnitString]]; | |
[speedLabel setNeedsDisplay]; | |
} | |
} | |
[responses release]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment