Fix official app WiFi commands and Full build qualification
This commit is contained in:
1 parent
0feffaa3ab
commit
b47e4c137e
9 files changed
+161
-26
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
namespace mesh {
|
||||
namespace companion {
|
||||
@@ -32,6 +33,15 @@ inline bool isRunCliFrame(uint8_t command, size_t frame_len) {
|
||||
return command == kRunCliCommand && frame_len >= 2;
|
||||
}
|
||||
|
||||
// The official app appends a NUL; other clients send just the text. Accept
|
||||
// either representation, but never execute a truncated or empty command.
|
||||
inline size_t cliCommandTextLength(const uint8_t* body, size_t length) {
|
||||
if (body == nullptr || length == 0) return 0;
|
||||
if (body[length - 1] == 0) --length;
|
||||
if (length == 0 || memchr(body, 0, length) != nullptr) return 0;
|
||||
return length;
|
||||
}
|
||||
|
||||
inline bool isFemRxGainGet(uint8_t command) {
|
||||
return command == kOriginalGetFemRxGain || command == kDeprecatedGetFemRxGain;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user