#ifndef _Callback_H_
#define _Callback_H_

#include "main.h"
#include <stdint.h>		// uint8_t


/*
	* @ 多功能API阀参数信息
*/
extern uint16_t Valve_status;			 //	阀状态0000关0001开0002异常
extern uint32_t uint_liquidHeight; // 液位高度
extern uint32_t uint_oil_percent;	 // 油水百分比
extern uint32_t uint_filtered_cap; // 滤波之后的电容值

extern uint32_t uint_coeff_a;
extern uint32_t uint_coeff_b;
extern uint32_t uint_coeff_c;
extern uint32_t uint_coeff_d;

void UART1_IdleCallback(void);
void UART2_IdleCallback(void);
void Process_Consolecallback(void);
void Process_Uart485callback(void);
bool is_modbus_03_response(uint8_t *data);
void process_modbus_03(uint8_t *data) ;

bool is_modbus_06_response(uint8_t *data) ;
void process_modbus_06(uint8_t *data)  ;

bool is_modbus_10_response(uint8_t *data) ;
void process_modbus_10(uint8_t *data) ;

void process_modbus_42(uint8_t *data)  ; 
bool is_modbus_42_response(uint8_t *data)  ;
	
bool is_modbus_errorfunc_response(uint8_t *data) ;
void process_modbus_errorfunc(uint8_t *data) ;
  
bool is_modbus_error_regaddr_response(uint8_t *data) ;
void process_modbus_error_regaddr(uint8_t *data) ;

void process_modbus_error_data(uint8_t *data);

void taskprint(uint8_t *tx_buf, uint16_t len);
void taskprinttx(uint8_t *tx_buf, uint16_t len);
void uart485send(uint8_t *tx_buf, uint16_t total_len);
void parse_AT_command(uint8_t *buf);
void print_JsRoot(void);
#endif

