#ifndef _BLV_485_DEV_CARDSTATE_H_
#define _BLV_485_DEV_CARDSTATE_H_

#include "includes.h"


#define TIME_MAX            0x02     //变化-广播次数


typedef struct
{
	uint8_t  CardState;         //取电状态
	uint8_t  CardStateLast;
	uint8_t  CardAction;
	uint8_t  CardState_SN;      //序号
	uint32_t CardState_Tick;		//时间戳
	
	uint8_t  SleepFlag;         //睡眠场景标记
	
}__attribute__ ((__packed__))RS485_CARDSTATE_INFO;		//插卡状态同步










void BLW_RS485_CardState_Init(uint16_t DataLen, uint8_t *Data);
void BLW_RS485_CardState_For_Logic_Init(LOGICFILE_DEVICE_INFO *dev_info,uint8_t *data,uint16_t data_len);

void BLV_485_Dev_CardStateA_Init(Device_Public_Information_G *BUS_Public, RS485_CARDSTATE_INFO *Rs485CardStateInfo);
void BLV_485_Dev_CardStateB_Init(Device_Public_Information_G *BUS_Public, RS485_CARDSTATE_INFO *Rs485CardStateInfo);

void BLW_RS485_CardState_AddTo_ActivePort(void);
void BLW_RS485_CardState_AddTo_PollingPort(void);

#endif

