diff --git a/examples/simple_repeater/ChannelBot.h b/examples/simple_repeater/ChannelBot.h index 0d42ccbb..66951769 100644 --- a/examples/simple_repeater/ChannelBot.h +++ b/examples/simple_repeater/ChannelBot.h @@ -57,7 +57,7 @@ #define BOT_REPLY_LEN 120 // well under the 184 B packet payload #define BOT_TEXT_LEN 160 // inbound text, after the ": " prefix #define BOT_PATH_STR_LEN 64 // "3f:a1:c8..." -- caps how many hops we print -#define BOT_FRAG_LEN 56 // one !command's answer +#define BOT_FRAG_LEN 72 // one !command's answer (!link je nejdelsi) static int bot_hex_nibble(char c) { if (c >= '0' && c <= '9') return c - '0'; @@ -179,6 +179,16 @@ int MyMesh::botCommandReply(char* out, int max_len, const char* cmd, const mesh: botFormatPath(path, pkt); return snprintf(out, max_len, "path %s (%d hop)", path, (int)pkt->getPathHashCount()); } + if (strcmp(cmd, "link") == 0) { + // "Jaky mam link domu?" v jednom prikazu. Zamerne slouceny path+snr: tohle + // se pta clovek v aute, ktery nema chut psat dva prikazy -- a jde o cestu + // JEHO paketu k NAM, cili presne ten smer, ktery si na svem uzlu overit + // neumi (tam vidi jen to, co prijima). + char path[BOT_PATH_STR_LEN]; + botFormatPath(path, pkt); + return snprintf(out, max_len, "%d hop %s, SNR %.1f dB, RSSI %d dBm", + (int)pkt->getPathHashCount(), path, pkt->getSNR(), pkt->getRSSI()); + } if (strcmp(cmd, "snr") == 0) { // Straight off the frame that carried the request -- the same numbers // captureRx() files into the rxlog ring.