iOS AILinkBleSDK - 蓝牙SDK
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ELCoffeeScaleBleManager.h 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // ELCoffeeScaleBleManager.h
  3. // Elink
  4. //
  5. // Created by iot_user on 2020/9/30.
  6. // Copyright © 2020 iot_iMac. All rights reserved.
  7. //
  8. #import "ELBluetoothManager.h"
  9. #import "ELCoffeeScaleBleHeader.h"
  10. #import "ELCoffeeScaleBleDataModel.h"
  11. @protocol CoffeeScaleBleDelegate <NSObject>
  12. @optional
  13. /// 蓝牙连接状态
  14. /// @param state 连接状态
  15. - (void)deviceBleReceiveState:(ELBluetoothState)state;
  16. /// 附近的设备
  17. /// @param devices 设备列表
  18. - (void)deviceBleReceiveDevices:(NSArray<ELPeripheralModel *> *_Nullable)devices;
  19. //获得支持单位列表
  20. - (void)supportWeightUnits:(NSArray *_Nullable)weightArray;
  21. //正在连接中倒计时
  22. - (void)deviceBleCountDown:(NSInteger)count;
  23. /** 返回咖啡秤称量的数据模型 */
  24. - (void)coffeeScaleBleReceiveStatusDataModel:(ELCoffeeScaleBleDataModel *_Nonnull)model;
  25. /** 返回设备电量 */
  26. - (void)coffeeScaleBleRechargeState:(CoffeeChargingType)type powerNumber:(NSInteger)power;
  27. /** 返回报警设置指令设置结果 */
  28. - (void)coffeeScaleAlarmSystemState:(CoffeeSetResultType)state;
  29. /** 返回计时设置指令设置结果 */
  30. - (void)coffeeScaleBleReceiveSupportCountTime:(CoffeeSetResultType)state;
  31. //计时功能控制
  32. - (void)coffeeScaleBleReceiveTimerControl:(BOOL)countdown duration:(NSUInteger)duration control:(ELCoffeeScaleTimerControl)control;
  33. @end
  34. NS_ASSUME_NONNULL_BEGIN
  35. @interface ELCoffeeScaleBleManager : ELBluetoothManager
  36. @property (nonatomic, weak) id<CoffeeScaleBleDelegate> coffeeScaleDelegate;
  37. + (instancetype)shareManager;
  38. - (void)autoScan;
  39. - (void)stopAutoScan;
  40. - (void)checkStatus;
  41. //APP 下发归零
  42. - (void)sendMakeZero; //A7 00 24 LEN *02 *01 SUM 7A
  43. //APP 下发单位设置
  44. - (void)sendWeightUnit:(ELDeviceWeightUnit)unit; //A7 00 24 LEN *04 *[00~06] SUM 7A
  45. - (void)sendTemperatureUnit:(ELDeviceTemperatureUnit)unit; //A7 00 24 LEN *06 *[00~01] SUM 7A
  46. - (void)sendBeepOn:(BOOL)on;
  47. //APP 下发自动关机设置
  48. - (void)sendPowerOffDuration:(NSInteger)duration; //A7 00 24 LEN *08 [*00 *00 ~ *FF *FE] SUM 7A
  49. /** APP 设置报警指令
  50. * @param state : 开关
  51. * @param duration : 报警持续时间值,单位s
  52. */
  53. - (void)sendAlarmInstructionWithState:(BOOL)state duration:(NSInteger)duration;
  54. /** 停止报警指令 */
  55. - (void)sendStopAlarmInstruction;
  56. //APP 下发计时控制 control:1计时2暂停3重置 countdown:YES倒计时NO正计时
  57. - (void)sendTimeControlDuration:(NSInteger)duration control:(ELCoffeeScaleTimerControl)control countdown:(BOOL)countdown; //A7 00 24 *0A *[00~01] [*00 *00 ~ *FF *FE] *[00~03] SUM 7A
  58. //退出冲煮或称重:(appMode:0 subMode:1) 冲煮:(appMode:1 subMode:0) 称重:(appMode:1 subMode:1)
  59. - (void)sendSwithAppMode:(BOOL)appMode subMode:(Byte)subMode; //A7 00 24 LEN *11 *[00~01] *[00~01] SUM 7A
  60. @end
  61. @interface ELCoffeeScaleBleManager ()
  62. @property (nonatomic, assign) NSInteger supportTimer;//0 未检测 1 支持 2 不支持
  63. @end
  64. NS_ASSUME_NONNULL_END