Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bridge/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int g_stuck_irq_ms = 0;
extern int g_sf;
extern float g_bwKHz;
extern int g_cr;
extern uint32_t g_identity_seed;
extern uint64_t g_identity_seed;

namespace {

Expand Down Expand Up @@ -175,7 +175,12 @@ int main(int argc, char** argv) {
for (int i = 1; i < argc; i++) {
auto next = [&]() { return i + 1 < argc ? argv[++i] : ""; };
if (!strcmp(argv[i], "--bridge")) bridge = next();
else if (!strcmp(argv[i], "--seed")) g_identity_seed = (uint32_t)strtoul(next(), nullptr, 10);
// strtoull, and the whole of it. strtoul saturates at ULONG_MAX where a
// long is 32 bits - every Windows target - so a seed above 2^32 came in
// as 0xFFFFFFFF, and every node of a run but the first booted with one
// identity. The simulator sends a value that fits in 32 bits either way,
// so a seed it sends means the same thing on every platform.
else if (!strcmp(argv[i], "--seed")) g_identity_seed = strtoull(next(), nullptr, 10);
else if (!strcmp(argv[i], "--sf")) g_sf = atoi(next());
else if (!strcmp(argv[i], "--bw-khz")) g_bwKHz = (float)atof(next());
else if (!strcmp(argv[i], "--cr")) g_cr = atoi(next());
Expand Down
2 changes: 1 addition & 1 deletion variants/host/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int g_cr = 1;
// reproducible from its seed, and a hardware RNG is the one thing that cannot
// be — so the seam that would ordinarily be RadioNoiseListener is the seam
// where determinism gets injected.
uint32_t g_identity_seed = 4417;
uint64_t g_identity_seed = 4417;

bool radio_init() {
// std_init walks RadioLib's begin(): calibration, TCXO, the modem
Expand Down
Loading