Wirepas SDK
shared_offline.h
Go to the documentation of this file.
1/* Copyright 2020 Wirepas Ltd. All Rights Reserved.
2 *
3 * See file LICENSE.txt for full license details.
4 *
5 */
6
23#ifndef _SHARED_OFFLINE_H_
24#define _SHARED_OFFLINE_H_
25
26#include <stdint.h>
27#include <stdbool.h>
28
32typedef enum
33{
40 /* Module is not initialized */
42 /* Stack is already online */
44 /* Role is wrong to enter offline */
47
60
61#define SHARED_OFFLINE_INFINITE_DELAY (uint32_t)(-1)
62
70typedef void (*offline_cb_f)(uint32_t delay_s);
71
93typedef void (*online_cb_f)(uint32_t delay_from_deadline_s);
94
99
107
119
128
138 uint32_t delay_s);
139
147
159 uint32_t * remaining_s_p);
160
161
162#endif //_SHARED_OFFLINE_H_
shared_offline_status_e
Offline state.
@ SHARED_OFFLINE_STATUS_UNINITIALIZED
@ SHARED_OFFLINE_STATUS_ONLINE
@ SHARED_OFFLINE_STATUS_OFFLINE
shared_offline_res_e Shared_Offline_enter_offline_state(uint8_t id, uint32_t delay_s)
Call to asynchronously enter in offline state.
shared_offline_res_e Shared_Offline_register(uint8_t *id_p, offline_setting_conf_t cbs)
Register to offline share lib It is required to take part of the offline arbitration.
void(* offline_cb_f)(uint32_t delay_s)
Offline callback called when the node enter offline state It means that all the module are ready to e...
shared_offline_res_e Shared_Offline_init(void)
Initialize shared offline module.
shared_offline_res_e Shared_Offline_enter_online_state(uint8_t id)
Call to asynchronously enter in online state.
shared_offline_status_e Shared_Offline_get_status(uint32_t *elapsed_s_p, uint32_t *remaining_s_p)
Get the current status.
shared_offline_res_e Shared_Offline_unregister(uint8_t id_p)
Unregister from offline share lib Once done, you will not be notified anymore for online/offline even...
offline_cb_f on_offline_event
shared_offline_res_e
List of return code.
@ SHARED_OFFLINE_RES_WRONG_ID
@ SHARED_OFFLINE_RES_OK
@ SHARED_OFFLINE_RES_WRONG_ROLE
@ SHARED_OFFLINE_RES_UNINITIALIZED
@ SHARED_OFFLINE_RES_ALREADY_ONLINE
@ SHARED_OFFLINE_RES_NO_MORE_ROOM
void(* online_cb_f)(uint32_t delay_from_deadline_s)
Online callback called when the node enter online state.