Public Access
LoRa Scanner: a MeshCore preset, and its packets read
- MeshCore joins the presets (EU/UK Narrow: 869.618 MHz, 62.5 kHz, SF8, CR 4/8, sync 0x12), after the Meshtastic ones so stored choices keep their number; `lora preset MeshCore` on the console - lib/meshcore reads what MeshCore sends in clear: header, path, and a node's advert (name, kind, key, position) - the list row, the details, a Capture's viewer and the console echo read a packet by the sync word it was received on - the bandwidth is printed as 62.5, not 62 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
@@ -17,30 +17,30 @@ static const uint8_t kMeshtastic[] = {
|
||||
};
|
||||
|
||||
void test_row_for_a_meshtastic_packet() {
|
||||
PacketSummary p{kMeshtastic, sizeof kMeshtastic, -97.4f, 6.25f, true, true};
|
||||
PacketSummary p{kMeshtastic, sizeof kMeshtastic, -97.4f, 6.25f, true, Protocol::Meshtastic};
|
||||
// Time, RSSI, SNR, then who sent it to whom (by default short name: the last 4 hex digits,
|
||||
// as Meshtastic names a Node) and how far it came. Fits 40 columns with two node numbers.
|
||||
TEST_ASSERT_EQUAL_STRING("21:45:07 -97 6.2 5678>all 1/3", row(p, "21:45:07").c_str());
|
||||
const uint8_t direct[] = {0x0a, 0x0b, 0x0c, 0x0d, 0xc4, 0xd3, 0xb2, 0xa1, 1, 2, 3, 4, 0x6a, 8, 0, 0xaa};
|
||||
PacketSummary d{direct, sizeof direct, -117.0f, -9.25f, true, true};
|
||||
PacketSummary d{direct, sizeof direct, -117.0f, -9.25f, true, Protocol::Meshtastic};
|
||||
TEST_ASSERT_EQUAL_STRING("21:45:07 -117 -9.2 d3c4>0b0a 1/3", row(d, "21:45:07").c_str());
|
||||
TEST_ASSERT_TRUE(row(d, "21:45:07").size() <= 38);
|
||||
}
|
||||
|
||||
void test_row_for_something_else() {
|
||||
const uint8_t data[] = {0x40, 0x01, 0x02};
|
||||
PacketSummary p{data, sizeof data, -120.6f, -7.5f, true, false};
|
||||
PacketSummary p{data, sizeof data, -120.6f, -7.5f, true, Protocol::None};
|
||||
TEST_ASSERT_EQUAL_STRING("21:45:07 -121 -7.5 3 B", row(p, "21:45:07").c_str());
|
||||
}
|
||||
|
||||
// Not on Meshtastic settings (LoRaWAN, say): the same bytes aren't read as a Meshtastic header.
|
||||
void test_row_not_meshtastic() {
|
||||
PacketSummary p{kMeshtastic, sizeof kMeshtastic, -97.0f, 6.0f, true, false};
|
||||
PacketSummary p{kMeshtastic, sizeof kMeshtastic, -97.0f, 6.0f, true, Protocol::None};
|
||||
TEST_ASSERT_EQUAL_STRING("21:45:07 -97 6.0 19 B", row(p, "21:45:07").c_str());
|
||||
}
|
||||
|
||||
void test_row_with_a_bad_crc() {
|
||||
PacketSummary p{kMeshtastic, sizeof kMeshtastic, -97.0f, 6.0f, false, true};
|
||||
PacketSummary p{kMeshtastic, sizeof kMeshtastic, -97.0f, 6.0f, false, Protocol::Meshtastic};
|
||||
TEST_ASSERT_EQUAL_STRING("21:45:07 -97 6.0 bad CRC, 19 B", row(p, "21:45:07").c_str());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user