nshlib:add platform skip login function
Signed-off-by: huangjian <huangjian@xiaomi.com>
This commit is contained in:
parent
5a623cc9e3
commit
88fff23d34
@ -1285,6 +1285,17 @@ config NSH_PLATFORM_CHALLENGE
|
|||||||
which may be included like:
|
which may be included like:
|
||||||
|
|
||||||
#include "nshlib/nshlib.h"
|
#include "nshlib/nshlib.h"
|
||||||
|
|
||||||
|
config NSH_PLATFORM_SKIP_LOGIN
|
||||||
|
bool "Platform skip login"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
If this option is selected, the NSH will call into platform-specific
|
||||||
|
logic in order to skip login. The function prototype for this
|
||||||
|
call is:
|
||||||
|
|
||||||
|
int platform_skip_login(void);
|
||||||
|
|
||||||
endif # NSH_LOGIN
|
endif # NSH_LOGIN
|
||||||
endif # NSH_LIBRARY
|
endif # NSH_LIBRARY
|
||||||
endmenu # NSH Library
|
endmenu # NSH Library
|
||||||
|
@ -150,6 +150,13 @@ int nsh_login(FAR struct console_stdio_s *pstate)
|
|||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#ifdef CONFIG_NSH_PLATFORM_SKIP_LOGIN
|
||||||
|
if (platform_skip_login() == OK)
|
||||||
|
{
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Loop for the configured number of retries */
|
/* Loop for the configured number of retries */
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NSH_LOGIN_FAILCOUNT; i++)
|
for (i = 0; i < CONFIG_NSH_LOGIN_FAILCOUNT; i++)
|
||||||
|
@ -150,6 +150,13 @@ int nsh_stdlogin(FAR struct console_stdio_s *pstate)
|
|||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#ifdef CONFIG_NSH_PLATFORM_SKIP_LOGIN
|
||||||
|
if (platform_skip_login() == OK)
|
||||||
|
{
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Loop for the configured number of retries */
|
/* Loop for the configured number of retries */
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NSH_LOGIN_FAILCOUNT; i++)
|
for (i = 0; i < CONFIG_NSH_LOGIN_FAILCOUNT; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user