Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
LTA_mcu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Александр Пчелин
LTA_mcu
Commits
cc944181
Commit
cc944181
authored
Apr 29, 2026
by
Александр Пчелин
Browse files
Options
Browse Files
Download
Plain Diff
Добавлен рабочий скрипт для апи
parents
39bf9ab4
401288d2
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
67 deletions
+68
-67
src/cli_protocol/cli_protocol.c
src/cli_protocol/cli_protocol.c
+63
-53
src/cli_protocol/cli_protocol.h
src/cli_protocol/cli_protocol.h
+3
-7
src/cli_protocol/cli_protocol_cfg.h
src/cli_protocol/cli_protocol_cfg.h
+2
-7
No files found.
src/cli_protocol/cli_protocol.c
View file @
cc944181
This diff is collapsed.
Click to expand it.
src/cli_protocol/cli_protocol.h
View file @
cc944181
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
//************************************ Коды команд (по протоколу 1.1) *************************************
//************************************ Коды команд (по протоколу 1.1) *************************************
typedef
enum
{
typedef
enum
{
CLI_CMD_OPEN
=
0x00U
,
// T00 - открыть соединение (
опционально
с паролем)
CLI_CMD_OPEN
=
0x00U
,
// T00 - открыть соединение (с паролем)
CLI_CMD_CLOSE
=
0x01U
,
// T01 - закрыть соединение
CLI_CMD_CLOSE
=
0x01U
,
// T01 - закрыть соединение
CLI_CMD_PING
=
0x02U
,
// T02 - проверка соединения (ping)
– эхо переданных данных
CLI_CMD_PING
=
0x02U
,
// T02 - проверка соединения (ping)
CLI_CMD_GET_INFO
=
0x0AU
,
// T0A - получить информацию об устройстве (имя, серийный, версия)
CLI_CMD_GET_INFO
=
0x0AU
,
// T0A - получить информацию об устройстве (имя, серийный, версия)
CLI_CMD_READ_MEM
=
0x14U
,
// T14 - чтение памяти (адрес 4 байта + размер 1 байт)
CLI_CMD_READ_MEM
=
0x14U
,
// T14 - чтение памяти (адрес 4 байта + размер 1 байт)
CLI_CMD_WRITE_MEM
=
0x15U
,
// T15 - запись памяти (адрес 4 байта + данные, только SRAM)
CLI_CMD_WRITE_MEM
=
0x15U
,
// T15 - запись памяти (адрес 4 байта + данные, только SRAM)
...
@@ -102,10 +102,6 @@ void cli_protocol_set_password(const u8* pass, u8 len);
...
@@ -102,10 +102,6 @@ void cli_protocol_set_password(const u8* pass, u8 len);
//! @return true – пароль верен, false – неверен
//! @return true – пароль верен, false – неверен
bool
cli_protocol_verify_password
(
const
u8
*
pass
,
u8
len
);
bool
cli_protocol_verify_password
(
const
u8
*
pass
,
u8
len
);
//---------------------------------------------------------------------
//! @brief Сброс блокировки после превышения попыток ввода пароля
void
cli_protocol_reset_block
(
void
);
//---------------------------------------------------------------------
//---------------------------------------------------------------------
//! @brief Регистрация новой команды
//! @brief Регистрация новой команды
//! @param cmd Указатель на структуру с кодом и обработчиком
//! @param cmd Указатель на структуру с кодом и обработчиком
...
@@ -114,4 +110,4 @@ void cli_protocol_reset_block(void);
...
@@ -114,4 +110,4 @@ void cli_protocol_reset_block(void);
fun_res_t
cli_register_command
(
const
cli_command_t
*
cmd
);
fun_res_t
cli_register_command
(
const
cli_command_t
*
cmd
);
#endif
#endif
\ No newline at end of file
\ No newline at end of file
src/cli_protocol/cli_protocol_cfg.h
View file @
cc944181
...
@@ -16,13 +16,8 @@
...
@@ -16,13 +16,8 @@
//************************************ Пароль по умолчанию **************************************************
//************************************ Пароль по умолчанию **************************************************
// Пароль по умолчанию "1357"
// Пароль по умолчанию "1357"
#define CLI_DEFAULT_PASSWORD_BYTES {0x31, 0x33, 0x35, 0x37}
#define CLI_DEFAULT_PASSWORD_BYTES {0x31, 0x33, 0x35, 0x37}
#define CLI_DEFAULT_PASSWORD_LEN 4
#define CLI_DEFAULT_PASSWORD_LEN 4
#define CLI_MAX_COMMANDS 256 // Максимальное количество регистрируемых команд (0x00..0xFF)
#define CLI_MAX_COMMANDS 256 // Максимальное количество регистрируемых команд (0x00..0xFF)
#define CLI_PASSWORD_MAX_LEN 15 // Максимальная длина пароля в байтах
#define CLI_PASSWORD_MAX_LEN 15 // Максимальная длина пароля в байтах
#define CLI_ACTIVITY_TIMEOUT_TICKS 20000U // ~20 сек при вызове каждые 1 мс
#endif
#endif
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment