Modules in the Asset Tracker Template are designed as loosely coupled units with well-defined message-based interfaces. Modules communicate exclusively through their defined zbus interfaces, without reference to other modules' internals. This design ensures that modules are self-contained and can be developed, tested, and maintained independently. Most modules, except the Main module, can also be reused in other applications.
Modules often handle state transitions based on messages they themselves publish. For example, the Network module publishes a NETWORK_CONNECTED message and also receives it in its own state machine. Receiving its own message lets the module transition to the connected state with consistent handling.