diff --git a/src/ZoomH6.cpp b/src/ZoomH6.cpp index bd3bd1e..66dbec9 100644 --- a/src/ZoomH6.cpp +++ b/src/ZoomH6.cpp @@ -7,7 +7,7 @@ ZoomH6Remote::ZoomH6Remote(HardwareSerial* serial, Stream* debug, uint32_t timeo /*This will write the data to the serial, and return the expected number of replys in case of failure the result is negative */ -int8_t ZoomH6Remote::writeWithReply(byte* data, size_t dataLength, byte* reply, size_t replyLength) { +int8_t ZoomH6Remote::writeWithReply(const byte* data, size_t dataLength, byte* reply, size_t replyLength) { int8_t respCount = 0; for (int i = 0; i < dataLength; ++i) { @@ -108,7 +108,7 @@ bool ZoomH6Remote::sendCommand(byte primary, byte secondary, uint32_t gap, byte* if (gap) delay(gap); - writeWithReply(releaseCom, 2, nullptr, 3); + if (!writeWithReply(releaseCom, 2, nullptr, 3)) return false; return true; } diff --git a/src/ZoomH6.h b/src/ZoomH6.h index 3853ef0..f529810 100644 --- a/src/ZoomH6.h +++ b/src/ZoomH6.h @@ -44,7 +44,7 @@ class ZoomH6Remote { bool sendCommand(byte primary, byte secondary, uint32_t gap, byte* reply = nullptr); private: - int8_t writeWithReply(byte* data, size_t dataLength, byte* reply, size_t replyLength); + int8_t writeWithReply(const byte* data, size_t dataLength, byte* reply, size_t replyLength); void printStatus(byte& high, byte& low); Stream* _debug;