You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ELTPMSBleManager.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // ELTPMSBleManager.h
  3. // Elink
  4. //
  5. // Created by iot_user on 2019/5/23.
  6. // Copyright © 2019 iot_iMac. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "ELTPMSDataModel.h"
  10. typedef NS_ENUM(NSUInteger, TPMSBluetoothState) {
  11. TPMSBluetoothStateAvailable = 0, //Open available(打开可用)
  12. TPMSBluetoothStateUnavailable = 1, //unavailable(不可用)
  13. TPMSBluetoothStateBroadcasting = 2, //Broadcasting(正在广播)
  14. TPMSBluetoothStateStopBroadcasting = 3, //Stop broadcasting(停止广播)
  15. };
  16. //Bluetooth name prefix(蓝牙名称前缀)
  17. #define TPMSName @"TPMS_" //Such as:TPMS_B9F5BB
  18. @protocol ELTPMSBleManagerDelegate <NSObject>
  19. /**
  20. Return to Bluetooth status(返回蓝牙状态)
  21. @param state Bluetooth status(蓝牙状态)
  22. */
  23. -(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
  24. /**
  25. Callback tire pressure data(回调胎压数据)
  26. @param model Tire pressure data model(胎压数据模型)
  27. */
  28. -(void)TPMSBleManagerReceiveData:(ELTPMSDataModel *_Nonnull)model;
  29. @end
  30. NS_ASSUME_NONNULL_BEGIN
  31. @interface ELTPMSBleManager : NSObject
  32. /**
  33. Bluetooth is available to open(蓝牙是否打开可用)
  34. */
  35. @property (nonatomic, assign, readonly) BOOL isOn;
  36. /**
  37. Agent callback(代理回调)
  38. */
  39. @property (nonatomic, weak) id<ELTPMSBleManagerDelegate> delegate;
  40. +(void)setAppKey:(NSString *)key appSecret:(NSString *)secret NS_UNAVAILABLE;
  41. +(instancetype)shareManager;
  42. /**
  43. Start scanning(开始扫描)
  44. */
  45. -(void)startScan;
  46. /**
  47. Stop scanning(停止扫描)
  48. */
  49. -(void)stopScan;
  50. /**
  51. Get the SDK version number(获取SDK版本号)
  52. @return version
  53. */
  54. -(NSString *)sdkVersion;
  55. @end
  56. NS_ASSUME_NONNULL_END