From e88cf386d69486ba30d5f352ad6c6870f92b1279 Mon Sep 17 00:00:00 2001 From: Alistair Francis <alistair@alistair23.me> Date: Wed, 28 Jun 2023 20:43:28 +1000 Subject: [PATCH] Module: Get status from first byte after the command Instead of getting the status from the very first byte in the input buffer, which will be what we read when we send the first byte. Let's instead get the status from the first byte after the command. This provides a more accurate status value. Signed-off-by: Alistair Francis <alistair@alistair23.me> --- src/Module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module.cpp b/src/Module.cpp index 9856ff5b..2e734034 100644 --- a/src/Module.cpp +++ b/src/Module.cpp @@ -328,7 +328,7 @@ int16_t Module::SPItransferStream(uint8_t* cmd, uint8_t cmdLen, bool write, uint // parse status int16_t state = RADIOLIB_ERR_NONE; if(this->SPIparseStatusCb != nullptr) { - state = this->SPIparseStatusCb(buffIn[0]); + state = this->SPIparseStatusCb(buffIn[cmdLen]); } // copy the data