mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
onCommandDataRecv() use '>' prefix for CLI replies.
This commit is contained in:
@@ -534,11 +534,16 @@ void MyMesh::onCommandDataRecv(const ContactInfo &from, mesh::Packet *pkt, uint3
|
|||||||
const char *text, char* reply) {
|
const char *text, char* reply) {
|
||||||
markConnectionActive(from); // in case this is from a server, and we have a connection
|
markConnectionActive(from); // in case this is from a server, and we have a connection
|
||||||
if (from.isRemoteCLIAllowed()) {
|
if (from.isRemoteCLIAllowed()) {
|
||||||
|
if (text[0] == '>') { // is this a CLI reply?
|
||||||
|
queueMessage(from, TXT_TYPE_CLI_DATA, pkt, sender_timestamp, NULL, 0, &text[1]);
|
||||||
|
} else {
|
||||||
|
*reply++ = '>'; // ensure the special 'is reply' prefix
|
||||||
if (!handleCommand(text, sender_timestamp, reply)) {
|
if (!handleCommand(text, sender_timestamp, reply)) {
|
||||||
strcat(reply, "Unknown command"); // reply may have cmd prefix from 'text'
|
strcat(reply, "Unknown command"); // reply may have cmd prefix from 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MyMesh::onSignedMessageRecv(const ContactInfo &from, mesh::Packet *pkt, uint32_t sender_timestamp,
|
void MyMesh::onSignedMessageRecv(const ContactInfo &from, mesh::Packet *pkt, uint32_t sender_timestamp,
|
||||||
const uint8_t *sender_prefix, const char *text) {
|
const uint8_t *sender_prefix, const char *text) {
|
||||||
|
|||||||
Reference in New Issue
Block a user