// // ELTPMSDataModel.h // Elink // // Created by iot_user on 2019/5/23. // Copyright © 2019 iot_iMac. All rights reserved. // #import typedef NS_ENUM(NSUInteger, ELTPMSDataType) { ELTPMSDataType_Mode1_87 = 0, //Mode 1 87(模式一87) ELTPMSDataType_Mode1_87E = 1, //Mode 1 87E(模式一87E) ELTPMSDataType_Mode2 = 2, //Mode 2 }; typedef NS_ENUM(NSInteger, ELTPMSDeviceState) { ELTPMSDeviceStateNormal = 0x00, //Normal(正常) ELTPMSDeviceStateAirLeakage = 0x01, //Air Leakage (漏气) ELTPMSDeviceStateInflatable = 0x02, //Inflatable(充气) ELTPMSDeviceStateStart = 0x03, //Start(启动) ELTPMSDeviceStatePowerOn = 0x04, //Power On(上电) ELTPMSDeviceStateWakeUp = 0x05, //Wake Up(唤醒) }; NS_ASSUME_NONNULL_BEGIN @interface ELTPMSDataModel : NSObject @property (nonatomic, assign) ELTPMSDataType type;// @property (nonatomic, assign) int classID;//Product number(产品型号 CID) @property (nonatomic, assign) double v;//Voltage coefficient (unit: V)(电压系数(单位:V)) @property (nonatomic, assign) double p;//Pressure coefficient (unit: kPa)(压力系数(单位:kPa)) @property (nonatomic, assign) int t;//Temperature coefficient (unit: °C)(温度系数( 单位:°C )) @property (nonatomic, assign) ELTPMSDeviceState state;//status(状态) @property (nonatomic, copy) NSString *mcuVersion; // Reserved byte (MCU version number)(保留字节(MCU 版本号)) @property (nonatomic, assign) int startCount;//The number of starts, when the state is ELTPMSDeviceStateStart, it means the number of times the startup state was sent (maximum of 4)(启动次数,当状态 state 为ELTPMSDeviceStateStart时,代表发送了启动状态的次数(最大为 4 次)) @property (nonatomic, assign) int stopCount;//When the state state is ELTPMSDeviceStateNormal, value<10 appears, indicating the number of sneak stops (maximum of 6)(当状态 state 为ELTPMSDeviceStateNormal时,出现 value<10,表示潜停次数(最大为 6 次)) @property (nonatomic, copy) NSString *bleVersion; //BLE version number @property (nonatomic, copy) NSString *macAddress; // MAC address @property (nonatomic, copy) NSString *name;//name @property (nonatomic, assign) NSInteger createTime;//Time when data was received(接收到数据的时间) /** analyze data(分析数据) @param data Bluetooth broadcast raw data(蓝牙广播的原始数据) @param name Bluetooth name(蓝牙名称) @param type Bluetooth module type(蓝牙模块类型) @return Tire pressure data model(胎压数据模型) */ +(ELTPMSDataModel *)analysisData:(NSData *)data peripheralName:(NSString *)name type:(ELTPMSDataType)type; @end NS_ASSUME_NONNULL_END