Ashley Mills / CANInterface

Files at this revision

API Documentation at this revision

Comitter:
ashleymills
Date:
Wed Apr 30 15:30:46 2014 +0000
Parent:
0:1ce2190bc4d2
Commit message:
Fixed return value in makeRequest

Changed in this revision

CANInterface.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/CANInterface.cpp	Wed Apr 30 13:51:22 2014 +0000
+++ b/CANInterface.cpp	Wed Apr 30 15:30:46 2014 +0000
@@ -9,7 +9,7 @@
 
 int CANInterface::makeRequest(uint8_t pid,  uint8_t *outBuf, int *outLen) {
    char canMsg[8] = {0x02,0x01,pid,0x00,0x00,0x00,0x00,0x00};
-   int readOK = 0;
+   int ret = 1;
    
    // write request
    CANMessage request(CAN_PID_REQUEST,canMsg,8);
@@ -29,7 +29,7 @@
    
       // try and read response
       if(_can->read(response)) {
-         readOK = 1;
+         ret = 0;
          _timer->stop();
          if((response.id == CAN_PID_REPLY) && (response.data[2] == pid)) {
             memcpy(outBuf,response.data,response.len-2);
@@ -40,5 +40,5 @@
          }
       }
    }
-   return readOK;
+   return ret;
 }
\ No newline at end of file