* new helper for ESP32: SerialBLEInterface

* Some refactoring in BaseChatMesh and Terminal Chat
* new companion_radio example
This commit is contained in:
Scott Powell
2025-01-28 20:30:15 +11:00
parent 52f9c358b7
commit d9dc76f197
8 changed files with 1000 additions and 9 deletions

View File

@@ -119,6 +119,7 @@ class MyMesh : public BaseChatMesh, ContactVisitor {
if (!success) break; // EOF
c.id = mesh::Identity(pub_key);
c.lastmod = 0;
if (!addContact(c)) full = true;
}
file.close();
@@ -196,8 +197,8 @@ protected:
return false;
}
void onMessageRecv(const ContactInfo& from, bool was_flood, uint32_t sender_timestamp, const char *text) override {
Serial.printf("(%s) MSG -> from %s\n", was_flood ? "FLOOD" : "DIRECT", from.name);
void onMessageRecv(const ContactInfo& from, uint8_t path_len, uint32_t sender_timestamp, const char *text) override {
Serial.printf("(%s) MSG -> from %s\n", path_len == 0xFF ? "DIRECT" : "FLOOD", from.name);
Serial.printf(" %s\n", text);
if (strcmp(text, "clock sync") == 0) { // special text command