feat: enhance error handling and add device error reporting for radio operations
This commit is contained in:
@ -196,12 +196,12 @@ read_stream(uint8_t cmd, std::span<uint8_t> data, const size_t timeout_ms) {
|
||||
return ue_t{error::FAILED};
|
||||
}
|
||||
|
||||
std::copy(rx_buffer.begin() + 1, rx_buffer.end(), data.begin());
|
||||
|
||||
auto status = rx_buffer[0];
|
||||
if (const auto err = status_to_err(status); err != error::OK) {
|
||||
return ue_t{err};
|
||||
}
|
||||
|
||||
std::copy(rx_buffer.begin() + 1, rx_buffer.end(), data.begin());
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user