feat: enhance error handling and add device error reporting for radio operations

This commit is contained in:
2025-08-07 15:36:20 +08:00
parent 72299b62ce
commit 7637906efe
6 changed files with 101 additions and 47 deletions

View File

@ -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 {};
}