ToygerSensorHandler.h 811 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // ToygerSensorHandler.h
  3. // ToygerService
  4. //
  5. // Created by 晗羽 on 2018/5/17.
  6. // Copyright © 2018 DTF. All rights reserved.
  7. //
  8. #ifdef USE_SENSOR
  9. #import <Foundation/Foundation.h>
  10. #import <ToygerService/ToygerSensorData.h>
  11. struct ToygerSensorResult {
  12. bool highRisk = false;
  13. bool isStatic = false;
  14. float maxRotationAngle = 0.f;
  15. };
  16. @interface ToygerSensorConfig: NSObject
  17. @property (nonatomic)float static_threshold;
  18. @property (nonatomic)float rotation_threshold;
  19. @property (nonatomic)float offset;
  20. @end
  21. @interface ToygerSensorHandler : NSObject
  22. -(instancetype)initWithConfig:(ToygerSensorConfig *) config;
  23. -(void)processSensorData:(ToygerSensorData *) dataSlice;
  24. -(NSData *)getSampleData;
  25. -(ToygerSensorResult)getSensorResult;
  26. @property (nonatomic)float offset;
  27. @end
  28. #endif