mirror of
https://github.com/Fishwaldo/LMIC-node.git
synced 2025-03-15 19:31:44 +00:00
Add custom event handler for MCCI LMIC
This commit is contained in:
parent
bbe3111ec4
commit
7f13b52468
2 changed files with 11 additions and 0 deletions
|
@ -520,10 +520,20 @@ void initLmic(bit_t adrEnabled = 1,
|
|||
serial.println(")");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MCCI_LMIC
|
||||
// Register a custom eventhandler and don't use default onEvent() to enable
|
||||
// additional features (e.g. make EV_RXSTART available). User data pointer is omitted.
|
||||
LMIC_registerEventCb(&onLmicEvent, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef MCCI_LMIC
|
||||
void onLmicEvent(void *pUserData, ev_t ev)
|
||||
#else
|
||||
void onEvent(ev_t ev)
|
||||
#endif
|
||||
{
|
||||
// LMIC event handler
|
||||
ostime_t timestamp = os_getTime();
|
||||
|
|
|
@ -46,6 +46,7 @@ enum class PrintTarget { All, Serial, Display };
|
|||
// Forward declarations
|
||||
void processWork(ostime_t timestamp);
|
||||
void processDownlink(ostime_t eventTimestamp, uint8_t fPort, uint8_t* data, uint8_t dataLength);
|
||||
void onLmicEvent(void *pUserData, ev_t ev);
|
||||
void displayTxSymbol(bool visible);
|
||||
|
||||
#ifndef DO_WORK_INTERVAL_SECONDS // Should be set in platformio.ini
|
||||
|
|
Loading…
Add table
Reference in a new issue