summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h')
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h
new file mode 100644
index 0000000..ebcaef7
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h
@@ -0,0 +1,104 @@
1//
2// THV3.h
3// iHealthDemoCode
4//
5// Created by Realank on 2016/12/23.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 THV3RcvDataType
13 */
14typedef NS_ENUM(NSUInteger, THV3RcvDataType) {
15 /// recieve real time temperature
16 THV3RcvDataRT,
17 /// recieve button event
18 THV3RcvDataButtonStatus,
19};
20
21/**
22 THV3RcvButtonType
23 */
24typedef NS_ENUM(NSUInteger, THV3RcvButtonType) {
25 /// placeholder
26 THV3RcvBtnNone,
27 /// power button
28 THV3RcvBtnPower,
29 /// audio button
30 THV3RcvBtnAudio,
31 /// M button
32 THV3RcvBtnMemory,
33 /// unit button
34 THV3RcvBtnCF
35
36};
37
38/**
39 THV3Status
40 */
41typedef NS_ENUM(NSUInteger, THV3Status) {
42 /// not init
43 THV3StatusUnInit,
44 /// init time
45 THV3StatusInitTime,
46 /// init configuration
47 THV3StatusInitConfig,
48 /// working
49 THV3StatusWorking,
50};
51
52@interface THV3HistoryData : NSObject
53@property (nonatomic, strong) NSDate* measureDate;
54@property (nonatomic, assign) float temperature;
55@property (nonatomic, assign) BOOL isHumanBody;
56@end
57
58/**
59 ReceiveHistoryBlock
60
61 @param dataArray THV3HistoryData object's array
62 */
63typedef void(^ReceiveHistoryBlock)(NSArray<THV3HistoryData*>* dataArray);
64
65/**
66 ConfigResultBlock
67
68 @param success YES:success NO:fail
69 */
70typedef void(^ConfigResultBlock)(BOOL success);
71
72@interface THV3 : NSObject
73
74@property (nonatomic, assign) THV3Status status;//status to flag whether device is ready
75@property (strong, nonatomic) NSString *name;
76@property (strong, nonatomic) NSString *currentUUID;
77//‘serialNumber’ is for separating different device when multiple device have been connected.
78@property (strong, nonatomic) NSString *serialNumber;//MAC
79@property (strong, nonatomic) NSTimer *firmwareVersion;
80
81@property (nonatomic, assign) THV3RcvDataType rtDataType;
82@property (nonatomic, strong) THV3HistoryData* rtTemperature;// for temperature
83@property (nonatomic, assign) BOOL voltIsNormal;// for battary
84@property (nonatomic, assign) THV3RcvButtonType buttonType;//for button use
85@property (nonatomic, assign) BOOL isButtonOn;//for button use
86
87//status
88@property (nonatomic, assign) NSInteger idleTimeInterval;
89@property (nonatomic, assign) BOOL isUnitCelsius;
90@property (nonatomic, assign) BOOL isTargetHuman;
91@property (nonatomic, assign) BOOL isOfflineMode;
92
93- (void)readHistoryDataWithResultBlock:(ReceiveHistoryBlock)receivedDataBlock;
94
95- (void)configIdleTime:(NSUInteger)timeInterval withResultBlock:(ConfigResultBlock)resultBlock;
96- (void)configTemperUnit:(BOOL)isCelsius withResultBlock:(ConfigResultBlock)resultBlock;
97- (void)configMeasureTarget:(BOOL)isHumanBody withResultBlock:(ConfigResultBlock)resultBlock;
98- (void)configOfflineMode:(BOOL)isOffline withResultBlock:(ConfigResultBlock)resultBlock;
99
100/**
101 Disconnect device. If this method is called immediately after "readHistoryDataWithResultBlock:" method, the history data will not be cleared automatically.
102 */
103- (void)commandDisconnectDevice;
104@end