Skip to content

Commit d7a4532

Browse files
committed
lib:add api to set system reboot callback
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 35e35e0 commit d7a4532

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/lib.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ enum loglevel_e {
6868
*/
6969
typedef void (*urc_callback_f)(unsigned int urc_code, unsigned int urc_param);
7070

71+
/**
72+
* Reboot callback function called when reboot command is given
73+
*
74+
* @return True if reboot is allowed, false otherwise
75+
*/
76+
typedef int (*reboot_callback_f)(void);
77+
7178
/**
7279
* Initialize Logicrom OpenCPU SDK library
7380
* @param stdio [in] STDIO port (e.g. /dev/ttyUSB0), can be NULL if STDIO is not required
@@ -100,6 +107,12 @@ void system_settz(const char *tz);
100107
*/
101108
void system_gettz(char *tz, int size);
102109

110+
/**
111+
* Set reboot confirm callback
112+
* @param callback [in] Callback function pointer
113+
*/
114+
int system_set_reboot_callback(reboot_callback_f callback);
115+
103116
/**
104117
* Debug printf with debug level.
105118
*

0 commit comments

Comments
 (0)