Data exchange function (new)
10.1 Functional Overview
When an exercise is initiated in the app, the bracelet will calculate the heart rate and calories from the exercise data generated by the app and return it to the app for data exchange; When the wristband starts to exercise, the exercise data generated by the wristband is sent to the App regularly to display the exercise data in real time. The exchange data is based on time as the only reference. During the exchange process, the current activity data needs to be judged by the movement start time. If the time does not correspond, the data cannot be exchanged.。
10.2 Initialize motion data
Parameters | Description | Notes |
---|---|---|
v2Model | Current Interaction v2 Data Model | IDOV2DataExchangeModel |
v3Model | Current Interaction v3 Data Model | IDOV3DataExchangeModel |
isV3ActivityExchange | Is it a v3 active data exchange | bool (Otherwise v2 active data exchange) |
exchangeStatus | Data exchange process status | Enum (IDO_EXCHANGE_DATA_STATUS) |
isNewDataExchange | Whether to use the new data interaction | Internal use, to distinguish old data exchange methods |
delegate | proxy object | id |
- IDOV2DataExchangeModel
Parameters | illustrate | Remarks |
---|---|---|
day | day | int |
hour | hour | int |
minute | minute | int |
second | second | int |
sportType | sportType | current menu v3SportsType、set100SportSort Support, motion type starts from 48, 1-29 motion type is v2 protocol refer to the IDOSportTypes file description for motion types |
targetType | targetType | int 0x00:no target, 0x01:Number of repetitions, unit: times, 0x02:Distance, unit: meters, 0x03:Calories, unit: kcal, 0x04:Duration, unit: minutes, 0x05: Number of steps, unit: step |
targetValue | target value | int |
forceStart | Whether to force start | int |
retCode | get into motion | 0:success; 1:Device has entered sport mode failed; 2: Device battery low failure; 3:bracelet is charging 4:is using Alexa 5:calling |
calories | calories | int (Unit:J) |
distance | distance | int (Unit:m) |
durations | durations< | int (Unit: minutes) |
step | step | int (Unit: step) |
avgHrValue | average heart rate | int |
maxHrValue | maximum heart rate | int |
burnFatMins | fat burning time | int (minute) |
aerobicMins | Cardio workout time | int (minute) |
limitMins | Maximum workout time | int (minute) |
isSave | Is it stored | BOOL |
status | status | 0:all valid, 1:Invalid distance, 2: gps Weak signal |
curHrValue | current heart rate | int |
hrValueSerial | serial number | int |
intervalSecond | heart rate interval | int |
hrValues | Heart rate data | array str json |
- IDOV3DataExchangeModel
Parameters | illustrate | Remarks |
---|---|---|
day | day | int |
hour | hour | int |
minute | minute | int |
second | second | int |
sportType | sportType | When the function table v3SportsType、set100SportSort support,Movement types start from 48, 1-29 movement types are v2 protocol refer to the IDOSportTypes file description for motion types |
planType | planType | int 0x01:running plan3km , 0x02:running plan 5km , 0x03:running plan 10km , 0x04:Half Marathon Training (Phase 2), 0x05: Marathon Training (Phase 2) |
actionType | actionType | int 1go fast; 2 Jogging; 3 Moderate Running; 4 Fast Running ; 5End the course movement (also wait for whether the user has free movement); 6 Free movement after the course ends (this field works when operate is 0x05) |
errorCode | errorCode | int 0x00:success other failure |
targetType | targetType/td> | int 0x00:No target, 0x01: number of repetitions, unit: times, 0x02:Distance, Unit: Meter, 0x03: Calories, Unit: Kcal, 0x04: duration, unit: minute, 0x05: number of steps, unit: step |
targetValue | targetValue | int |
forceStart | Whether to force start | int 0:Not mandatory, 1: Mandatory |
retCode | Code | 0:Success; 1:The device has failed to enter sports mode; 2: The device battery is low and failed; 3: The bracelet is charging 4: Alexa is being used 5: Calling |
dataVersion | dataVersion | int |
curHrValue | current heart rate | int |
calories | calories | int (unit:J) |
distance | distance | int (unit:m) |
durations | durations | int (Unit: minutes) |
step | step | int (Unit: step) |
swimPosture | swimPosture | int 0x00 : Medley; 0x01: Freestyle; 0x02: Breaststroke; 0x03: Backstroke; 0x04: Butterfly; |
status | get into motion | start: 1, pause: 2, end: 3, 0: invalid state |
isSave | Whether to store | BOOL |
realTimeSpeed | App calculation shows real-time speed, unit km/h, 100 times, 15 seconds a record | int |
realTimePace | App calculation shows real-time pace | int (Unit s) |
intervalSecond | heart rate interval | int |
heartRateCount | Heart rate count | int |
hrValues | Heart rate data | array str json |
warmUpSecond | Warm-up duration | int (seconds) |
anaeroicSecond | Anaerobic exercise duration | int (seconds) |
fatBurnSecond | fat burning workout duration | int (second) |
aerobicSecond | length of aerobic exercise | int (seconds) |
limitSecond | Maximum workout time | int (seconds) |
avgHrValue | average heart rate | int |
maxHrValue | maximum heart rate | int |
warmUpValue | warm-up value | int |
burnFatValue | fat burning exercise | int |
aerobicValue | aerobic exercise value | int |
limitValue | extreme sports value | int |
anaerobicValue | Anaerobic exercise value | int |
avgSpeed | average speed | km/h |
maxSpeed | Maximum speed | km/h |
avgStepFrequency | avgStepFrequency | int |
maxStepFrequency | maxStepFrequency | int |
avgStepStride | avg Step Stride | int |
maxStepStride | max Step Stride | int |
kmSpeed | Average km pace | int |
fastKmSpeed | Fastest km pace | int |
kmSpeedCount | Kilometer pace | int |
kmSpeeds | Kilometer pace collection | array |
mileCount | mile pace | array |
mileCount | mile pace | int |
mileSpeeds | mile pace collection | array |
stepsFrequencyCount | number of steps | int |
stepsFrequencys | cadence collection | array |
trainingEffect | Aerobic training effect | Unit: None Range1.0 ~ 5.0 (*10times) |
anaerobicTrainingEffect | anaerobicTrainingEffect | nit: None Range 1.0 ~ 5.0 (*10times) |
vo2Max | VO2 max | Unit: ml/kg/min; range 0-80 |
actionDataCount | The number of exercises in this exercise | int |
inClassCalories | In-class exercise calories | Unit kcal |
completionRate | Action completion rate | 0—100 |
hrCompletionRate | heart rate control | 0—100 |
recoverTime | recoverTime | Unit hour (after the app receives the data, it needs to be decremented by one every hour) |
grade | Oxygen uptake level | 0x01:Low 0x02: Amateur 0x03: Average 0x04: Average 0x05: Good 0x06: Excellent 0x07: Professional |
actionData | Action completion content | array type : Action type 1 fast walking; 2 jogging; 3 moderate running; 4 fast running heart_con_value : Heart rate control per action time : Action completion time in seconds goal_time : Action target time |
trainingOffset | Training Course Date Offset | int starts at 0 |
countHour | count Hour | int |
countMinute | count Minute | int |
countSecond | countSecond | int |
trainingYear | training Year | int |
trainingMonth | training Month | int |
trainingDay | training Day | int |
time | Sports time | int Unit seconds |
lowHeart | Heart rate range low | int |
heightHeart | Heart rate range high | int |
- app start the movement
IDOAppStartExchangeModel
Parameters Description Notes IDONewDataExchangeModel Parent property day, hour, minute, second, sportType targetType Target Type 0x00: No target,
0x01: Number of repetitions, unit: times,
0x02: distance, unit: meter,
0x03: calorie, unit: kcal,
0x04: duration, unit: minute,
0x05: number of steps, unit: steptargetValue targetValue int forceStart Whether to force start 0: not mandatory, 1: mandatory
+ (BOOL)appStartSportCommandWithModel:(IDOAppStartExchangeModel *)model
error:(NSError **)error;
- app Initiate movement to end
IDOAppEndExchangeModel
Parameters Description Notes IDONewDataExchangeModel Parent Properties day, hour, minute, second, sportType durations Duration Unit: seconds calories Distance Unit:meter step Steps Unit:step isSave whether to store bool
+ (BOOL)appEndSportCommandWithModel:(IDOAppEndExchangeModel *)model
error:(NSError **)error;
- app Initiate a motion pause
IDONewDataExchangeModel
Parameters Description Notes day day int hour hour int minute minute int second second int sportType sportType int Refer to the table above
+ (BOOL)appPauseSportCommandWithModel:(IDONewDataExchangeModel *)model
error:(NSError **)error;
- app Initiate exercise recovery
IDONewDataExchangeModel
Parameters Description Notes day day int hour 时 int minute minute int second second int sportType sportType int Refer to the table above
+ (BOOL)appRestoreSportCommandWithModel:(IDONewDataExchangeModel *)model
error:(NSError **)error;
- app Initiate v2 motion swap process
IDOV2AppIngDataExchangeModel
Parameters Description Notes IDONewDataExchangeModel Parent property day, hour, minute, second, sportType status Status 0: all valid, 1: distance invalid, 2: weak gps signal distance distance Unit:m calories calories unit:J durations durations unit:seconds
+ (BOOL)v2_appIngSportCommandWithModel:(IDOV2AppIngDataExchangeModel *)model
error:(NSError **)error;
- app Initiate v3 motion swap process
IDOV3AppIngDataExchangeModel
Parameters Description Notes IDONewDataExchangeModel Parent property day, hour, minute, second, sportType dataVersion Data Version The version number of the sports plan is 0x20,
No need to upload sportTypedistance distance distance:m calories calories distance:J durations durations unit:seconds signalFlag gpsSignal strength 0: indicates weak signal, 1: indicates strong signal realTimeSpeed appCalculation shows real-time speed unit km/h 100 times 15 seconds a record
+ (BOOL)v3_appIngSportCommandWithModel:(IDOV3AppIngDataExchangeModel *)model
error:(NSError **)error;
- ble start campaign end reply
IDOBleEndReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel Parent property day, hour, minute, second, sportType distance Distance Unit:meter calories Calories Unit:J durations Duration Unit:seconds errorCode Motion Data Exchange Error Code 0: success; other failures
+ (BOOL)bleEndSportReplyCommandWithModel:(IDOBleEndReplyExchangeModel *)model
error:(NSError **)error;
- ble Initiate Movement Pause Reply
IDOBlePauseReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel Parent property day, hour, minute, second, sportType errorCode Motion Data Exchange Error Code 0: success; other failures
+ (BOOL)blePauseSportReplyCommandWithModel:(IDOBlePauseReplyExchangeModel *)model
error:(NSError **)error;
- ble Initiate Movement Recovery Reply
IDOBlePauseReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel Parent property day, hour, minute, second, sportType errorCode Motion Data Exchange Error Code 0: success; other failures
+ (BOOL)bleRestoreSportReplyCommandWithModel:(IDOBleRestoreReplyExchangeModel *)model
error:(NSError **)error;
- app exercise program operation
IDOAppOperatePlanExchangeModel
Parameters illustrate Remarks IDONewDataExchangeModel parent class attribute day、hour、minute、second、sportType operate opcode 0x01:Start exercise,
0x02: Pause exercise,
0x03: Resume exercise,
0x04: End exercise
0x05: Switch actiontrainingOffset Training Course Date Offset Starts at 0 actionType Action Type 1 fast walk;
2 jogging;
3 moderate running;
4 fast running;
5 End the course movement (also waiting for the user to have free movement);
6 Free movement after the course ends (this field works when operate is 0x05)planType planType 0x01:Running plan 3km,
0x02: Running plan 5km,
0x03: Running plan 10km,
0x04: Half marathon training (Phase II),
0x05: Marathon training (Phase II)errorCode Error code 0x00: success, other failures (no assignment required for delivery operations)
+ (BOOL)appPlanSportCommandWithModel:(IDOAppOperatePlanExchangeModel *)model
error:(NSError **)error;
- ble Exercise plan operation reply
IDOBleOperatePlanReplyExchangeModel
Parameters illustrate Remarks IDONewDataExchangeModel parent class attribute day、hour、minute、second、sportType operate opcode 0x01:Start exercise,
0x02: Pause exercise,
0x03: Resume exercise,
0x04: End exercise
0x05: Switch actionactionType actionType 1Fast walk;
2 Jogging;
3 Moderate running;
4 Fast running;
5 End the course movement (also wait for the user to have free movement);
6 Free movement after the course ends (this field works when operate is 0x05)planType planType 0x01:Running plan 3km,
0x02: Running plan 5km,
0x03: Running plan 10km,
0x04: Half-marathon training (Phase 2),
0x05: Marathon training (Phase 2)errorCode errorCode 0x00:success other failure (no assignment is required for the delivery operation)
+ (BOOL)blePlanSportReplyCommandWithModel:(IDOBleOperatePlanReplyExchangeModel *)model
error:(NSError **)error;
- Get v3 heart rate data
+ (BOOL)v3_getActivityHrDataWithError:(NSError **)error;
- v3 Get activity data after exercise
+ (BOOL)v3_getActivityEndDataWithError:(NSError **)error;
10.3 proxy protocol callback
- app Movement starts ble reply
IDOAppStartReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel parent class attribute day、hour、minute、second、sportType retCode Get into motion 0: success;
1: device has entered sports mode failed;
2: device battery low failure;
3: The bracelet is charging
4: Alexa is being used
5: On a call
- (void)appStartSportReplyWithModel:(IDOAppStartReplyExchangeModel *)model errorCode:(int)errorCode;
- app motion pause ble reply
IDOAppPauseReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel parent class attribute day、hour、minute、second、sportType errorCode errorCode 0:success other failure
- (void)appPauseSportReplyWithModel:(IDOAppPauseReplyExchangeModel *)model errorCode:(int)errorCode;
- app exercise recovery ble reply
IDOAppRestoreReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel parent class attribute day、hour、minute、second、sportType errorCode Error code 0:success other failures
- (void)appRestoreSportReplyWithModel:(IDOAppRestoreReplyExchangeModel *)model errorCode:(int)errorCode;
- app End of exercise ble reply
IDOAppEndReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel parent class attribute day、hour、minute、second、sportType errorCode errorCode 0:success other failure distance distance Unit: m calories calories Unit:J step step Unit: step avgHrValue average heart rate int maxHrValue maximum heart rate int burnFatMins fat burning time int aerobicMins Aerobic time int limitMins limit time int
- (void)v2_appEndSportReplyWithModel:(IDOAppEndReplyExchangeModel *)model errorCode:(int)errorCode;
- v2 app ble reply in motion interaction
IDOV2AppIngReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel parent class attribute day、hour、minute、second、sportType status Status Code 0: all valid,
1: distance invalid,
2: weak gps signalcurHrValue current heart rate int distance distance unit:m calories calories unit:J step step Unit:step hrValueSerial serial number int intervalSecond heart rate interval int hrValues Heart rate data array
- (void)v2_appIngSportReplyWithModel:(IDOV2AppIngReplyExchangeModel *)model errorCode:(int)errorCode;
- v3 app ble reply in motion interaction
IDOV3AppIngReplyExchangeModel
Parameters Description Notes IDONewDataExchangeModel parent class attribute day、hour、minute、second、sportType dataVersion Data Version The exercise plan version number is 0x20 curHrValue current heart rate int distance distance Unit: m calories calories Unit:J step step/td> Unit:step durations durations Unit:seconds swimPosture swim Posture< 0x00 :Medley;
0x01: Freestyle;
0x02: Breaststroke;
0x03: Backstroke;
0x04: Butterfly;status The status of the bracelet returned start: 1, pause: 2, end: 3, 0: invalid state status Status returned by the bracelet start:1,
pause:2,
end:3,
0: invalid statuskmSpeed Average km pace int realTimeSpeed App calculation shows real-time speed unit km/h 100 times 15 seconds a record realTimePace App calculation shows real-time pace Units anaerobicTrainingEffect Anaerobic training effect Units: None Range 1.0 ~ 5.0 (*10 times) trainingEffect Aerobic Training Effects Units: None Range 1.0 ~ 5.0 (*10 times) countHour sports countdown int countMinute sports countdown int countSecond sports countdown seconds int
- (void)v3_appIngSportReplyWithModel:(IDOV3AppIngReplyExchangeModel *)model errorCode:(int)errorCode;
- v3 app Get heart rate data after exercise
- IDOHrDataExchangeModel
Parameters | Description | Notes |
---|---|---|
IDONewDataExchangeModel | parent class attribute | day、hour、minute、second、sportType |
intervalSecond | heart rate interval | int |
heartRateCount | heart rate count | int |
hrValues | Heart Rate Data | Heart Rate Collection |
- (void)v3_appSportHrReplyWithModel:(IDOHrDataExchangeModel *)model errorCode:(int)errorCode;
- v3 app Return data after exercise
- IDOV3SportEndDataExchangeModel
Parameters | Description | Notes |
---|---|---|
IDONewDataExchangeModel | parent class attribute | day、hour、minute、second、sportType |
year | year | int |
month | month | int |
dataVersion | Data Version | The exercise plan version number is 0x20(32) |
planType | Plan Type | int 0x01: Running plan 3km, 0x02: Running plan 5km, 0x03: Running plan 10km, 0x04: Half marathon training (Phase II), 0x05: Marathon training (Phase II) |
intervalSecond | heart rate interval | int |
calories | calories | int (Unit:J) |
distance | distance< | int (unit:m) |
durations | durations | int (unit:minute) |
step | step | int (Step:number of steps) |
warmUpSecond | Warm-up duration | int (Seconds) |
anaeroicSecond | Anaerobic exercise duration | int (seconds) |
fatBurnSecond | fat burning workout duration | int (seconds) |
aerobicSecond | length of aerobic exercise | int (seconds) |
limitSecond | Maximum workout time | int (Maximum workout time) |
avgHrValue | average heart rate | int |
maxHrValue | Max Heart Rate | int |
warmUpValue | Warm-up exercise value | int |
burnFatValue | Fat Burning Exercise Value | int |
aerobicValue | Cardio Value | int |
limitValue | Extreme Sports Value | int |
anaerobicValue | Anaerobic exercise value | int |
avgSpeed | Average speed | km/h |
maxSpeed | Maximum Speed | km/h |
avgStepFrequency | Average cadence | int |
maxStepFrequency | Maximum cadence | int |
avgStepStride | Average stride | int |
maxStepStride | Maximum stride | int |
kmSpeed | Average Kilometer Pace | int |
fastKmSpeed | Maximum Kilometer Pace | int |
kmSpeedCount | Kilometer pace number | int |
kmSpeeds | Kilometer pace collection | array |
mileCount | Number of mile paces | array |
mileCount | mile pace | int |
mileSpeeds | mile pace collection | array |
stepsFrequencyCount | Number of steps | int |
stepsFrequencys | cadence collection | array |
trainingEffect | Effect of aerobic training | Unit: None Range 1.0 ~ 5.0 (*10times) |
vo2Max | VO2max | Unit: ml/kg/min; range 0-80 |
actionDataCount | The number of training exercises in this exercise | int |
inClassCalories | In-class exercise calories | Unit kcal |
completionRate | Action Completion Rate | 0—100 |
hrCompletionRate | Heart Rate Control Rate | 0—100 |
recoverTime | Recovery Duration | Unit hour (after the app receives the data, it needs to be decremented by one every hour) |
grade | Oxygen Uptake Level | 0x01: Low 0x02: Amateur 0x03: Average 0x04: Average 0x05: Good 0x06: Excellent 0x07: Professional |
actionData | Action completion content | array type : Movement type 1. Fast walking; 2. Jogging; 3. Moderate running; 4. Fast running heart_con_value : Heart rate control per action time : Action completion time in seconds goal_time : Action target time |
trainingOffset | Training Course Date Offset | int starts at 0 |
- (void)v3_appEndSportReplyWithModel:(IDOV3SportEndDataExchangeModel *)model errorCode:(int)errorCode;
- ble stop app movement
- IDOBleEndExchangeModel
Parameters | Description | Notes |
---|---|---|
IDONewDataExchangeModel | parent class attribute | day、hour、minute、second、sportType |
distance | Distance | Unit:meter |
calories | Calories | Unit:J |
step | Steps | Unit:step |
isSave | whether to store | bool |
avgHrValue | Average Heart Rate | int |
maxHrValue | Maximum heart rate | int |
burnFatMins | Fat Burn Time (minutes) | int |
aerobicMins | Cardio duration (minutes) | int |
limitMins | Maximum Workout Duration (minutes) | int |
- (void)bleEndAppSportWithModel:(IDOBleEndExchangeModel *)model errorCode:(int)errorCode;
- ble Pause app movement
- IDONewDataExchangeModel
Parameters | Description | Notes |
---|---|---|
IDONewDataExchangeModel | parent class attribute | day、hour、minute、second、sportType |
- (void)blePauseAppSportWithModel:(IDONewDataExchangeModel *)model errorCode:(int)errorCode;
- ble Resume app movement
- IDONewDataExchangeModel
Parameters | Description | Notes |
---|---|---|
IDONewDataExchangeModel | parent class attribute | day、hour、minute、second、sportType |
- (void)bleRestoreAppSportWithModel:(IDONewDataExchangeModel *)model errorCode:(int)errorCode;
- app Operation Exercise Program Return
- IDOAppOperatePlanExchangeModel
Parameters | Description | Notes |
---|---|---|
IDONewDataExchangeModel | parent class attribute | day、hour、minute、second、sportType |
operate | Action Type | 0x01: start exercise, 0x02: pause exercise, 0x03: resume exercise, 0x04: end exercise 0x05: switch action |
trainingOffset | Course Date Offset for Training | int starts at 0 |
actionType | Action Type | 1 fast walk; 2 jogging; 3 moderate running; 4 fast running |
planType | Plan Type | 0x01: Running plan 3km, 0x02: Running plan 5km, 0x03: Running plan 10km, 0x04: Half marathon training (Phase II), 0x05: Marathon training (Phase II) |
errorCode | Error code | int 0x00: success, other failures |
- (void)appOperatePlanReplyWithModel:(IDOAppOperatePlanExchangeModel *)model errorCode:(int)errorCode;
- ble Operation Exercise Program Return
- IDOBleOperatePlanExchangeModel
Parameters | Description | Notes |
---|---|---|
IDONewDataExchangeModel | parent class attribute | day、hour、minute、second、sportType |
operate | Action Type | 0x01: start exercise, 0x02: pause exercise, 0x03: resume exercise, 0x04: end exercise 0x05: switch action |
actionType | Action Type | 1 fast walk; 2 jogging; 3 moderate running; 4 fast running |
planType | Plan Type | 0x01: Running plan 3km, 0x02: Running plan 5km, 0x03: Running plan 10km, 0x04: Half-marathon training (Phase 2), 0x05: Marathon training (Phase 2) |
errorCode | Error code | int 0x00: success other failure |
trainingYear | Year of training course | int |
trainingMonth | Training Course Month | int |
trainingDay | Training Session Dates | int |
time | Action target time | int in seconds |
lowHeart | Heart Rate Range Low | int |
heightHeart | Heart Rate Range High | int |
- (void)bleOperatePlanWithModel:(IDOBleOperatePlanExchangeModel *)model errorCode:(int)errorCode;