#ifndef __YDT_1363_PROTOCOL_H_
#define __YDT_1363_PROTOCOL_H_

#ifdef __cplusplus
extern "C" {
#endif

#define BUFFER_LENGHT                               600   //缓冲区数组长度
#define COMREAD_BMSBUFFER_LENGHT                    600   //通过串口读取数据(数组BMSBuffer的长度)
#define COMREAD_TESTBUFF_LENGHT                     300   //通过串口读取数据(数组testBUFF的长度)
#define COMREAD_HEX_LENGHT                          20   //通过串口读取数据(数组hex的长度)
#define SERIAL_TRANSMISSION_UART_NAME_LENGHT        20   //串行传输(数组uart_name的长度)
#define LENGTH_BINARY_LENGHT                        12   //LENGTH校验计算(数组binary的长度)
#define BMSMASTERREAD_DATA_LENGHT                   50   //拼写电总协议(数组data的长度)
#define BMSMASTERREAD_HEX_LENGHT                    20   //拼写电总协议(数组hex的长度)
#define BMSMASTERREAD_DRGKBUFF_LENGHT               100   //拼写电总协议(数组DRGKBUFF的长度)
#define BMSMASTERREAD_INTERMEDIARY_LENGHT           2   //拼写电总协议(数组intermediary的长度)
#define BMSMASTERREAD_CONVERT_LENGHT                2   //拼写电总协议(数组convert的长度)






static bool COMWrite(char BMSBuffer[], int Lenght, int serial);
static bool COMRead(void);
static char *serial_transmission(char pucBuffer[], int num);
static bool BMSMasterGET(char *buff);
static void LENGTH(char *LENID, char hex[]);
static void CHKSUM(char data[], char hex[], int count);
static char *BMSMasterRead(int address, char *CID2, char *LENID, char *DaRen[], char *COMMANDINFO[]), struct mg_connection *nc;

#ifdef __cplusplus
}
#endif

#endif
