94 lines
2.7 KiB
C
94 lines
2.7 KiB
C
/*!
|
|
* \file shell.h
|
|
*
|
|
* \brief The head file of shell_handler.c
|
|
*
|
|
* \copyright Revised BSD License, see section \ref LICENSE.
|
|
*
|
|
* \code
|
|
*
|
|
* _ __ _ ________ _
|
|
* | |/ /(_)___ / ____/ /_ (_)___
|
|
* | // / __ \/ / / __ \/ / __ \
|
|
* / |/ / / / / /___/ / / / / /_/ /
|
|
* /_/|_/_/_/ /_/\____/_/ /_/_/ .___/
|
|
* /_/
|
|
* (C) 2022-2025 XinChip
|
|
*
|
|
* \endcode
|
|
*
|
|
* \author ( XinChip ) Alex-J
|
|
*
|
|
* \author ( XinChip )
|
|
*/
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __SHELL_HANDLER_H__
|
|
#define __SHELL_HANDLER_H__
|
|
|
|
/*-----------------------------------------------------------------------------------
|
|
INCLUDE HEADE FILES
|
|
------------------------------------------------------------------------------------*/
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "xc6xxx.h"
|
|
|
|
/*------------------------------------------------------------------------------------
|
|
Macros
|
|
-------------------------------------------------------------------------------------*/
|
|
#define XC_CMD_SIZE 255U
|
|
|
|
// XC Command
|
|
#define XC_OK "OK"
|
|
#define XC_ERROR "+CME ERROR:"
|
|
|
|
#define XC_CMD_TEST "+TEST"
|
|
#define XC_CMD_BLE_MAC "+BMACADDR"
|
|
|
|
/*------------------------------------------------------------------------------------
|
|
TypeDef
|
|
-------------------------------------------------------------------------------------*/
|
|
typedef enum
|
|
{
|
|
XC_CMD_ERROR = -1,
|
|
XC_CMD_SUCCESS = 0
|
|
} eXC_Cmd_State;
|
|
|
|
typedef enum
|
|
{
|
|
QUERY_CMD = 0x00,
|
|
SET_CMD
|
|
} eCMD_Type;
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t byte0;
|
|
uint8_t byte1;
|
|
uint8_t byte2;
|
|
uint8_t byte3;
|
|
uint8_t byte4;
|
|
uint8_t byte5;
|
|
} BLE_Mac_Addr_t;
|
|
|
|
/*------------------------------------------------------------------------------------
|
|
Global Variables
|
|
-------------------------------------------------------------------------------------*/
|
|
extern uint8_t XC_Cmd[XC_CMD_SIZE];
|
|
|
|
/*------------------------------------------------------------------------------------
|
|
Exported Functions
|
|
-------------------------------------------------------------------------------------*/
|
|
eXC_Cmd_State xc_test_handler(eCMD_Type opt, int srgc, char *srgv[]);
|
|
eXC_Cmd_State xc_ble_mac_addr_handler(eCMD_Type opt, int srgc, char *srgv[]);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __SHELL_HANDLER_H__ */
|
|
|
|
|