49 lines
1.1 KiB
C
Executable File
49 lines
1.1 KiB
C
Executable File
/*************************************************************************
|
|
File name : shutdownmgr.h
|
|
Module : mw
|
|
Author :
|
|
Copyright :
|
|
Version : 0.1
|
|
Created on : 2022-04-27
|
|
Creator : amir.liang
|
|
Description :
|
|
auto suspend the system if meet the condition
|
|
用于关机管理
|
|
Modify History:
|
|
1. Date: Author: Modification:
|
|
***************************************************************************/
|
|
#ifndef __shutdownmgr_H__
|
|
#define __shutdownmgr_H__
|
|
#include <stdint.h>
|
|
#include "list.h"
|
|
|
|
/*
|
|
* 有source在的时候 禁止自动shutdown的
|
|
* 所有source超时, 进入关机流程
|
|
*/
|
|
typedef enum{
|
|
WAKEUP_DEFAULT = 0 ,//0
|
|
WAKEUP_USER ,//1
|
|
WAKEUP_QRCODE ,//2
|
|
WAKEUP_WIFI ,//3
|
|
WAKEUP_KEY ,//4
|
|
WAKEUP_RING_BUTTON ,//6
|
|
WAKEUP_HTTP ,//7 add 2 second each http request.
|
|
WAKEUP_IO ,
|
|
WAKEUP_HISTORYLIST//never suspend except onstanby or keepalive time out
|
|
}WAKEUP_SOURCE;
|
|
|
|
|
|
|
|
/*
|
|
*
|
|
*/
|
|
void shutdownmgr_set(WAKEUP_SOURCE source, uint32_t expire_ms);
|
|
|
|
|
|
|
|
void shutdownmgr_test();
|
|
|
|
#endif /* __shutdownmgr_H__ */
|
|
|