backup.c

来自「自动联想命令行处理代码」· C语言 代码 · 共 121 行

C
121
字号
#if !BASIC_BIOS

#include <stdio.h>
#include "bios.h"
#include "cli.h"
#include "rtc.h"
#include "uart.h"
#include "xmodem.h"

static CommandNode CLI_NAME_BACKUP =
{
    "backup",               // node command hint pointer
    "备份类",               // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_KEY,       // node type
    NULL                    // node command value
};

static CommandNode CLI_NAME_BACKUPTFTP =
{
    "tftp",                 // node command hint pointer
    "网口备份",             // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_IP,        // node type
    CLI_BACKUPTFTP          // node command value
};

static CommandNode CLI_NAME_BACKUPNAME =
{
    "filename",             // node command hint pointer
    "文件名称",             // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_STRING,    // node type
    NULL                    // node command value
};

static CommandNode CLI_NAME_BACKUPXMODEM =
{
    "xmodem",               // node command hint pointer
    "串口备份",             // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_KEY,       // node type
    CLI_BACKUPXMODEM        // node command value
};

static CommandNode CLI_NAME_BACKUPFROM =
{
    "from",                 // node command hint pointer
    "起始地址",         // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_HEX,       // node type
    NULL                    // node command value
};

static CommandNode CLI_NAME_BACKUPSIZE =
{
    "size",                 // node command hint pointer
    "数据大小",             // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_HEX,       // node type
    NULL                    // node command value
};

CommandNode *CLI_BackupTftp[] =
{
    &CLI_NAME_BACKUP,    
    &CLI_NAME_BACKUPTFTP,      
    &CLI_NAME_BACKUPNAME,
    &CLI_NAME_BACKUPFROM,
    &CLI_NAME_BACKUPSIZE,
    NULL
};

CommandNode *CLI_BackupXmodem[] =
{
    &CLI_NAME_BACKUP,    
    &CLI_NAME_BACKUPXMODEM,      
    &CLI_NAME_BACKUPFROM,
    &CLI_NAME_BACKUPSIZE,
    NULL
};

void CLI_BackupProc( unsigned char key )
{
    switch( key )
    {
   	    case CLI_LOADECTENDXMODEM:
        	CLI_BackupXmodemProc();
        	break;

        case CLI_LOADEXTENDTFTP:
	        CLI_BackupTftpProc();
	        break;

        default:
            break;
    }
}

void CLI_BackupXmodemProc( void )
{
}

void CLI_BackupTftpProc( void )
{
}

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?