shell_lock.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
24 #ifndef SHELL_LOCK_H
25 #define SHELL_LOCK_H
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include "shell.h"
32 
33 #ifdef MODULE_SHELL_LOCK
34  #ifndef CONFIG_SHELL_LOCK_PASSWORD
35  #error Using MODULE_SHELL_LOCK requires defining CONFIG_SHELL_LOCK_PASSWORD
36  #endif /* CONFIG_SHELL_LOCK_PASSWORD */
37 #endif /* MODULE_SHELL_LOCK */
38 
43 #define CONFIG_SHELL_LOCK_ATTEMPTS_BEFORE_TIME_LOCK 3
44 
45 #ifndef CONFIG_SHELL_LOCK_AUTO_LOCK_TIMEOUT_MS
51 #define CONFIG_SHELL_LOCK_AUTO_LOCK_TIMEOUT_MS (5 * 60 * 1000)
52 #endif
53 
62 void shell_lock_checkpoint(char *line_buf, int buf_size);
63 
70 
74 void shell_lock_do_lock(void);
75 
76 #ifdef MODULE_SHELL_LOCK_AUTO_LOCKING
81 void shell_lock_auto_lock_refresh(void);
82 #endif /* MODULE_SHELL_LOCK_AUTO_LOCKING */
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* SHELL_LOCK_H */
void shell_lock_checkpoint(char *line_buf, int buf_size)
Entry point for the lock mechanism.
void shell_lock_do_lock(void)
Lock the shell.
bool shell_lock_is_locked(void)
Returns true, if the shell is in the locked state.
Shell interface definition.