iOS AILinkBleSDK - 蓝牙SDK
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ELCM02_BleManager.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. //
  2. // ELCM02_BleManager.h
  3. // AILinkBleSDK
  4. //
  5. // Created by cliCk on 2021/9/13.
  6. // Copyright © 2021 IOT. All rights reserved.
  7. //
  8. #import "ELBluetoothManager.h"
  9. #import "ELCM02_HeartbeatBleModel.h"
  10. #import "ELCM02_BatteryBleModel.h"
  11. #import "ELCM02_BleSupportFunctionModel.h"
  12. #import "ELCM02_BleHeader.h"
  13. NS_ASSUME_NONNULL_BEGIN
  14. @protocol CM02_BleDelegate <NSObject>
  15. @optional
  16. - (void)CM02ManagerUpdateState:(enum ELBluetoothState)state;
  17. - (void)CM02ManagerScanDevices:(NSArray<ELPeripheralModel *> *_Nullable)CM02Devices;
  18. /** 返回设备支持的功能 */
  19. - (void)CM02ManagerBackSupportFunctionModel:(ELCM02_BleSupportFunctionModel *)model;
  20. /** CM02返回设备心跳数据 */
  21. - (void)CM02ManagerBackHeartbeatModel:(ELCM02_HeartbeatBleModel *)model;
  22. /** CM02回复修改密码结果 */
  23. - (void)CM02ManagerBackUpdatePasswordResult:(enum CM02_Result_Type)result;
  24. /** CM02回复解锁和开锁状态 */
  25. - (void)CM02ManagerBackLockState:(enum CM02_LockState_Type)lock passwordResult:(enum CM02_PasswordCorrect_Type)result;
  26. /** CM02回复售后密码 */
  27. - (void)CM02ManagerBackAfterSalesPassword:(NSString *)afterSalesPassword;
  28. /** CM02回复单次行程和对应时间 */
  29. - (void)CM02ManagerBackSingleMileage:(float)kmMileage time:(NSInteger)second;
  30. /** CM02回复总里程信息 */
  31. - (void)CM02ManagerBackTotalMileage:(float)kmMileage;
  32. /** CM02回复电池信息 */
  33. - (void)CM02ManagerBackBatteryBleModel:(ELCM02_BatteryBleModel *)model;
  34. /** CM02回复控制器编号,硬件版本号和软件版本号 */
  35. - (void)CM02ManagerBackControlCode:(NSString *)code hardwareVersion:(NSString *)hardwareVersion softwareVersion:(NSString *)softwareVersion;
  36. /** CM02回复仪表编号,硬件版本和软件版本号 */
  37. - (void)CM02ManagerBackDashboardCode:(NSString *)code hardwareVersion:(NSString *)hardwareVersion softwareVersion:(NSString *)softwareVersion;
  38. @end
  39. @interface ELCM02_BleManager : ELBluetoothManager
  40. @property (nonatomic, weak) id<CM02_BleDelegate> CM02Delegate;
  41. + (ELCM02_BleManager *)shareManager;
  42. ///** 查询接收端类型及支持的功能 */
  43. - (void)getDeviceBaseInformation;
  44. /** 切换单位 */
  45. - (void)changeUnit:(enum CM02_Unit_Type)unit;
  46. /** 定速巡航开关 */
  47. - (void)setCruiseSwitch:(BOOL)state;
  48. /** 是否为非零速度启动 */
  49. - (void)setSpeedStart:(BOOL)state;
  50. /** 恢复出厂设置 */
  51. - (void)resetDevice;
  52. /** 清除除里程和时间外的其它控制器及仪表参数 */
  53. - (void)clearOtherCacheData;
  54. /** 清除总里程 */
  55. - (void)clearTotalMileage;
  56. /** 清除单次里程时间(设备一开机就会记录骑行时间和里程,当需要记录这些时间和里程的时候需要清除一下当次时间,重新开始记录) */
  57. - (void)clearSingleTime;
  58. /** 设置档位(1-7) */
  59. - (void)setGear:(NSInteger)gear;
  60. /** 开关灯 */
  61. - (void)setLightState:(BOOL)state;
  62. /** 修改密码 */
  63. - (void)updatePasswordWithOldPassword:(NSString *)oldPassword newPassword:(NSString *)newPassword;
  64. /** 解锁或者锁车(锁车无需传密码) */
  65. - (void)setLockState:(enum CM02_LockState_Type)lock password:(NSString *)password;
  66. /** 查询售后密码 */
  67. - (void)getAfterSalesPassword;
  68. /** 查询单次行驶里程和时间 */
  69. - (void)getNowSingleMileageInformation;
  70. /** 查询总里程 */
  71. - (void)getTotalMileageInformation;
  72. /** 查询电池信息 */
  73. - (void)getBatteryInformation;
  74. /** 查询控制器厂商代码及编号 */
  75. - (void)getControlVersion;
  76. /** 查询仪表盘固件版本 */
  77. - (void)getDashboardVersion;
  78. #pragma mark - 断开设备清除缓存信息
  79. - (void)cleanData;
  80. @end
  81. NS_ASSUME_NONNULL_END