diff options
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h')
| -rw-r--r-- | libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h new file mode 100644 index 0000000..8f7a96b --- /dev/null +++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h | |||
| @@ -0,0 +1,131 @@ | |||
| 1 | // | ||
| 2 | // BPDevice.h | ||
| 3 | // iHealthDemoCode | ||
| 4 | // | ||
| 5 | // Created by Realank on 2017/1/4. | ||
| 6 | // Copyright © 2017年 ihealthSDK. All rights reserved. | ||
| 7 | // | ||
| 8 | |||
| 9 | #import <Foundation/Foundation.h> | ||
| 10 | #import "BPMacroFile.h" | ||
| 11 | |||
| 12 | |||
| 13 | /** | ||
| 14 | a BP protocol related to realtime measure | ||
| 15 | */ | ||
| 16 | @protocol BPRealtimeMeasureProtocol <NSObject> | ||
| 17 | |||
| 18 | /** | ||
| 19 | * Establish measurement connection and start BP measurement. | ||
| 20 | * @param blockZeroState Zeroing state | ||
| 21 | * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’. | ||
| 22 | * @param blockWaveletWithHeartbeat Wavelet data set including pulse rate | ||
| 23 | * @param blockWaveletWithoutHeartbeat Wavelet data set without pulse rate | ||
| 24 | * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant key: time, sys, dia, heartRate, irregular. irregular will be 0 or 1. | ||
| 25 | * @param error Return error codes. | ||
| 26 | */ | ||
| 27 | -(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * stop measuring state of BP | ||
| 31 | * @param success The block return means measurement has been successfully stoped. | ||
| 32 | * @param error Return error codes. | ||
| 33 | */ | ||
| 34 | -(void)stopBPMeassureSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error; | ||
| 35 | |||
| 36 | @end | ||
| 37 | |||
| 38 | |||
| 39 | /** | ||
| 40 | a BP protocol related to offline data transfer | ||
| 41 | */ | ||
| 42 | @protocol BPOfflineDataTransferProtocol <NSObject> | ||
| 43 | |||
| 44 | /** | ||
| 45 | * Upload offline data. | ||
| 46 | * @param totalCount quantity of total history data | ||
| 47 | * @param progress upload completion ratio , from 0.0 to 1.0, 1.0 means upload completed. | ||
| 48 | * @param uploadDataArray offline data set, may including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment,scheme ID, body movement flag. corresponding KEYs are time, sys, dia, heartRate, irregular,schemeID,bodyMovementFlg. | ||
| 49 | * @param error Return error codes. | ||
| 50 | */ | ||
| 51 | -(void)commandTransferMemoryDataWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error; | ||
| 52 | |||
| 53 | |||
| 54 | /** | ||
| 55 | * Upload offline data total Count. | ||
| 56 | * @param totalCount quantity of total history data. | ||
| 57 | * @param error Return error codes. | ||
| 58 | */ | ||
| 59 | -(void)commandTransferMemoryTotalCount:(BlockBachCount)totalCount errorBlock:(BlockError)error; | ||
| 60 | |||
| 61 | -(void)commandDeleteDataSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error; | ||
| 62 | |||
| 63 | @end | ||
| 64 | |||
| 65 | |||
| 66 | /** | ||
| 67 | a BP protocol related to basic function, such as get function, get energy | ||
| 68 | */ | ||
| 69 | @protocol BPBasicProtocol <NSObject> | ||
| 70 | |||
| 71 | /** | ||
| 72 | * Synchronize time and judge if the device supports BT auto-connection, offline detection, and if the function on or off, corresponding KEY are haveBlue, haveOffline, blueOpen, offlineOpen. ‘True’ means yes or on, ‘False’ means no or off | ||
| 73 | * @param function A block to return the function and states that the device supports. | ||
| 74 | * @param error Return error codes. | ||
| 75 | */ | ||
| 76 | -(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error; | ||
| 77 | |||
| 78 | /** | ||
| 79 | * Get battery remaining energy by percent | ||
| 80 | * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%. | ||
| 81 | * @param error Return error codes. | ||
| 82 | */ | ||
| 83 | -(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error; | ||
| 84 | |||
| 85 | @end | ||
| 86 | |||
| 87 | |||
| 88 | /** | ||
| 89 | a BP protocol related to basic function and disconnect | ||
| 90 | */ | ||
| 91 | @protocol BPBasicBTLEProtocol <BPBasicProtocol> | ||
| 92 | |||
| 93 | /** | ||
| 94 | * Disconnect current device | ||
| 95 | */ | ||
| 96 | -(void)commandDisconnectDevice; | ||
| 97 | |||
| 98 | @end | ||
| 99 | |||
| 100 | |||
| 101 | /** | ||
| 102 | a BP protocol related to enable offline | ||
| 103 | */ | ||
| 104 | @protocol BPEnableOfflineProtocol <BPBasicProtocol> | ||
| 105 | |||
| 106 | /** | ||
| 107 | * set up offline detection | ||
| 108 | * @param open True means on; False means off. | ||
| 109 | * @param successBlock A block to refer ‘set success’. | ||
| 110 | * @param errorBlock A block to refer ‘set failed’. | ||
| 111 | */ | ||
| 112 | -(void)commandSetOffline:(BOOL)open success:(BlockSuccess)successBlock error:(BlockError)errorBlock; | ||
| 113 | |||
| 114 | @end | ||
| 115 | |||
| 116 | |||
| 117 | /** | ||
| 118 | BP device basic class | ||
| 119 | */ | ||
| 120 | @interface BPDevice : NSObject | ||
| 121 | |||
| 122 | @property (copy, nonatomic) NSString *currentUUID; | ||
| 123 | ///‘serialNumber’ is for separating different device when multiple device have been connected. | ||
| 124 | @property (copy, nonatomic) NSString *serialNumber; | ||
| 125 | @property (copy, nonatomic) NSString *firmwareVersion; | ||
| 126 | @property (copy, nonatomic) NSString *hardwareVersion; | ||
| 127 | @property (copy, nonatomic) NSString *deviceName; | ||
| 128 | @property (copy, nonatomic) NSString *protocolString; | ||
| 129 | @property (copy, nonatomic) NSString *modelNumber; | ||
| 130 | @property (copy, nonatomic) NSNumber *isNew550BT; | ||
| 131 | @end | ||
