lorabasics / basicmac

LoRa Basics™ MAC
Other
79 stars 42 forks source link

onEvent() function ? #2

Closed Rush4iot closed 5 years ago

Rush4iot commented 5 years ago

Hi,

First page of the documentation mentions the onEvent() function. It used to be in LMiC 1.6, is it still there in LMiC 1.9 ? A search on the code does not return any result.

Olivier

Rush4iot commented 5 years ago

I figured that we have to register a hook in app.svc like hook.lwm_event: onEvent as described here Please be more explicit in the documentation, it seems that onEvent is a leftover from 1.6.

mkuyper commented 5 years ago

The event handling function is still needed and must be supplied to the core stack. However, it has been renamed to onLmicEvent(); this will be fixed in the documentation.

The lwmux service contains an implementation of this function and, as you correctly pointed out, provides hooks for applications and other services/modules to participate in the processing of those events. Use of the lwmux module by applications is highly recommended.

Note that there is a macro that is used to declare the function, making it a bit harder to find using code search.