You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidinitLed(); // Initialize LED hardwarevoidledRxOn(); // Show RX activity (green)voidledTxOn(); // Show TX activity (viola)voidledRedSolid(); // Show error state (red)voidledGreenBlink(); // Quick success blinkvoidledBlueDoubleBlink(); // Special event signalvoidledOff(); // Turn off LED and Vext
Config (core/Config.h)
voidloadConfig(); // Load from EEPROM (or defaults)voidsaveConfig(); // Save current config to EEPROMvoidresetConfig(); // Reset to factory defaultsvoidapplyPowerSettings(); // Apply RxBoost/DeepSleep settingsvoidenterDeepSleep(); // Enter lowest power statevoidenterLightSleep(uint8_t ms); // Brief low-power delayuint32_tgenerateNodeId(); // Generate unique node ID from chip
Radio (core/Radio.h)
voidsetupRadio(); // Initialize SX1262voidstartReceive(); // Enter duty-cycle RX modebooltransmitPacket(MCPacket* pkt); // Transmit a packetvoidcalculateTimings(); // Compute LoRa timing parametersuint32_tgetTxDelayWeighted(int8_t snr); // CSMA backoff delayboolisActivelyReceiving(); // Check if RX in progressvoidfeedWatchdog(); // Feed hardware watchdogvoidhandleRadioError(); // Handle and recover from errors
Mesh Protocol (mesh/)
Identity (mesh/Identity.h)
classIdentityManager {
boolbegin(); // Initialize (load or generate)boolgenerate(); // Generate new keypairboolload(); // Load from EEPROMboolsave(); // Save to EEPROMvoidreset(); // Generate new and save// Gettersuint8_tgetNodeHash(); // First byte of public keyconstuint8_t* getPublicKey(); // 32-byte public keyconstuint8_t* getPrivateKey(); // 64-byte private keyconstchar* getNodeName(); // Node display nameuint8_tgetFlags(); // Type + feature flags// SettersvoidsetNodeName(constchar* name);
voidsetFlags(uint8_t flags);
voidsetLocation(float lat, float lon);
voidclearLocation();
// Cryptovoidsign(uint8_t* sig, constuint8_t* data, size_t len);
staticboolverify(constuint8_t* sig, constuint8_t* pubKey,
constuint8_t* data, size_t len);
};
Packet (mesh/Packet.h)
structMCPacket {
MCPacketHeader header;
uint8_t pathLen;
uint8_t payloadLen;
uint8_t path[64];
uint8_t payload[180];
uint16_tgetTotalSize();
uint16_tserialize(uint8_t* buf, uint16_t maxLen);
booldeserialize(constuint8_t* buf, uint16_t len);
voidclear();
};
// Header encoding
#defineMC_ROUTE_FLOOD0x01
#defineMC_ROUTE_DIRECT0x02
#defineMC_PAYLOAD_ADVERT0x04
#defineMC_PAYLOAD_REQUEST0x00// ... see Packet.h for full list