#ifndef __SOFT_VERSION_H
#define	__SOFT_VERSION_H
#include "common.h"


enum _DEVICE_LIST
{
    //===============DEVICE信息===========
    DEVICE_DEF    = 0,
    DEVICE_FCU    = 1,  //fcu信息
    DEVICE_IMU    = 2,  //imu信息
    DEVICE_PMU    = 3,  //pmu信息
    DEVICE_SEN1   = 4,  //传感器信息
    DEVICE_SEN2   = 5,  //传感器信息
    DEVICE_SEN3   = 6,  //传感器信息
    DEVICE_RTK    = 7,  //rtk信息
    DEVICE_GNSSA  = 8,  //gnss信息
    DEVICE_GNSSB  = 9,  //gnss信息
    DEVICE_MAG    = 10, //独立磁信息
    DEVICE_TERRA  = 11, //防地雷达信息
    DEVICE_OBSF   = 12, //避障雷达信息
    DEVICE_OBSB   = 13, //避障雷达信息
    DEVICE_BMS1   = 14, //智能电池信息
    DEVICE_BMS2   = 15, //智能电池信息
    DEVICE_M1     = 16, //电机信息
    DEVICE_M2     = 17, //电机信息
    DEVICE_M3     = 18, //电机信息
    DEVICE_M4     = 19, //电机信息
    DEVICE_M5     = 20, //电机信息
    DEVICE_M6     = 21, //电机信息
    DEVICE_M7     = 22, //电机信息
    DEVICE_M8     = 23, //电机信息
    DEVICE_LOADE  = 24, //光电载荷设备
    DEVICE_SBUSO  = 25, //SBUSOUT设备
    DEVICE_SPREAD = 26, //播撒模块信息
    DEVICE_WEIGHT = 27, //称重模块信息
    DEVICE_PUMP   = 28, //水泵信息
    DEVICE_CENTRI = 29, //离心喷头信息
    DEVICE_FLOW   = 30, //流量计信息
    DEVICE_BODLOCK= 31, //机臂锁紧信息
    DEVICE_LACK   = 32, //缺料传感器信息
    DEVICE_RC     = 33, //遥控器信息
    DEVICE_CURRENT = 34, //电流传感器
    DEVICE_AVOID  = 35, //360避障雷达
    DEVICE_LPUMP1 = 36, //CAN线性水泵1
    DEVICE_LPUMP2 = 37, //CAN线性水泵2
    DEVICE_LPUMP3 = 38, //CAN线性水泵3
    DEVICE_LPUMP4 = 39, //CAN线性水泵4
    DEVICE_NOZZLE1 = 40, //CAN喷头1
    DEVICE_NOZZLE2 = 41, //CAN喷头2
    DEVICE_NOZZLE3 = 42, //CAN喷头3
    DEVICE_NOZZLE4 = 43, //CAN喷头4
    DEVICE_P_TRADAR = 44, //分区仿地雷达
    DEVICE_TR60_F = 45, //EZ 4D避障前
    DEVICE_TR60_B = 46, //EZ 4D避障后
		 DEVICE_H_BMSA = 47, //HYDROGEN氢能源智能电池1
    DEVICE_H_BMSB = 48, //HYDROGEN氢能源智能电池2
    DEVICE_REMOTEID = 49, //remote id设备
    DEVICE_TEMP_SENSOR = 50, //温度传感器
		
    DEVICE_END
};

//设备号  软件 硬件是否注册过
typedef struct 
{
    bool dev;
	bool sn;
    bool soft;
    bool hard;
	bool manu;
}regist_type;

#pragma pack(1)
typedef struct
{
	uint16_t num;
	bool verify;
	char sn[32];
	char soft_serial[16];
	char hard_serial[16];
	char manu[16];

	regist_type regist;
	int8_t send_times;
} dev_version_content;
#pragma pack()

extern short dev_num;
extern dev_version_content dev_pmu;
extern dev_version_content dev_ter;
extern dev_version_content dev_obsf;
extern dev_version_content dev_obsb;
extern dev_version_content dev_bms1;
extern dev_version_content dev_bms2;
extern dev_version_content dev_spreader;
extern dev_version_content dev_weight;
extern dev_version_content dev_flowmeter;
extern dev_version_content dev_arm;
extern dev_version_content dev_current;
extern dev_version_content dev_tempSensor;
extern void *dev_ptr[];
void get_device_version_and_sn(void);
void regist_dev_info(dev_version_content *dev,uint8_t num,bool verify_flag,char *sn,uint8_t size1,
                        char *soft_serial,uint8_t size2,char *hard_serial,uint8_t size3,char *manu,uint8_t size4);
#endif

