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 
9 #pragma once
10 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include "shell.h"
31 
32 #ifdef MODULE_SHELL_LOCK
33  #ifndef CONFIG_SHELL_LOCK_PASSWORD
34  #error Using MODULE_SHELL_LOCK requires defining CONFIG_SHELL_LOCK_PASSWORD
35  #endif /* CONFIG_SHELL_LOCK_PASSWORD */
36 #endif /* MODULE_SHELL_LOCK */
37 
42 #define CONFIG_SHELL_LOCK_ATTEMPTS_BEFORE_TIME_LOCK 3
43 
44 #ifndef CONFIG_SHELL_LOCK_AUTO_LOCK_TIMEOUT_MS
50 #define CONFIG_SHELL_LOCK_AUTO_LOCK_TIMEOUT_MS (5 * 60 * 1000)
51 #endif
52 
61 void shell_lock_checkpoint(char *line_buf, int buf_size);
62 
69 
73 void shell_lock_do_lock(void);
74 
75 #ifdef MODULE_SHELL_LOCK_AUTO_LOCKING
80 void shell_lock_auto_lock_refresh(void);
81 #endif /* MODULE_SHELL_LOCK_AUTO_LOCKING */
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
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.