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
|
//
// IDOSyncManager.h
// VeryfitSDK
//
// Created by hedongyang on 2018/5/25.
// Copyright © 2018年 hedongyang. All rights reserved.
//
#import <Foundation/Foundation.h>
#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
#else
#import "IDOSyncEnum.h"
#endif
@interface IDOSyncManager : NSObject
/**
* 当前连接设备是否正在同步,⚠️配置同步不纳入正在同步中,其他(步数、心率、血压、睡眠、血氧、压力、活动、gps、游泳)数据同步纳入其中
* Whether the currently connected device is synchronizing, ⚠️ configuration synchronization is not included in the synchronization,
* and other (step, heart rate, blood pressure, sleep, activity, gps、swim) data synchronization is included.
*/
@property (nonatomic,assign,readonly) BOOL isSyncHealthRun;
/**
* 当前连接设备是否在同步配置信息
* Is the currently connected device synchronizing configuration information?
*/
@property (nonatomic,assign,readonly) BOOL isSyncConfigRun;
/**
* 当前连接设备是否需要同步配置
* Does the current connected device require synchronization configuration?
*/
@property (nonatomic,assign,readonly) BOOL isNeedSyncConfig;
/**
* 设置需要同步的选项(同步配置、同步健康、同步活动、同步GPS)
* Set the options that need to be synchronized (sync config、sync health、sync activity、sync GPS)
*/
@property (nonatomic,assign) IDO_WANT_TO_SYNC_ITEM_TYPE wantToSyncType;
/**
* 同步的数据是否存入SDK数据库中,默认YES
* Whether the synchronized data is stored in the SDK database, the default is YES
*/
@property (nonatomic,assign) BOOL isSave;
/**
* 同步的数据超时时长,默认 60秒
* Synchronous data timeout duration, default 60 seconds
*/
@property (nonatomic,assign) NSInteger syncTimeout;
/**
* 同步配置日志回调
* Synchronize configuration log callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncConfig)(void(^ _Nullable configLogCallback)(NSString * _Nullable logStr));
/**
* 同步健康心率数据回调
* Synchronize healthy heart rate data callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncHeartRate)(void(^ _Nullable heartRateDataCallback)(NSString * _Nullable jsonStr));
/**
* 同步健康睡眠数据回调
* Synchronize healthy sleep data callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncSleep)(void(^ _Nullable sleepDataCallback)(NSString * _Nullable jsonStr));
/**
* 同步健康步数数据回调
* Synchronize health step data callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncSport)(void(^ _Nullable sportDataCallback)(NSString * _Nullable jsonStr));
/**
* 同步健康血压数据回调
* Synchronize healthy blood pressure data callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncBp)(void(^ _Nullable bpDataCallback)(NSString * _Nullable jsonStr));
/**
* 同步活动数据回调
* Synchronize active data callbacks
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncActivity)(void(^ _Nullable activityDataCallback)(NSString * _Nullable jsonStr));
/**
* 同步gps数据回调
* Synchronize GPS data callbacks
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncGps)(void(^ _Nullable gpsDataCallback)(NSString * _Nullable jsonStr));
/**
* 同步游泳数据回调
* Synchronize swim data callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncSwim)(void(^ _Nullable swimCallback)(NSString * _Nullable jsonStr));
/**
* 同步健康血氧数据回调
* Synchronize healthy blood oxygen data callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncBloodOxygen)(void(^ _Nullable bloodOxygenDataCallback)(NSString * _Nullable jsonStr));
/**
* 同步压力数据回调
* Synchronize pressure data callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncPressure)(void(^ _Nullable pressureCallback)(NSString * _Nullable jsonStr));
/**
* 同步统一进度回调
* Synchronize unified progress callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncProgess)(void(^ _Nullable syncProgessCallback)(IDO_CURRENT_SYNC_TYPE type,float progress));
/**
* 同步完成回调
* Synchronize completes the callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncComplete)(void(^ _Nullable syncCompleteCallback)(IDO_SYNC_COMPLETE_STATUS stateCode));
/**
* 同步失败回调 如: 超时、断线、OTA
* Synchronize failed callback eg: timeout, disconnect, OTA
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncFailed)(void(^ _Nullable syncFailedCallback)(int errorCode));
/**
* 删除当天数据回调
* Delete current day data callback
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^deleteCurrentDayData)(void(^ _Nullable deleteCallback)(BOOL success));
/**
* 强制执行或不执行同步配置
* Enforce or not enforce the synchronize configuration
*/
@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^mandatorySyncConfig)(BOOL isSync);
/**
* 初始化同步单例对象
* init sync manager
*/
IDOSyncManager * _Nonnull initSyncManager(void);
/**
开始同步 | Start sync
*/
+ (void)startSync;
/**
结束同步 | End sync
*/
+ (void)stopSync;
@end
|