![]() |
Morse Micro IoT SDK
2.11.2
|
Data Structures | |
| struct | mmagic_m2m_agent_init_args |
| M2M initialization args. More... | |
Functions | |
| struct mmagic_m2m_agent * | mmagic_m2m_agent_init (const struct mmagic_m2m_agent_init_args *args) |
| Initialize the M2M agent. More... | |
| enum mmagic_status | mmagic_m2m_agent_local_command (struct mmagic_m2m_agent *agent, void(*cb)(struct mmagic_data *core, void *arg), void *cb_arg, uint32_t timeout) |
| Queue a callback to execute in the CONTROL_STREAM context. More... | |
| struct mmagic_m2m_agent * mmagic_m2m_agent_init | ( | const struct mmagic_m2m_agent_init_args * | args | ) |
Initialize the M2M agent.
| args | Initialization arguments. |
| enum mmagic_status mmagic_m2m_agent_local_command | ( | struct mmagic_m2m_agent * | agent, |
| void(*)(struct mmagic_data *core, void *arg) | cb, | ||
| void * | cb_arg, | ||
| uint32_t | timeout | ||
| ) |
Queue a callback to execute in the CONTROL_STREAM context.
This allows safe calling of mmagic_core_* functions outside of the MMAGIC stream. This may block on adding to the (single element) queue, and will return an error if the timeout is reached. It must only be called after mmagic_m2m_agent_init is run.
| agent | Agent handle returned by mmagic_m2m_agent_init. |
| cb | Callback function to execute. Receives MMAGIC core data and cb_arg. |
| cb_arg | Argument to pass to callback. |
| timeout | Timeout when enqueueing. UINT32_MAX to block. |
MMAGIC_STATUS_OK on success, otherwise an error status.