版本号 | 更新时间 | 作者 | 更新信息 |
---|---|---|---|
v1.0 | 2019/07/08 | JosonXiong | 初步版本 |
v1.1.1 | 2023/06/26 | Larry | 文档整理 |
最低版本iOS 8.0 设备所使用的蓝牙版本需要4.0及以上
[ELTPMSBleManager shareManager].delegate = self;
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
-(void)TPMSBleManagerReceiveData:(ELTPMSDataModel *_Nonnull)model;
可通过代理方法:
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
获取当前蓝牙的状态, 也可通过
[ELTPMSBleManager shareManager].isOn;
获取当前蓝牙是否打开可用;
[[ELTPMSBleManager shareManager] startScan];
[[ELTPMSBleManager shareManager] stopScan];
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
此方法用于获取蓝牙当前状态,其中参数”state”是一个枚举TPMSBluetoothState 枚举的元素包括:TPMSBluetoothStateAvailable(蓝牙打开可TPMSBluetoothStateUnavailable(蓝牙不可用),TPMSBluetoothStateBroadcasting(蓝牙正在广播数据),TPMSBluetoothStateStopBroadcasting(停止广播)
-(void)TPMSBleManagerReceiveData:(ELTPMSDataModel *_Nonnull)model;
此方法用于回调TPMS蓝牙模块广播数据,model是一个ELTPMSDataModel 数据模型,关于ELTPMSDataModel 类的详细请查看“备注”
ELTPMSDataModel(广播数据模型) |类型|参数名|说明| | ----| ---- | --- | |ELTPMSDataType|type|数据类型| |int|classID|产品型号| |double|v|电压系数(单位:V)| |double |p|压力系数(单位:kPa)| |int |t|温度系数(单位:°C)| |ELTPMSDeviceState|state|胎压状态| |int |mcuVersion|MCU版本号| |int |startCount|启动次数| |int |stopCount|潜停次数| |NSString|bleVersion|蓝牙版本号| |NSString |macAddress|MAC地址| |NSString |name|蓝牙名称| |NSInteger|createTime|接收到数据的时间|
ELTPMSHeader.h(头文件) 提供胎压单位,温度单位,以及单位之间的转换方法和对应单位的名称符号。