Handle USB mode queries in the existing getter paths
This commit is contained in:
1 parent
749ee1e2e5
commit
f0bcb10ff0
5 files changed
+38
-25
No files matched your search
@@ -3560,7 +3560,6 @@ bool CommonCLI::handleUDPBridgeCommand(uint32_t sender_timestamp,
|
||||
void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* reply) {
|
||||
PrefsSaveReplyGuard save_reply(_prefs_save_failures, reply);
|
||||
mesh::cli::normalizeCommandVerb(command);
|
||||
if (mesh::handleUsbModeCommand(command, reply, 160, Serial)) return;
|
||||
#if MESH_ENABLE_HOST_KISS
|
||||
if (mesh::hostkiss::handleCommand(command, reply, 157, sender_timestamp == 0)) return;
|
||||
#endif
|
||||
@@ -5992,6 +5991,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
||||
}
|
||||
|
||||
void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* reply) {
|
||||
if (mesh::handleUsbModeCommand(command, reply, 160, Serial)) return;
|
||||
const char* config = &command[4];
|
||||
#if defined(RAK_4631)
|
||||
if (mesh::peripherals::handleCommand(_prefs->peripherals_shared, command,
|
||||
|
||||
@@ -34,12 +34,9 @@ inline CompanionChannelAlias parseCompanionChannelAlias(const char* name) {
|
||||
// Only exact named radio2 aliases request RF setup. Ordinary channels and
|
||||
// arbitrary r2 labels keep the operator's existing profile.
|
||||
inline const char* companionChannelRadio2Preset(const char* name) {
|
||||
if (!name) return nullptr;
|
||||
if (*name == '#') ++name;
|
||||
if (strncmp(name, "r2-", 3)) return nullptr;
|
||||
name += 3;
|
||||
// An exact preset tail also excludes every invalid/nested alias form.
|
||||
return mesh::cli::radio2PresetTuple(name) ? name : nullptr;
|
||||
const auto alias = parseCompanionChannelAlias(name);
|
||||
return alias.kind == CompanionChannelKind::Radio2
|
||||
&& mesh::cli::radio2PresetTuple(alias.tail) ? alias.tail : nullptr;
|
||||
}
|
||||
|
||||
inline bool companionChannelCanonicalName(const char* name, char* out, size_t size) {
|
||||
|
||||
Reference in new issue
Block a user