/*
 * AppTaskUart0.h
 *
 *  Created on: 2022��2��8��
 *      Author: QiXiang_CHENJIE
 */

#ifndef APPTASKUART0_H_
#define APPTASKUART0_H_
#include "hal_adapter.h"
#include "AppGlobalVar.h"
#include "AppFuncLib.h"

#if 1

typedef enum
{
    MAT= 0,
	MAT_Version,
	MAT_Connect,
	MAT_DisConnect,
	MAT_Msg,
	MAT_NameSet,
	MAT_Power,
	MAT_Role,
	MAT_GetMac,
	/* WiFi mode CMD*/
#if WIFI_MASTER
	MAT_W,
	MAT_W_Set,        /* set WiFi name and password */
	MAT_W_IPSet,      /* Set IP address*/
	MAT_W_PortClose,  /*server close*/
	MAT_W_PortSet,    /* Set IP server port*/
	MAT_W_IP,         /* get IP info */
	MAT_W_TcpDisconnect,
	MAT_W_msg,
	MAT_W_conchk,
#elif WIFI_SLAVE
	MAT_S,
	MAT_S_CONTWIFI,
	MAT_S_TCPCONT,
#endif
	/*new CMD area*/
	MAT_CMD_MAXNUM
} McuAtCmd;

#endif
typedef sint8 (*McuPFunc)(char *Readptr,uint16 ReadLen, McuAtCmd McuAtIdx,char *AnsPtr,uint8 *AnsPtrLen);
sint8 McuAtCallbackFunc(char *Readptr,uint16 ReadLen, McuAtCmd McuAtIdx,char *AnsPtr,uint8 *AnsPtrLen);
void McuATCmdTransmit(char *Readptr,uint16 ReadLen,char *AnsPtr,uint8 *AnsPtrLen);
typedef struct
{
	McuAtCmd cmd;
    char *str;
    McuPFunc cb;
} McuAtCmdFunc_t;

typedef struct
{
	uint16 len;
	uint8 kindCmd;
	/* 先定义为数组，便于发送 */
	uint8 data[];
}rs232EspCall;
extern const McuAtCmdFunc_t McuAtCmdFunc[];
void UartTask(void *pvParameters);
#endif /* APPTASKUART0_H_ */
