1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- //
- // ELTPMSBleManager.h
- // Elink
- //
- // Created by iot_user on 2019/5/23.
- // Copyright © 2019 iot_iMac. All rights reserved.
- //
-
- #import <Foundation/Foundation.h>
- #import "ELTPMSDataModel.h"
-
- typedef NS_ENUM(NSUInteger, TPMSBluetoothState) {
- TPMSBluetoothStateAvailable = 0, //Open available(打开可用)
- TPMSBluetoothStateUnavailable = 1, //unavailable(不可用)
- TPMSBluetoothStateBroadcasting = 2, //Broadcasting(正在广播)
- TPMSBluetoothStateStopBroadcasting = 3, //Stop broadcasting(停止广播)
- };
-
-
- //Bluetooth name prefix(蓝牙名称前缀)
- #define TPMSName @"TPMS_" //Such as:TPMS_B9F5BB
-
- @protocol ELTPMSBleManagerDelegate <NSObject>
-
- /**
- Return to Bluetooth status(返回蓝牙状态)
-
- @param state Bluetooth status(蓝牙状态)
- */
- -(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
-
- /**
- Callback tire pressure data(回调胎压数据)
-
- @param model Tire pressure data model(胎压数据模型)
- */
- -(void)TPMSBleManagerReceiveData:(ELTPMSDataModel *_Nonnull)model;
-
- @end
-
-
- NS_ASSUME_NONNULL_BEGIN
-
- @interface ELTPMSBleManager : NSObject
-
- /**
- Bluetooth is available to open(蓝牙是否打开可用)
- */
- @property (nonatomic, assign, readonly) BOOL isOn;
-
- /**
- Agent callback(代理回调)
- */
- @property (nonatomic, weak) id<ELTPMSBleManagerDelegate> delegate;
-
-
- +(void)setAppKey:(NSString *)key appSecret:(NSString *)secret NS_UNAVAILABLE;
-
-
- +(instancetype)shareManager;
-
- /**
- Start scanning(开始扫描)
- */
- -(void)startScan;
-
- /**
- Stop scanning(停止扫描)
- */
- -(void)stopScan;
-
- /**
- Get the SDK version number(获取SDK版本号)
-
- @return version
- */
- -(NSString *)sdkVersion;
- @end
-
- NS_ASSUME_NONNULL_END
|