BabyRhythm.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. BabyBluetooth
  3. 简单易用的蓝牙ble库,基于CoreBluetooth 作者:刘彦玮
  4. https://github.com/coolnameismy/BabyBluetooth
  5. @brief babybluetooth Rhythm用于检测蓝牙的任务执行情况,处理复杂的蓝牙流程操作
  6. */
  7. //
  8. // Created by ZTELiuyw on 15/9/15.
  9. // Copyright (c) 2015年 刘彦玮. All rights reserved.
  10. //
  11. #import <Foundation/Foundation.h>
  12. #import "BabyDefine.h"
  13. @interface BabyRhythm : NSObject
  14. typedef void (^BBBeatsBreakBlock)(BabyRhythm *bry);
  15. typedef void (^BBBeatsOverBlock)(BabyRhythm *bry);
  16. //timer for beats
  17. @property (nonatomic, strong) NSTimer *beatsTimer;
  18. //beat interval
  19. @property NSInteger beatsInterval;
  20. #pragma mark beats
  21. //心跳
  22. - (void)beats;
  23. //主动中断心跳
  24. - (void)beatsBreak;
  25. //结束心跳,结束后会进入BlockOnBeatOver,并且结束后再不会在触发BlockOnBeatBreak
  26. - (void)beatsOver;
  27. //恢复心跳,beatsOver操作后可以使用beatsRestart恢复心跳,恢复后又可以进入BlockOnBeatBreak方法
  28. - (void)beatsRestart;
  29. //心跳中断的委托
  30. - (void)setBlockOnBeatsBreak:(void(^)(BabyRhythm *bry))block;
  31. //心跳结束的委托
  32. - (void)setBlockOnBeatsOver:(void(^)(BabyRhythm *bry))block;
  33. @end