Public Access
The MeshCore preset is the default for a new device, in the Settings and in the radio before the Scanner is opened. The setting now accepts it: it only took the 7 Meshtastic presets, so MeshCore picked in the App was not saved. Messages on MeshCore's public channel are decrypted with the channel's published key (AES-128, checked with 2 bytes of HMAC-SHA256): the row shows who says they sent it and the start of the text, the details the sender, the time and the whole text. Other channels and private messages stay encrypted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
37 lines
1.5 KiB
C++
37 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace roro::lora {
|
|
|
|
// Whose packets the radio's settings were for, by their sync word: whose clear header to read.
|
|
enum class Protocol : uint8_t { None, Meshtastic, MeshCore };
|
|
Protocol protocolOf(uint8_t syncWord);
|
|
|
|
// What the LoRa Scanner shows of one packet (M3, Q96).
|
|
struct PacketSummary {
|
|
const uint8_t* data;
|
|
size_t len;
|
|
float rssi, snr;
|
|
bool crcOk;
|
|
Protocol protocol; // what the settings it was received on were for
|
|
};
|
|
|
|
// One list row, at most about 36 characters: "21:45:07 -97 6.2 5678>all 1/3". Meshtastic nodes by their
|
|
// default short name (the last 4 hex digits); headerLines() has the full numbers. MeshCore: what
|
|
// it is, then who ("adv Brussels-R1", "txt a3>7f", "chan #11", "who's there?", "here 18a6") and the hops in its path ("2h");
|
|
// a message on the public channel is read: "Alice: hello fro 2h".
|
|
std::string row(const PacketSummary& p, const std::string& time);
|
|
|
|
// Eight bytes a line, with the printable ones: "0000 ff ff ff ff 78 56 34 12 ....xV4.".
|
|
std::vector<std::string> hexDump(const uint8_t* data, size_t len);
|
|
|
|
// What is in clear, one field a line: the Meshtastic header, or MeshCore's header, path and (for an
|
|
// advert) who the node says it is, and a message on its public channel. Empty when the packet can't be read as that.
|
|
std::vector<std::string> headerLines(const uint8_t* data, size_t len, Protocol protocol = Protocol::Meshtastic);
|
|
|
|
} // namespace roro::lora
|