/*
 * Module_InternalComm.h
 *
 *  Created on: 2020年01月15日
 *      Author: USER
 */

#ifndef MODULE_INTERNALCOMM_H_
#define MODULE_INTERNALCOMM_H_

#define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
#define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
#define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)

extern int StoreLogMsg(const char *fmt, ...);

enum MESSAGE_COMMAND
{
	CMD_QUERY_FW_VER = 0x01,
	CMD_QUERY_HW_VER = 0x02,
	CMD_QUERY_PRESENT_INPUTVOLTAGE = 0x03,
	CMD_QUERY_PRESENT_OUTPUTVOLTAGE = 0x04,
	CMD_QUERY_FAN_SPEED = 0x05,
	CMD_QUERY_TEMPERATURE = 0x06,
	CMD_QUERY_AUX_POWERVOLTAGE = 0x07,
	CMD_QUERY_RELAY_OUTPUT = 0x08,
	CMD_QUERY_GFD_ADC = 0x09,
	CMD_QUERY_GPIO_INPUT = 0x0a,
	CMD_QUERY_ALARM_LOG = 0x22,
	CMD_QUERY_RTC = 0x26,
	CMD_QUERY_PRESENT_OUTPUTCURRENT = 0x27,
	CMD_QUERY_AC_STATUS = 0x28,
	CMD_QUERY_AC_ALARM = 0x29,
	CMD_QUERY_BLE_CONFIG_DATA = 0x2A,
	CMD_QUERY_BLE_CENTRAL_ID = 0x2B,
	CMD_QUERY_POWER_CONSUMPTION = 0x2C,
	CMD_QUERY_GUN_PLUGIN_TIMES = 0x2D,

	CMD_CONFIG_FAN_SPEED = 0x81,
	CMD_CONFIG_SERIAL_NUMBER = 0x82,
	CMD_CONFIG_MODEL_NAME = 0x83,
	CMD_CONFIG_RELAY_OUTPUT = 0x85,
	CMD_CONFIG_GPIO_OUTPUT = 0x86,
	CMD_CONFIG_RTC = 0x87,
	CMD_CONFIG_AC_LED = 0x88,
	CMD_CONFIG_CURRENT_LINIT = 0x89,
	CMD_CONFIG_MCU_MODE = 0x8A,
	CMD_CONFIG_MCU_RESET_REQUEST = 0x8C,
	CMD_CONFIG_MCU_SET_BREATHE_LED_TIMING = 0x8D,
	CMD_CONFIG_MCU_SET_LED_BRIGHTNESS = 0x8E,

	CMD_UPDATE_START = 0xe0,
	CMD_UPDATE_ABOARD = 0xe1,
	CMD_UPDATE_TRANSFER = 0xe2,
	CMD_UPDATE_END = 0xe3
};

enum MESSAGE_ADDRESS
{
	ADDR_AUX = 0x01,
	ADDR_FAN = 0x02,
	ADDR_RELAY = 0x03,
	ADDR_DC_PRIMARY = 0x04,
	ADDR_AC_PRIMARY_1 = 0xff,
	ADDR_AC_PRIMARY_2 = 0xff
};


#endif /* MODULE_INTERNALCOMM_H_ */