From cbae32a50a7ca825e639b3645c05475645051783 Mon Sep 17 00:00:00 2001 From: Jake Dahl Date: Tue, 16 Oct 2018 17:49:15 -0600 Subject: [PATCH] I missed a ::write, stupid jenkins --- src/drivers/distance_sensor/pga460/pga460.cpp | 10 ++++++++-- src/drivers/distance_sensor/pga460/pga460.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/drivers/distance_sensor/pga460/pga460.cpp b/src/drivers/distance_sensor/pga460/pga460.cpp index ce4e17df2d..1dd716a20a 100644 --- a/src/drivers/distance_sensor/pga460/pga460.cpp +++ b/src/drivers/distance_sensor/pga460/pga460.cpp @@ -665,11 +665,17 @@ int PGA460::read_threshold_registers() } } -void PGA460::request_results() +int PGA460::request_results() { uint8_t buf_tx[2] = {SYNCBYTE, UMR}; - ::write(_fd, &buf_tx[0], sizeof(buf_tx)); + int ret = ::write(_fd, &buf_tx[0], sizeof(buf_tx)); usleep(10000); + + if(ret < 0) { + return PX4_ERROR; + } + + return PX4_OK; } void PGA460::run() diff --git a/src/drivers/distance_sensor/pga460/pga460.h b/src/drivers/distance_sensor/pga460/pga460.h index 1e056e5fb6..19806f20d6 100644 --- a/src/drivers/distance_sensor/pga460/pga460.h +++ b/src/drivers/distance_sensor/pga460/pga460.h @@ -354,7 +354,7 @@ private: /** * @brief Measurement is read from UART RX buffer and published to the uORB distance sensor topic. */ - void request_results(); + int request_results(); /** * @brief Checks the measurement from last report and sets the range distance mode (long range , short range).