diff --git a/libraries/AP_HAL/Device.h b/libraries/AP_HAL/Device.h index b56a67932e..c84442c45c 100644 --- a/libraries/AP_HAL/Device.h +++ b/libraries/AP_HAL/Device.h @@ -90,6 +90,16 @@ public: return transfer(buf, sizeof(buf), nullptr, 0); } + /** + * Wrapper function over #transfer() to read a sequence of bytes from + * device. No value is written, differently from the #read_registers() + * method and hence doesn't include the read flag set by #set_read_flag() + */ + bool read(uint8_t *recv, uint32_t recv_len) + { + return transfer(nullptr, 0, recv, recv_len); + } + /* * Get the semaphore for the bus this device is in. This is intended for * drivers to use during initialization phase only.