-
Notifications
You must be signed in to change notification settings - Fork 0
/
CoreMotion.framework.h
2132 lines (1872 loc) · 61.1 KB
/
CoreMotion.framework.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ========== CoreMotion.framework/Headers/CMAuthorization.h
/*
* CMAuthorization.h
* CoreMotion
*
* Copyright (c) 2017 Apple Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
/*
* CMAuthorizationStatus
*
* Discussion:
* Represents the current motion authorization state.
*
* CMAuthorizationStatusNotDetermined when the user has not been prompted yet.
* CMAuthorizationStatusRestricted when access is denied due to system-wide restrictions.
* CMAuthorizationStatusDenied when access is denied by the user.
* CMAuthorizationStatusAuthorized when access is authorized by the user.
*
*/
typedef NS_ENUM(NSInteger, CMAuthorizationStatus) {
CMAuthorizationStatusNotDetermined = 0,
CMAuthorizationStatusRestricted,
CMAuthorizationStatusDenied,
CMAuthorizationStatusAuthorized
} API_AVAILABLE(ios(11.0), watchos(4.0));
// ========== CoreMotion.framework/Headers/CMErrorDomain.h
/*
* CMErrorDomain.h
* CoreMotion
*
* Copyright (c) 2009-2010 Apple Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import <CoreMotion/CMAvailability.h>
NS_ASSUME_NONNULL_BEGIN
/*
* kCMErrorDomain
*
* Discussion:
* Error returned as the domain to NSError from CoreMotion.
*/
CM_EXTERN NSString *const CMErrorDomain API_AVAILABLE(ios(4.0));
NS_ASSUME_NONNULL_END
// ========== CoreMotion.framework/Headers/CMSensorRecorder.h
/*
* CMSensorRecorder.h
* CoreMotion
*
* Copyright (c) 2015 Apple Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import <CoreMotion/CMAccelerometer.h>
#import <CoreMotion/CMAvailability.h>
#import <CoreMotion/CMAuthorization.h>
NS_ASSUME_NONNULL_BEGIN
/*
* CMRecordedAccelerometerData
*
* Discussion:
* CMRecordedAccelerometerData contains data for each accelerometer sample.
*/
COREMOTION_EXPORT API_AVAILABLE(ios(9.0), watchos(2.0)) API_UNAVAILABLE(macos)
@interface CMRecordedAccelerometerData : CMAccelerometerData
/*
* identifier
*
* Discussion:
* Unique identifier that identifies the batch for which the accelerometer sample
* was recorded in. This identifier will be monotonically increased
* for each new sensor batch recorded and can be used as an anchor for future queries.
*/
@property (readonly) uint64_t identifier;
/*
* startDate
*
* Discussion:
* Wall time for when this sensor sample is recorded.
*
*/
@property (readonly) NSDate *startDate;
@end
/*
* CMSensorDataList
*
* Discussion:
* Allows retrospective access to sensor data via enumeration.
* If created with accelerometerDataFromDate:toDate:
* each enumeration will yield an object of type CMRecordedAccelerometerData.
* Due to the large number of samples that can be processed, the
* enumeration should not be run on the main/UI thread.
*/
COREMOTION_EXPORT API_AVAILABLE(ios(9.0), watchos(2.0)) API_UNAVAILABLE(macos)
@interface CMSensorDataList : NSObject <NSFastEnumeration>
@end
/*
* CMSensorRecorder
*
* Discussion:
* CMSensorRecorder allows applications to record sensor data for periods
* during which the application is not active. This data is then made
* available for later access (up to 3 days) when the application
* is run at a later time.
*/
COREMOTION_EXPORT API_AVAILABLE(ios(9.0), watchos(2.0)) API_UNAVAILABLE(macos)
@interface CMSensorRecorder : NSObject
/*
* isAccelerometerRecordingAvailable
*
* Discussion:
* Determines whether accelerometer recording is available.
*/
+ (BOOL)isAccelerometerRecordingAvailable;
/*
* authorizationStatus
*
* Discussion:
* Returns the current authorization status for sensor recording.
*/
+ (CMAuthorizationStatus)authorizationStatus COREMOTION_EXPORT API_AVAILABLE(ios(11.0), watchos(4.0)) API_UNAVAILABLE(macos);
/*
* isAuthorizedForRecording
*
* Discussion:
* Determines whether the application is authorized for sensor recording.
*/
+ (BOOL)isAuthorizedForRecording __API_DEPRECATED_WITH_REPLACEMENT("authorizationStatus", ios(9_0, 11_0), watchos(2_0, 4_0));
/*
* accelerometerDataFromDate:ToDate:
*
* Discussion:
* Gives access to recorded accelerometer samples given a time range (fromDate, toDate].
* A total duration of 12 hours of data can be requested at any one time. Data can be delayed
* for up to 3 minutes before being available for retrieval. An instance of CMSensorDataList
* should only be enumerated from a single thread.
*/
- (nullable CMSensorDataList *)accelerometerDataFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate;
/*
* recordAccelerometerForDuration:
*
* Discussion:
* Starts recording accelerometer data for the duration given at 50hz. Data can be recorded
* for up to 12 hours.
*/
- (void)recordAccelerometerForDuration:(NSTimeInterval)duration;
@end
NS_ASSUME_NONNULL_END
// ========== CoreMotion.framework/Headers/CMMotionActivityManager.h
/*
* CMMotionActivityManager.h
* CoreMotion
*
* Copyright (c) 2013 Apple Inc. All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <CoreMotion/CMMotionActivity.h>
#import <CoreMotion/CMAvailability.h>
#import <CoreMotion/CMAuthorization.h>
NS_ASSUME_NONNULL_BEGIN
/*
* CMMotionActivityHandler
*
* Discussion:
* Typedef of block to be invoked when the device's activity is updated.
*/
typedef void (^CMMotionActivityHandler)(CMMotionActivity * __nullable activity) COREMOTION_EXPORT API_AVAILABLE(ios(7.0)) API_UNAVAILABLE(macos);
/*
* CMMotionActivityQueryHandler
*
* Discussion:
* Typedef of block to be invoked when the historical activity query is
* completed. The array is an array of CMMotionActivity objects.
*/
typedef void (^CMMotionActivityQueryHandler)(NSArray<CMMotionActivity *> * __nullable activities, NSError * __nullable error) COREMOTION_EXPORT API_AVAILABLE(ios(7.0)) API_UNAVAILABLE(macos);
/*
* CMMotionActivityManager
*
* Discussion:
* CMMotionActivityManager allows access to the activity of the device.
* Activities can be retrieved in one of two ways:
*
* 1. Via a query specifying a time range from which an array of
* activities will be returned.
*
* 2. By providing a queue and a block to startActivityUpdatesToQueue:withHandler:
* which will provide live activity updates to a running application.
*/
COREMOTION_EXPORT API_AVAILABLE(ios(7.0)) API_UNAVAILABLE(macos)
@interface CMMotionActivityManager : NSObject
/*
* isActivityAvailable
*
* Discussion:
* Determines whether activity estimation is available.
*/
+ (BOOL)isActivityAvailable;
/*
* authorizationStatus
*
* Discussion:
* Returns the current authorization status for activity.
*/
+ (CMAuthorizationStatus)authorizationStatus COREMOTION_EXPORT API_AVAILABLE(ios(11.0), watchos(4.0)) API_UNAVAILABLE(macos);
/*
* queryActivityStartingFrom:to:toQueue:withHandler:
*
* Discussion:
* Queries for activity transitions that happened during the given time
* range. The date range must be in the past. Data is only available
* for the last seven days. The result is returned to the handler/queue
* specified.
*
* The first activity returned may have a startDate before start. This
* activity represents what the state was at the start time.
*
*/
- (void)queryActivityStartingFromDate:(NSDate *)start
toDate:(NSDate *)end
toQueue:(NSOperationQueue *)queue
withHandler:(CMMotionActivityQueryHandler)handler;
/*
* startActivityUpdatesToQueue:withHandler
*
* Discussion:
* Start activity updates, providing data to the given handler through
* the given queue. An update with the current activity will arrive
* first. Then when the activity state changes the handler will be
* called with the new activity.
*
* You can only have one handler installed at a time, calling
* startActivityUpdatesToQueue:withHandler: replaces the current
* handler.
*
* Updates are not delivered while the application is suspended, the
* application may use
* queryActivityStartingFromDate:toDate:toQueue:withHandler: to get
* activities from the time when the application was suspended.
*/
- (void)startActivityUpdatesToQueue:(NSOperationQueue *)queue
withHandler:(CMMotionActivityHandler)handler;
/*
* stopActivityUpdates
*
* Discussion:
* Stop delivering live updates.
*/
- (void)stopActivityUpdates;
@end
NS_ASSUME_NONNULL_END
// ========== CoreMotion.framework/Headers/CMMotionManager.h
/*
* CMMotionManager.h
* CoreMotion
*
* Copyright (c) 2010 Apple Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import <CoreMotion/CMAccelerometer.h>
#import <CoreMotion/CMGyro.h>
#import <CoreMotion/CMDeviceMotion.h>
#import <CoreMotion/CMMagnetometer.h>
#import <CoreMotion/CMAvailability.h>
NS_ASSUME_NONNULL_BEGIN
/*
* There are two methods to receive data from CMMotionManager: push and pull.
*
* Before using either method, be sure to set the update interval property
* appropriate to the type of data you're interested in. These properties are:
* accelerometerUpdateInterval, gyroUpdateInterval, and deviceMotionUpdateInterval.
*
* To use the pull method, simply call startAccelerometerUpdates, startGyroUpdates,
* and/or startDeviceMotionUpdates, depending on the type of data desired. Then,
* whenever a new sample of data is desired, simply examine the appropriate
* CMMotionManager property (accelerometerData, gyroData, or deviceMotion).
*
* To use the push method, simply call startAccelerometerUpdatesToQueue:withHandler:,
* startGyroUpdatesToQueue:withHandler:, and/or
* startDeviceMotionUpdatesToQueue:withHandler:, depending on the type of data
* desired. You'll need to pass an NSOperationQueue and block to each call. When a new sample of
* data arrives, a new instance of the block will be added to the appropriate NSOperationQueue.
* When you stop the updates (see below), all operations in the given NSOperationQueue will be
* cancelled, so it is recommended to pass CMMotionManager a queue that will not be used in other
* contexts.
*
* Regardless of whether you used push or pull, when you're done, be sure to call the stop method
* appropriate for the type of updates you started. These methods are: stopAccelerometerUpdates,
* stopGyroUpdates, and stopDeviceMotionUpdates.
*
*/
/*
* CMAccelerometerHandler
*
* Discussion:
* Typedef of block to be invoked when accelerometer data is available.
*/
typedef void (^CMAccelerometerHandler)(CMAccelerometerData * __nullable accelerometerData, NSError * __nullable error) API_UNAVAILABLE(tvos);
/*
* CMGyroHandler
*
* Discussion:
* Typedef of block to be invoked when gyro data is available.
*/
typedef void (^CMGyroHandler)(CMGyroData * __nullable gyroData, NSError * __nullable error) API_UNAVAILABLE(tvos);
/*
* CMDeviceMotionHandler
*
* Discussion:
* Typedef of block to be invoked when device motion data is available.
*/
typedef void (^CMDeviceMotionHandler)(CMDeviceMotion * __nullable motion, NSError * __nullable error) API_UNAVAILABLE(tvos);
/*
* CMMagnetometerHandler
*
* Discussion:
* Typedef of block to be invoked when magnetometer data is available.
*/
typedef void (^CMMagnetometerHandler)(CMMagnetometerData * __nullable magnetometerData, NSError * __nullable error) COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* CMMotionManager
*
* Discussion:
* The CMMotionManager object is your entry point to the motion service.
*/
COREMOTION_EXPORT API_AVAILABLE(ios(4.0)) API_UNAVAILABLE(macos)
@interface CMMotionManager : NSObject
{
@private
id _internal;
}
/*
* accelerometerUpdateInterval
*
* Discussion:
* The interval at which to deliver accelerometer data to the specified
* handler once startAccelerometerUpdatesToQueue:withHandler: is called.
* The units are in seconds. The value of this property is capped to
* certain minimum and maximum values. The maximum value is determined by
* the maximum frequency supported by the hardware. If sensitive to the
* interval of acceleration data, an application should always check the
* timestamps on the delivered CMAcceleration instances to determine the
* true update interval.
*/
@property(assign, nonatomic) NSTimeInterval accelerometerUpdateInterval API_UNAVAILABLE(tvos);
/*
* accelerometerAvailable
*
* Discussion:
* Determines whether accelerometer is available.
*/
@property(readonly, nonatomic, getter=isAccelerometerAvailable) BOOL accelerometerAvailable API_UNAVAILABLE(tvos);
/*
* accelerometerActive
*
* Discussion:
* Determines whether the CMMotionManager is currently providing
* accelerometer updates.
*/
@property(readonly, nonatomic, getter=isAccelerometerActive) BOOL accelerometerActive API_UNAVAILABLE(tvos);
/*
* accelerometerData
*
* Discussion:
* Returns the latest sample of accelerometer data, or nil if none is available.
*/
@property(readonly, nullable) CMAccelerometerData *accelerometerData API_UNAVAILABLE(tvos);
/*
* startAccelerometerUpdates
*
* Discussion:
* Starts accelerometer updates with no handler. To receive the latest accelerometer data
* when desired, examine the accelerometerData property.
*/
- (void)startAccelerometerUpdates API_UNAVAILABLE(tvos);
/*
* startAccelerometerUpdatesToQueue:withHandler:
*
* Discussion:
* Starts accelerometer updates, providing data to the given handler through the given queue.
* Note that when the updates are stopped, all operations in the
* given NSOperationQueue will be cancelled.
*/
- (void)startAccelerometerUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMAccelerometerHandler)handler API_UNAVAILABLE(tvos);
/*
* stopAccelerometerUpdates
*
* Discussion:
* Stop accelerometer updates.
*/
- (void)stopAccelerometerUpdates API_UNAVAILABLE(tvos);
/*
* gyroUpdateInterval
*
* Discussion:
* The interval at which to deliver gyro data to the specified
* handler once startGyroUpdatesToQueue:withHandler: is called.
* The units are in seconds. The value of this property is capped to
* certain minimum and maximum values. The maximum value is determined by
* the maximum frequency supported by the hardware. If sensitive to the
* interval of gyro data, an application should always check the
* timestamps on the delivered CMGyroData instances to determine the
* true update interval.
*/
@property(assign, nonatomic) NSTimeInterval gyroUpdateInterval API_UNAVAILABLE(tvos);
/*
* gyroAvailable
*
* Discussion:
* Determines whether gyro is available.
*/
@property(readonly, nonatomic, getter=isGyroAvailable) BOOL gyroAvailable API_UNAVAILABLE(tvos);
/*
* gyroActive
*
* Discussion:
* Determines whether the CMMotionManager is currently providing gyro updates.
*/
@property(readonly, nonatomic, getter=isGyroActive) BOOL gyroActive API_UNAVAILABLE(tvos);
/*
* gyroData
*
* Discussion:
* Returns the latest sample of gyro data, or nil if none is available.
*/
@property(readonly, nullable) CMGyroData *gyroData API_UNAVAILABLE(tvos);
/*
* startGyroUpdates
*
* Discussion:
* Starts gyro updates with no handler. To receive the latest gyro data
* when desired, examine the gyroData property.
*/
- (void)startGyroUpdates API_UNAVAILABLE(tvos);
/*
* startGyroUpdatesToQueue:withHandler:
*
* Discussion:
* Starts gyro updates, providing data to the given handler through the given queue.
* Note that when the updates are stopped, all operations in the
* given NSOperationQueue will be cancelled.
*/
- (void)startGyroUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMGyroHandler)handler API_UNAVAILABLE(tvos);
/*
* stopGyroUpdates
*
* Discussion:
* Stops gyro updates.
*/
- (void)stopGyroUpdates API_UNAVAILABLE(tvos);
/*
* magnetometerUpdateInterval
*
* Discussion:
* The interval at which to deliver magnetometer data to the specified
* handler once startMagnetometerUpdatesToQueue:withHandler: is called.
* The units are in seconds. The value of this property is capped to
* certain minimum and maximum values. The maximum value is determined by
* the maximum frequency supported by the hardware. If sensitive to the
* interval of magnetometer data, an application should always check the
* timestamps on the delivered CMMagnetometerData instances to determine the
* true update interval.
*/
@property(assign, nonatomic) NSTimeInterval magnetometerUpdateInterval COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* magnetometerAvailable
*
* Discussion:
* Determines whether magetometer is available.
*/
@property(readonly, nonatomic, getter=isMagnetometerAvailable) BOOL magnetometerAvailable COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* magnetometerActive
*
* Discussion:
* Determines whether the CMMotionManager is currently providing magnetometer updates.
*/
@property(readonly, nonatomic, getter=isMagnetometerActive) BOOL magnetometerActive COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* magnetometerData
*
* Discussion:
* Returns the latest sample of magnetometer data, or nil if none is available.
*/
@property(readonly, nullable) CMMagnetometerData *magnetometerData COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* startMagnetometerUpdates
*
* Discussion:
* Starts magnetometer updates with no handler. To receive the latest magnetometer data
* when desired, examine the magnetometerData property.
*/
- (void)startMagnetometerUpdates COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* startMagnetometerUpdatesToQueue:withHandler:
*
* Discussion:
* Starts magnetometer updates, providing data to the given handler through the given queue.
*/
- (void)startMagnetometerUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMMagnetometerHandler)handler COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* stopMagnetometerUpdates
*
* Discussion:
* Stops magnetometer updates.
*/
- (void)stopMagnetometerUpdates COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* deviceMotionUpdateInterval
*
* Discussion:
* The interval at which to deliver device motion data to the specified
* handler once startDeviceMotionUpdatesToQueue:withHandler: is called.
* The units are in seconds. The value of this property is capped to
* certain minimum and maximum values. The maximum value is determined by
* the maximum frequency supported by the hardware. If sensitive to the
* interval of device motion data, an application should always check the
* timestamps on the delivered CMDeviceMotion instances to determine the
* true update interval.
*/
@property(assign, nonatomic) NSTimeInterval deviceMotionUpdateInterval API_UNAVAILABLE(tvos);
/*
* availableAttitudeReferenceFrames
*
* Discussion:
* Returns a bitmask specifying the available attitude reference frames on the device.
*/
+ (CMAttitudeReferenceFrame)availableAttitudeReferenceFrames COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* attitudeReferenceFrame
*
* Discussion:
* If device motion is active, returns the reference frame currently in-use.
* If device motion is not active, returns the default attitude reference frame
* for the device. If device motion is not available on the device, the value
* is undefined.
*
*/
@property(readonly, nonatomic) CMAttitudeReferenceFrame attitudeReferenceFrame COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* deviceMotionAvailable
*
* Discussion:
* Determines whether device motion is available using any available attitude reference frame.
*/
@property(readonly, nonatomic, getter=isDeviceMotionAvailable) BOOL deviceMotionAvailable API_UNAVAILABLE(tvos);
/*
* deviceMotionActive
*
* Discussion:
* Determines whether the CMMotionManager is currently providing device
* motion updates.
*/
@property(readonly, nonatomic, getter=isDeviceMotionActive) BOOL deviceMotionActive API_UNAVAILABLE(tvos);
/*
* deviceMotion
*
* Discussion:
* Returns the latest sample of device motion data, or nil if none is available.
*/
@property(readonly, nullable) CMDeviceMotion *deviceMotion API_UNAVAILABLE(tvos);
/*
* startDeviceMotionUpdates
*
* Discussion:
* Starts device motion updates with no handler. To receive the latest device motion data
* when desired, examine the deviceMotion property. Uses the default reference frame for
* the device. Examine CMMotionManager's attitudeReferenceFrame to determine this.
*/
- (void)startDeviceMotionUpdates API_UNAVAILABLE(tvos);
/*
* startDeviceMotionUpdatesToQueue:withHandler:
*
* Discussion:
* Starts device motion updates, providing data to the given handler through the given queue.
* Uses the default reference frame for the device. Examine CMMotionManager's
* attitudeReferenceFrame to determine this.
*
*/
- (void)startDeviceMotionUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMDeviceMotionHandler)handler API_UNAVAILABLE(tvos);
/*
* startDeviceMotionUpdatesUsingReferenceFrame:
*
* Discussion:
* Starts device motion updates with no handler. To receive the latest device motion data
* when desired, examine the deviceMotion property. The specified frame will be used as
* reference for the attitude estimates.
*
*/
- (void)startDeviceMotionUpdatesUsingReferenceFrame:(CMAttitudeReferenceFrame)referenceFrame COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* startDeviceMotionUpdatesUsingReferenceFrame:toQueue:withHandler
*
* Discussion:
* Starts device motion updates, providing data to the given handler through the given queue.
* The specified frame will be used as reference for the attitude estimates.
*
*/
- (void)startDeviceMotionUpdatesUsingReferenceFrame:(CMAttitudeReferenceFrame)referenceFrame toQueue:(NSOperationQueue *)queue withHandler:(CMDeviceMotionHandler)handler COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
/*
* stopDeviceMotionUpdates
*
* Discussion:
* Stops device motion updates.
*/
- (void)stopDeviceMotionUpdates API_UNAVAILABLE(tvos);
/*
* showsDeviceMovementDisplay
*
* Discussion:
* When the device requires movement, showsDeviceMovementDisplay indicates if the system device
* movement display should be shown. Note that when device requires movement,
* CMErrorDeviceRequiresMovement is reported once via CMDeviceMotionHandler. By default,
* showsDeviceMovementDisplay is NO.
*/
@property(assign, nonatomic) BOOL showsDeviceMovementDisplay COREMOTION_EXPORT API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macos) API_UNAVAILABLE(tvos);
@end
NS_ASSUME_NONNULL_END
// ========== CoreMotion.framework/Headers/CMGyro.h
/*
* CMGyro.h
* CoreMotion
*
* Copyright (c) 2010 Apple Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import <CoreMotion/CMLogItem.h>
#import <CoreMotion/CMAvailability.h>
NS_ASSUME_NONNULL_BEGIN
/*
* CMRotationRate
*
* Discussion:
* A structure containing 3-axis rotation rate data.
*
* Fields:
* x:
* X-axis rotation rate in radians/second. The sign follows the right hand
* rule (i.e. if the right hand is wrapped around the X axis such that the
* tip of the thumb points toward positive X, a positive rotation is one
* toward the tips of the other 4 fingers).
* y:
* Y-axis rotation rate in radians/second. The sign follows the right hand
* rule (i.e. if the right hand is wrapped around the Y axis such that the
* tip of the thumb points toward positive Y, a positive rotation is one
* toward the tips of the other 4 fingers).
* z:
* Z-axis rotation rate in radians/second. The sign follows the right hand
* rule (i.e. if the right hand is wrapped around the Z axis such that the
* tip of the thumb points toward positive Z, a positive rotation is one
* toward the tips of the other 4 fingers).
*/
typedef struct {
double x;
double y;
double z;
} CMRotationRate;
/*
* CMGyroData
*
* Discussion:
* Contains a single gyro measurement.
*
*/
COREMOTION_EXPORT API_AVAILABLE(ios(4.0))
@interface CMGyroData : CMLogItem
{
@private
id _internal;
}
/*
* rotationRate
*
* Discussion:
* The rotation rate as measured by the gyro.
*
*/
@property(readonly, nonatomic) CMRotationRate rotationRate;
@end
NS_ASSUME_NONNULL_END
// ========== CoreMotion.framework/Headers/CMMovementDisorderManager.h
//
// CMMovementDisorderManager.h
// CoreMotion
//
// Copyright (c) 2018 Apple Inc. All rights reserved.
//
#import <CoreMotion/CMAvailability.h>
#import <CoreMotion/CMAuthorization.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @class CMDyskineticSymptomResult
* @discussion A CMDyskineticSymptomResult object describes the presence and prevalence of dyskinetic symptoms (specifically, choreiform movements) during a one minute result period when subjects wear the Apple Watch on their most affected arm.
* percentUnlikely + percentLikely = 1.0
* Please note dyskinetic symptom measurements are designed for subjects with known presence of chorea in the arm and should not be displayed to users who do not report episodes of dyskinetic symptoms.
*/
API_AVAILABLE(ios(12.0), watchos(5.0)) API_UNAVAILABLE(macos, tvos)
@interface CMDyskineticSymptomResult : NSObject <NSCopying, NSSecureCoding>
/*!
* @brief The date and time representing the start of the result.
*/
@property (copy, nonatomic, readonly) NSDate *startDate;
/*!
* @brief The date and time representing the end of the result.
*/
@property (copy, nonatomic, readonly) NSDate *endDate;
/*!
* @brief The percentage of time dyskinetic symptoms were unlikely for the result.
*/
@property (nonatomic, readonly) float percentUnlikely;
/*!
* @brief The percentage of time dyskinetic symptoms were likely for the result.
*/
@property (nonatomic, readonly) float percentLikely;
@end
/*!
* @class CMTremorResult
* @discussion A CMTremorResult object describes the presence and prevalence of tremor symptoms (specifically, resting tremor) during a one minute result period when subjects wear the Apple Watch on their most affected arm.
* percentUnknown + percentNoTremor + percentTremorSlight + percentTremorMild + percentTremorModerate + percentTremorStrong = 1.0
*/
API_AVAILABLE(ios(12.0), watchos(5.0)) API_UNAVAILABLE(macos, tvos)
@interface CMTremorResult : NSObject <NSCopying, NSSecureCoding>
/*!
* @brief The date and time representing the start of the result.
*/
@property (copy, nonatomic, readonly) NSDate *startDate;
/*!
* @brief The date and time representing the end of the result.
*/
@property (copy, nonatomic, readonly) NSDate *endDate;
/*!
* @discussion The percentage of time tremor was unknown for the result.
* Unknown periods include times when:
* 1. the subject is moving and therefore a resting tremor cannot be assessed, and
* 2. the signal strength is too low to measure tremor confidently.
*/
@property (nonatomic, readonly) float percentUnknown;
/*!
* @brief The percentage of time no tremor was detected for the result.
*/
@property (nonatomic, readonly) float percentNone;
/*!
* @brief The percentage of time tremor was likely and displacement amplitude was slight for the result.
*/
@property (nonatomic, readonly) float percentSlight;
/*!
* @brief The percentage of time tremor was likely and displacement amplitude was mild for the result.
*/
@property (nonatomic, readonly) float percentMild;
/*!
* @brief The percentage of time tremor was likely and displacement amplitude was moderate for the result.
*/
@property (nonatomic, readonly) float percentModerate;
/*!
* @brief The percentage of time tremor was likely and displacement amplitude was strong for the result.
*/
@property (nonatomic, readonly) float percentStrong;
@end
/*!
* @typedef CMDyskineticSymptomResultHandler
* @brief Completion handler for CMDyskineticSymptomResult values.
*/
typedef void(^CMDyskineticSymptomResultHandler)(NSArray<CMDyskineticSymptomResult *> * _Nonnull dyskineticSymptomResult, NSError * _Nullable error) API_AVAILABLE(watchos(5.0)) API_UNAVAILABLE(ios, macos, tvos);
/*!
* @typedef CMTremorResultHandler
* @brief Completion handler for CMTremorResult values.
*/
typedef void(^CMTremorResultHandler)(NSArray<CMTremorResult *> * _Nonnull tremorResult, NSError * _Nullable error) API_AVAILABLE(watchos(5.0)) API_UNAVAILABLE(ios, macos, tvos);
/*!
* @class CMMovementDisorderManager
* @discussion A CMMovementDisorderManager object with methods for persistence and query of movement disorder results.
*/
API_AVAILABLE(watchos(5.0)) API_UNAVAILABLE(ios, macos, tvos)
@interface CMMovementDisorderManager : NSObject
/*!
* @method isAvailable
* @discussion Whether movement disorder results are available on this platform.
* @return Returns the availability of movement disorder results on this platform.
*/
+ (BOOL)isAvailable;
/*!
* @method authorizationStatus
* @discussion Authorization status of movement disorder results for this user.
* @return Returns the authorization status of movement disorder results for this user.
*/
+ (CMAuthorizationStatus)authorizationStatus;
/*!
* @method monitorKinesiasForDuration:
* @discussion Enables the calculation and persistence of result values for the specified duration in seconds.
* @param duration The duration in seconds to enable the calculation and persistence of result values.
* @warning Please note that the maximum duration allowed is seven (7) days.
*/
- (void)monitorKinesiasForDuration:(NSTimeInterval)duration;
/*!
* @method queryDyskineticSymptomFromDate:toDate:withHandler:
* @discussion Queries the system for result values for the specified date range.
* @param fromDate The begin date for the query range.
* @param toDate The end date for the query range.
* @param handler The completion handler for accessing and processing result values.
* @warning Please note that movement disorder results are available for a maximum of seven (7) days.
*/
- (void)queryDyskineticSymptomFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate withHandler:(CMDyskineticSymptomResultHandler)handler;
/*!
* @method queryTremorFromDate:toDate:withHandler:
* @discussion Queries the system for result values for the specified date range.
* @param fromDate The begin date for the query range.
* @param toDate The end date for the query range.
* @param handler The completion handler for accessing and processing result values.
* @warning Please note that movement disorder results are available for a maximum of seven (7) days.
*/
- (void)queryTremorFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate withHandler:(CMTremorResultHandler)handler;
/*!
* @method lastProcessedDate
* @discussion The last time that data has been processed; queries for periods before this point will return their final results. Data after this point may become available later if monitoring is continuing.
* @warning Returns nil if no data has been processed or monitoring was not enabled.
*/
- (NSDate * _Nullable)lastProcessedDate;
/*!
* @method monitorKinesiasExpirationDate
* @discussion The expiration date for the most recent monitoring period.
* @warning Returns nil if no previous monitoring period is available.
*/
- (NSDate * _Nullable)monitorKinesiasExpirationDate;
@end
NS_ASSUME_NONNULL_END
// ========== CoreMotion.framework/Headers/CMError.h
/*
* CMError.h
* CoreMotion
*
* Copyright (c) 2010 Apple Inc. All rights reserved.
*
*/
/*
* CMError
*
* Discussion:
* Error returned as code to NSError from CoreMotion.
*/
typedef enum {
CMErrorNULL = 100,
CMErrorDeviceRequiresMovement,
CMErrorTrueNorthNotAvailable,
CMErrorUnknown,
CMErrorMotionActivityNotAvailable,
CMErrorMotionActivityNotAuthorized,
CMErrorMotionActivityNotEntitled,
CMErrorInvalidParameter,
CMErrorInvalidAction,
CMErrorNotAvailable,
CMErrorNotEntitled,
CMErrorNotAuthorized
} CMError;
// ========== CoreMotion.framework/Headers/CMAltitude.h
/*
* CMAltitude.h
* CoreMotion
*
* Copyright (c) 2014 Apple Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import <CoreMotion/CMLogItem.h>
#import <CoreMotion/CMAvailability.h>
NS_ASSUME_NONNULL_BEGIN
/*
* CMAltitudeData
*
* Discussion:
* Contains a single altimeter measurement.
*/
COREMOTION_EXPORT API_AVAILABLE(ios(8.0)) API_UNAVAILABLE(macos)
@interface CMAltitudeData : CMLogItem
/*