diff options
| author | hc <haocheng.xie@respiree.com> | 2026-04-13 15:17:52 +0800 |
|---|---|---|
| committer | hc <haocheng.xie@respiree.com> | 2026-04-13 15:17:52 +0800 |
| commit | d6d9a09d505d11148599a95a5be3e1351edbe0ac (patch) | |
| tree | a5f5891983d1ff207e99f683a5e151519cef4980 /libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h | |
| parent | e4fb9966e762852bf17f21c8406501d42fae0b61 (diff) | |
Local iHealth SDK, device detail screen, iOS event fixes
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h')
| -rw-r--r-- | libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h new file mode 100644 index 0000000..98b62cc --- /dev/null +++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h | |||
| @@ -0,0 +1,188 @@ | |||
| 1 | // | ||
| 2 | // AM3.h | ||
| 3 | // testShareCommunication | ||
| 4 | // | ||
| 5 | // Created by daiqingquan on 13-10-15. | ||
| 6 | // Copyright (c) 2013年 my. All rights reserved. | ||
| 7 | // | ||
| 8 | |||
| 9 | #import <Foundation/Foundation.h> | ||
| 10 | #import "AMMacroFile.h" | ||
| 11 | |||
| 12 | /** | ||
| 13 | AM3 | ||
| 14 | */ | ||
| 15 | @interface AM3 : NSObject | ||
| 16 | @property (strong, nonatomic) NSString *currentUUID; | ||
| 17 | @property (strong, nonatomic) NSString *serialNumber; | ||
| 18 | @property (strong, nonatomic) NSString *firmwareVersion; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Get device userID | ||
| 22 | * @param getDeviceUserIDBlock get userID | ||
| 23 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 24 | */ | ||
| 25 | -(void)commandAM3GetDeviceUserID:(DisposeAM3GetDeviceUserIDBlock)getDeviceUserIDBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 26 | |||
| 27 | |||
| 28 | /** | ||
| 29 | * Sync time | ||
| 30 | * @param syncTimeBlock True: Success, False: Failed. | ||
| 31 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 32 | */ | ||
| 33 | -(void)commandAM3SyncTime:(DisposeAM3SyncTimeBlock)syncTimeBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 34 | |||
| 35 | |||
| 36 | /** | ||
| 37 | * Set time format and nation | ||
| 38 | * @param timeFormat AM3TimeFormat_hh,AM3TimeFormat_HH | ||
| 39 | * @param setTimeFormatBlock True: Success, False: Failed. | ||
| 40 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 41 | * @Notice Notice: Firmware version 1.1.9 and above supports this function | ||
| 42 | */ | ||
| 43 | -(void)commandAM3SetTimeFormatAndNation:(AM3TimeFormat)timeFormat withFinishResult:(DisposeAM3TimeFormatSettingBlock)setTimeFormatBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 44 | |||
| 45 | /** | ||
| 46 | * Binding AM3 to user,Account binding requires an active internet connection. | ||
| 47 | * @param userID userID, ranging from 1 – 2147483647. | ||
| 48 | * @param finishResultBlock True: Success, False: Failed. | ||
| 49 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 50 | */ | ||
| 51 | -(void)commandAM3SetUserID:(NSNumber*)userID withFinishResult:(DisposeAM3SetDeviceUserIDBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 52 | |||
| 53 | |||
| 54 | /** | ||
| 55 | * AM3 initialization,Must be called the first time to ensure that the AM3 has correct user information, goals, time, battery checks, etc. | ||
| 56 | * @param user User information, needs to include the following:age(int)、height(cm,1-255)、weight(kg,1-255)、bmr(user basal metabolic)、sex(UserSex_Female or UserSex_Male)、activityLevel (activityLevel=1, Sedentary,spend most of day sitting.activityLevel=2, Active,spend a good part of day doing some physical activity.activityLevel=3, Very Active,spend most of day doing heavy physical activity.) | ||
| 57 | * @param unit AM3StateUnit_mile or AM3StateUnit_km | ||
| 58 | * @param activeGoalNumber User goal number of steps,ranging from 4 – 65535. Default is 10,000 | ||
| 59 | * @param setUserInfoFinishBlock True: Success, False: Failed. | ||
| 60 | * @param setBMRFinishResultBlock True: Success, False: Failed. | ||
| 61 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 62 | */ | ||
| 63 | -(void)commandAM3SetUserInfo:(HealthUser *)user withUnit:(AM3StateUnit)unit withActiveGoal:(NSNumber *)activeGoalNumber withSetUserInfoFinishResult:(DisposeAM3SetUserInfoBlock)setUserInfoFinishBlock withSetBMR:(DisposeAM3SetBMRBlock)setBMRFinishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 64 | |||
| 65 | |||
| 66 | /** | ||
| 67 | * Upload AM3 data,Data type: 5 minutes of active data, total number of steps for the day, and total calories.Also includes the number of steps for the 5 minutes of motion data, total calories for the current time, calories of the steps, and total calories. | ||
| 68 | * @param activeTransmissionBlock activeTransmission: Start uploading motion data, including parameters:Start date,yyyy-MM-dd(ActiveHistoryDateYear,ActiveHistoryDateMonth,ActiveHistoryDateDay),ActiveStepSize:Length of each step,ActiveHistoryTotoalNum:Number of records. | ||
| 69 | * @param activeHistoryDataBlock active data,including the following parameters:AMDate、AMCalorie、AMstepNum、AMstepSize、dataID、Start. AMDate:Workout time,AMCalorie: Current time total calories,AMStepNum:Total number of steps,dataID:data ID,Start:represents the beginning of a movement. | ||
| 70 | * @param activeFinishTransmissionBlock Upload complete. | ||
| 71 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 72 | */ | ||
| 73 | -(void)commandAM3StartSyncActiveData:(DisposeAM3ActiveStartTransmission)activeTransmissionBlock withActiveHistoryData:(DisposeAM3ActiveHistoryData)activeHistoryDataBlock withActiveFinishTransmission:(DisposeAM3ActiveFinishTransmission)activeFinishTransmissionBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 74 | |||
| 75 | |||
| 76 | /** | ||
| 77 | * Upload AM3 data,Data type: 5 minutes of sleep data, | ||
| 78 | * @param sleepTransmissionBlock sleepTransmission:Start uploading sleep data,, including parameters:SleepHistoryDate、AM3SleepHistoryTotoalNum.SleepHistoryDate:Sleep start time,yyyy-MM-dd HH:mm:ss(SleepHistoryDateYear,SleepHistoryDateMonth,SleepHistoryDateDay,SleepHistoryDateHour,SleepHistoryDateMinute,SleepHistoryDateSeconds).SleepHistoryTotoalNum: Number of records | ||
| 79 | * @param sleepHistoryDataBlock Sleep data, including the following parameters::AMDate、SleepData、dataID.AMDate:Sleep time, SleepData: Sleep grade, 0: awake, 1: light sleep, 2: deep sleep ,dataID: data ID. | ||
| 80 | * @param sleepFinishTransmissionBlock Upload complete. | ||
| 81 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 82 | */ | ||
| 83 | -(void)commandAM3StartSyncSleepData:(DisposeAM3SleepStartTransmission)sleepTransmissionBlock withSleepHistoryData:(DisposeAM3SleepHistoryData)sleepHistoryDataBlock withSleepFinishTransmission:(DisposeAM3SleepFinishTransmission)sleepFinishTransmissionBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 84 | |||
| 85 | /** | ||
| 86 | * Upload AM3 data,Data type: Sync current active data | ||
| 87 | * @param currentActiveInfoBlock Total calories and steps for today, including parameters:Step、Calories、TotalCalories.Step:Number of steps taken today.Calories:Number of calories burned today.TotalCalories:Sum calories burned and bmr today. | ||
| 88 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 89 | */ | ||
| 90 | -(void)commandAM3StartSyncCurrentActiveData:(DisposeAM3GetCurrentActiveInfo)currentActiveInfoBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 91 | |||
| 92 | /** | ||
| 93 | * Get totoal alarm infomation | ||
| 94 | * @param totoalAlarmInfoBlock Alarm array contains up to 3 alarms, each one needs the following parameters:AlarmId、Time、Week.AlarmId:1, 2, 3.Time:HH:mm.Week(Sun、Mon、Tue、Wed、Thu、Fri、Sat)True: On, False: Off | ||
| 95 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 96 | */ | ||
| 97 | -(void)commandAM3GetTotoalAlarmInfo:(DisposeAM3TotoalAlarmData)totoalAlarmInfoBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 98 | |||
| 99 | /** | ||
| 100 | * Set alarm. | ||
| 101 | * @param alarmDic Alarm information, include parameters:AlarmId、Time、IsRepeat、Switch、(Sun、Mon、Tue、Wed、Thu、Fri、Sat) | ||
| 102 | * @param finishResultBlock True: Alarm set successfully,False: Failed. | ||
| 103 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 104 | */ | ||
| 105 | -(void)commandAM3SetAlarmDictionary:(NSDictionary *)alarmDic withFinishResult:(DisposeAM3SetAlarmBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 106 | |||
| 107 | /** | ||
| 108 | * Delete alarm. | ||
| 109 | * @param alarmID alarmID:1, 2, 3. | ||
| 110 | * @param finishResultBlock True: Delete successful,False: Failed | ||
| 111 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 112 | */ | ||
| 113 | -(void)commandAM3DeleteAlarmID:(NSNumber *)alarmID withFinishResult:(DisposeAM3DeleteAlarmBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 114 | |||
| 115 | |||
| 116 | /** | ||
| 117 | * Get reminder. | ||
| 118 | * @param remindInfoBlock Array containing following parameters:ReminderID、Time、Switch.ReminderID:Reminder ID.Time:format HH:mm, time between reminders (HH*60+mm) minutes.Switch:Reminder on/off,True: On, False: Off. | ||
| 119 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 120 | */ | ||
| 121 | -(void)commandAM3GetReminderInfo:(DisposeAM3RemindInfoBlock)remindInfoBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 122 | |||
| 123 | /** | ||
| 124 | * Set reminders. | ||
| 125 | * @param reminderDic Array containing collowing parameters:Time、Switch。 | ||
| 126 | * @param finishResultBlock YES: Successfully set, NO: Failed. | ||
| 127 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 128 | */ | ||
| 129 | -(void)commandAM3SetReminderDictionary:(NSDictionary *)reminderDic withFinishResult:(DisposeAM3SetReminderBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 130 | |||
| 131 | /** | ||
| 132 | * Get device state infomation | ||
| 133 | * @param deviceStateInfoBlock AM status,State_wrist (AM3 being worn on the wrist),State_waist (AM3 worn with belt clip). | ||
| 134 | * @param batteryBlock AM3 battery percentage, from 0~100. | ||
| 135 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 136 | */ | ||
| 137 | -(void)commandAM3GetDeviceStateInfo:(DisposeAM3StateInfoBlock)deviceStateInfoBlock withBattery:(DisposeAM3BatteryBlock)batteryBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 138 | |||
| 139 | /** | ||
| 140 | * Restore factory settings. | ||
| 141 | * @param resetDeviceBlock True: Success, False: Failed. | ||
| 142 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 143 | */ | ||
| 144 | -(void)commandAM3ResetDevice:(DisposeAM3ResetDeviceBlock)resetDeviceBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 145 | |||
| 146 | /** | ||
| 147 | * Disconnect AM3 connection. | ||
| 148 | * @param disconnectBlock True: Success,False: Failed. | ||
| 149 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 150 | */ | ||
| 151 | -(void)commandAM3Disconnect:(DisposeAM3DisconnectBlock)disconnectBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 152 | |||
| 153 | |||
| 154 | /** | ||
| 155 | * Get time format | ||
| 156 | * @param timeFormat (AM3TimeFormat_hh,AM3TimeFormat_HH) | ||
| 157 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 158 | * @Notice Notice: Firmware version 1.1.9 and above supports this function | ||
| 159 | */ | ||
| 160 | -(void)commandAM3GetTimeFormat:(DisposeAM3TimeFormatBlock)timeFormat withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 161 | |||
| 162 | |||
| 163 | /** | ||
| 164 | * Get user infomation | ||
| 165 | * @param userInfoBlock including parameters:Age,Step,Height,Gender,Weight,Unit,goal(TotalStep1、TotalStep2、TotalStep3) | ||
| 166 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 167 | */ | ||
| 168 | -(void)commandAM3GetUserInfo:(DisposeAM3UserInfoBlock)userInfoBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 169 | |||
| 170 | /** | ||
| 171 | * Set state model | ||
| 172 | * @param state including AM3SetStateModel_sleep,AM3SetStateModel_active,AM3SetStateModel_fly,AM3SetStateModel_drive | ||
| 173 | * @param finishResultBlock True: Delete successful,False: Failed | ||
| 174 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 175 | * @Notice Notice: Firmware version 1.1.1 and above supports AM3SetStateModel_drive | ||
| 176 | */ | ||
| 177 | -(void)commandAM3SetStateModel:(AM3StateModel)state withFinishResult:(DisposeAM3SetStateModelBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 178 | |||
| 179 | |||
| 180 | /** | ||
| 181 | * Set BMR | ||
| 182 | * @param bmr ranging from 0 – 5000. | ||
| 183 | * @param finishResultBlock True: Delete successful,False: Failed | ||
| 184 | * @param errorBlock Communication error codes, see AM3 error descriptions. | ||
| 185 | * @Notice Notice: Firmware version 1.0.2 and above supports this function | ||
| 186 | */ | ||
| 187 | -(void)commandAM3SetBMR:(NSNumber *)bmr withFinishResult:(DisposeAM3SetBMRBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock; | ||
| 188 | @end | ||
