//
//  ELMeatProbeBoxMultipleBleParser.h
//  Pods
//

#import <Foundation/Foundation.h>
#import <AILinkBleSDK/ELSDKHeader.h>
#import "ELMeatProbeBoxMultipleBleHeader.h"

NS_ASSUME_NONNULL_BEGIN

@protocol ELMeatProbeBoxMultipleBleParserDelegate;
@class ELMeatProbeBoxMultipleStatusModel, ELMeatProbeBoxMultipleProbeStatusModel, ELMeatProbeBoxMultipleBleBBQParamModel, ELMeatProbeBoxMultipleColorInfoModel;

@interface ELMeatProbeBoxMultipleBleParser : NSObject

@property (nonatomic, copy) NSString *mac;

@property (nonatomic, assign) NSInteger deviceId;

@property (nonatomic, weak) id<ELMeatProbeBoxMultipleBleParserDelegate> delegate;

- (void)parseA7Payload:(NSData *)payload;

@end

@protocol ELMeatProbeBoxMultipleBleParserDelegate <NSObject>

@optional

//MCU 上报设备状态数据（Type：02）
- (void)meatProbeBoxMultipleBleParser:(ELMeatProbeBoxMultipleBleParser *)parser boxStatus:(ELMeatProbeBoxMultipleStatusModel *)boxStatus;

//切换单位（Type：04）
- (void)meatProbeBoxMultipleBleParser:(ELMeatProbeBoxMultipleBleParser *)parser unit:(ELDeviceTemperatureUnit)unit;

//报警状态数据（Type：06）//state: bit0:食物目标温度到达时置1
- (void)meatProbeBoxMultipleBleParser:(ELMeatProbeBoxMultipleBleParser *)parser startAlarmWithState:(Byte)state macData:(NSData *)macData mac:(NSString *)mac;

//取消报警（Type：08）
- (void)meatProbeBoxMultipleBleParser:(ELMeatProbeBoxMultipleBleParser *)parser stopAlarmWithMacData:(NSData *)macData mac:(NSString *)mac;

//烧烤任务参数（Type：0A）//Op：0x00:设置任务参数(设置时需要一个针一个针设定任务) 0x01:获取任务参数(返回所有的针任务,如果包长度超MTU时,会分包发) 0x02:结束烧烤任务
//- (void)meatProbeBoxMultipleBleParser:(ELMeatProbeBoxMultipleBleParser *)parser option:(UInt8)option supportProbe:(UInt8)supportProbe params:(NSArray <ELMeatProbeBoxMultipleBleBBQParamModel *>*)params;
- (void)meatProbeBoxMultipleBleParser:(ELMeatProbeBoxMultipleBleParser *)parser option:(UInt8)option supportProbe:(UInt8)supportProbe param:(ELMeatProbeBoxMultipleBleBBQParamModel *)param;

//color info
- (void)meatProbeBoxMultipleBleParser:(ELMeatProbeBoxMultipleBleParser *)parser colorInfos:(NSArray<ELMeatProbeBoxMultipleColorInfoModel *> *)colorInfos;

@end

@interface ELMeatProbeBoxMultipleStatusModel : NSObject

//设备状态数据协议版本：0x01
@property (nonatomic, assign) UInt8 version;

//支持的探针数量 M
@property (nonatomic, assign) UInt8 probeMaxCount;

//当前连接的探针数量 N
@property (nonatomic, assign) UInt8 probeCount;

//充电盒电池状态
@property (nonatomic, assign) UInt8 batteryStatus;
@property (nonatomic, assign) UInt8 batteryPercent;

//温度单位
@property (nonatomic, assign) ELDeviceTemperatureUnit unit;

//生成时间
@property (nonatomic, assign) NSTimeInterval timestamp;


@property (nonatomic, strong) NSArray <ELMeatProbeBoxMultipleProbeStatusModel *>*probeStatusArray;

//盒子 mac 地址
@property (nonatomic, copy) NSString *boxMacString;

@end

@interface ELMeatProbeBoxMultipleProbeStatusModel : NSObject

//探针编号(1-M) 无法确定可连 接探针的编号，上报 0xFF
@property (nonatomic, assign) UInt8 index;

//探针 mac 地址
@property (nonatomic, strong) NSData *macData;
@property (nonatomic, copy, readonly) NSString *macString;
//
//食物温度
@property (nonatomic, assign, readonly) NSInteger internalTemperature_C;
@property (nonatomic, assign, readonly) NSInteger internalTemperature_F;
//@property (nonatomic, assign, readonly) NSInteger internalTemperature;
@property (nonatomic, assign, readonly) ELDeviceTemperatureUnit internalTemperatureUnit;
@property (nonatomic, assign) UInt16 internalTemperatureRaw;
//
//环境温度
@property (nonatomic, assign, readonly) NSInteger ambientTemperature_C;
@property (nonatomic, assign, readonly) NSInteger ambientTemperature_F;
//@property (nonatomic, assign, readonly) NSInteger ambientTemperature;
@property (nonatomic, assign, readonly) ELDeviceTemperatureUnit ambientTemperatureUnit;
@property (nonatomic, assign) UInt16 ambientTemperatureRaw;
//
//探针电池状态
@property (nonatomic, assign) UInt8 batteryStatus;
@property (nonatomic, assign) UInt8 batteryPercent;
@property (nonatomic, assign) UInt8 batteryRaw;

//探针插入食物状态
@property (nonatomic, assign) UInt8 insertStatusRaw;

//探针连接状态
@property (nonatomic, assign) UInt8 connectState;

//生成时间
@property (nonatomic, assign) double timestamp;

@end

@interface ELMeatProbeBoxMultipleColorInfoModel : NSObject

@property (nonatomic, assign) UInt8 probeIndex;

@property (nonatomic, assign) UInt8 colorIndex;

@end

NS_ASSUME_NONNULL_END
