Skip to content

Commit

Permalink
LTOBD2AdapterELM327: wrap ATSH (set header arbitration) and ATCRA (se…
Browse files Browse the repository at this point in the history
…t response arbitration). #35
  • Loading branch information
mickeyl committed Feb 26, 2021
1 parent 8069c2f commit 036f9f5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Sources/LTSupportAutomotive/LTOBD2AdapterELM327.m
Original file line number Diff line number Diff line change
Expand Up @@ -480,3 +480,32 @@ -(NSString*)formattedResponse
}

@end



@implementation LTOBD2CommandELM327_SET_HEADER_ARBITRATION

+(instancetype)commandForId:(NSString*)header
{
NSString* string = [NSString stringWithFormat:@"ATSH%@", header];
return [self commandWithRawString:string];
}

@end



@implementation LTOBD2CommandELM327_CAN_RECEIVE_ARBITRATION

+(instancetype)command
{
return [self commandWithRawString:@"ATCRA"];
}

+(instancetype)commandForId:(NSString*)header
{
NSString* string = [NSString stringWithFormat:@"ATCRA%@", header];
return [self commandWithRawString:string];
}

@end
15 changes: 15 additions & 0 deletions Sources/LTSupportAutomotive/include/LTOBD2AdapterELM327.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,19 @@ NS_ASSUME_NONNULL_BEGIN

@end

@interface LTOBD2CommandELM327_SET_HEADER_ARBITRATION : LTOBD2Command

+(instancetype)commandForId:(NSString*)header;

@end

/// CAN-ONLY commands (protocols 6 to C)

@interface LTOBD2CommandELM327_CAN_RECEIVE_ARBITRATION : LTOBD2Command

+(instancetype)command; // clear receive arbitration (resets to broadcast)
+(instancetype)commandForId:(NSString*)header;

@end

NS_ASSUME_NONNULL_END

0 comments on commit 036f9f5

Please sign in to comment.