Browse Source

AP_RangeFinder: To define the OK status to LEDDARONE status.

master
murata 8 years ago committed by Tom Pittenger
parent
commit
d58c193c90
  1. 4
      libraries/AP_RangeFinder/AP_RangeFinder_LeddarOne.cpp
  2. 1
      libraries/AP_RangeFinder/AP_RangeFinder_LeddarOne.h

4
libraries/AP_RangeFinder/AP_RangeFinder_LeddarOne.cpp

@ -54,7 +54,7 @@ bool AP_RangeFinder_LeddarOne::get_reading(uint16_t &reading_cm) @@ -54,7 +54,7 @@ bool AP_RangeFinder_LeddarOne::get_reading(uint16_t &reading_cm)
}
// send a request message for Modbus function 4
if (send_request() < 0) {
if (send_request() != LEDDARONE_OK) {
// TODO: handle LEDDARONE_ERR_SERIAL_PORT
return false;
}
@ -162,7 +162,7 @@ int8_t AP_RangeFinder_LeddarOne::send_request(void) @@ -162,7 +162,7 @@ int8_t AP_RangeFinder_LeddarOne::send_request(void)
}
uart->flush();
return 0;
return LEDDARONE_OK;
}
/*

1
libraries/AP_RangeFinder/AP_RangeFinder_LeddarOne.h

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
#define LEDDARONE_DEFAULT_ADDRESS 0x01
// error codes
#define LEDDARONE_OK 0
#define LEDDARONE_ERR_BAD_CRC -1
#define LEDDARONE_ERR_NO_RESPONSES -2
#define LEDDARONE_ERR_BAD_RESPONSE -3

Loading…
Cancel
Save