#ifndef __WIFI_H
#define __WIFI_H
#include "main.h"
#include "usart.h"
#include "uType.h"

uint8_t sendCmd_WIFI(char *pCmd, char *pRes1, char *pRes2, uint32_t timeOut, uint8_t sendNum);
void sendATOnly(char *pCmd);
int extract_cip_port(const char *src);
uint8_t send_AT_and_data(uint8_t *hexData, uint16_t dataLen, char *pRes1, char *pRes2, uint32_t timeOut, uint8_t sendNum);
void Send_Heartbeat_WIFI(void);
void Send_WIFI_HEX_Packet(uint8_t *hex_payload, uint16_t payload_len);
void bin_to_hex_ascii(const uint8_t *bin, uint16_t len, char *ascii_out);
void Send_WIFI_ASCII_Packet(const char *ascii_payload);
void Send_WIFI_ASCII_Packet_HEX(const uint8_t *bin_payload, uint16_t bin_len);
void WIFI_Send_Register(uint8_t use_ascii_mode);
void WIFI_Send_Heartbeat(uint8_t use_ascii_mode);
void WIFI_Send_unix(uint8_t use_ascii_mode);
void WIFI_Send_systemlevel(uint8_t use_ascii_mode);
void WIFI_Send_sensorline(uint8_t use_ascii_mode);
void WIFI_Send_Temperature_Data(uint8_t use_ascii_mode, SensorDataBuffer* sensor_data);
void WIFI_Send_Pressure_CO_H2_Data(uint8_t use_ascii_mode, SensorDataBuffer* sensor_data);

#endif /*__WIFI_H*/

