Force 0x3e "pid" (actually service ID) to be 1 byte.
authorChristopher Peplin <chris.peplin@rhubarbtech.com>
Fri, 14 Mar 2014 19:37:15 +0000 (15:37 -0400)
committerChristopher Peplin <chris.peplin@rhubarbtech.com>
Fri, 14 Mar 2014 19:37:15 +0000 (15:37 -0400)
src/uds/uds.c

index 1157949..e0de344 100644 (file)
@@ -53,7 +53,7 @@ static void setup_receive_handle(DiagnosticRequestHandle* handle) {
 static uint16_t autoset_pid_length(uint8_t mode, uint16_t pid,
         uint8_t pid_length) {
     if(pid_length == 0) {
-        if(pid > 0xffff || mode > 10) {
+        if(pid > 0xffff || (mode != 0x3e && mode > 0xa)) {
             pid_length = 2;
         } else {
             pid_length = 1;