summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h
diff options
context:
space:
mode:
authorhc <haocheng.xie@respiree.com>2026-04-13 15:17:52 +0800
committerhc <haocheng.xie@respiree.com>2026-04-13 15:17:52 +0800
commitd6d9a09d505d11148599a95a5be3e1351edbe0ac (patch)
treea5f5891983d1ff207e99f683a5e151519cef4980 /libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h
parente4fb9966e762852bf17f21c8406501d42fae0b61 (diff)
Local iHealth SDK, device detail screen, iOS event fixes
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h')
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h166
1 files changed, 166 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h
new file mode 100755
index 0000000..72c1a0b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h
@@ -0,0 +1,166 @@
1//
2// IDOBluetoothManager.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/6/4.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import <CoreBluetooth/CoreBluetooth.h>
11#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
12#elif __has_include(<IDOBluetooth/IDOBluetooth.h>)
13#else
14#import "IDOBlueEnum.h"
15#import "IDOPeripheralModel.h"
16#endif
17
18@class IDOBluetoothManager;
19
20@protocol IDOBluetoothManagerDelegate<NSObject>
21
22/**
23 * @brief 扫描所有外围设备 | Scan all peripherals
24 * @param manager IDO蓝牙管理中心 | IDO Bluetooth Management Center
25 * @param allDevices 扫描所有外围设备(包括OTA设备集合) | Scan all peripherals (including OTA device collections)
26 * @param otaDevices OTA 设备集合 | OTA Device Collection
27 */
28- (void)bluetoothManager:(IDOBluetoothManager *)manager
29 allDevices:(NSArray <IDOPeripheralModel *>*)allDevices
30 otaDevices:(NSArray <IDOPeripheralModel *>*)otaDevices;
31
32
33/**
34 * @brief 连接设备成功回调 | Connected device successfully callback
35 * @param manager IDO蓝牙管理中心 | IDO Bluetooth Management Center
36 * @param centerManager 蓝牙管理中心 | Bluetooth Management Center
37 * @param peripheral 外围设备 | Peripherals
38 * @param isOtaMode 连接是否在OTA模式 | Is the connection in OTA mode?
39 * @return 是或否 | yes or no
40 */
41- (BOOL)bluetoothManager:(IDOBluetoothManager *)manager
42 centerManager:(CBCentralManager *)centerManager
43 didConnectPeripheral:(CBPeripheral *)peripheral
44 isOatMode:(BOOL)isOtaMode;
45
46/**
47 * @brief 蓝牙管理状态 | Bluetooth management status
48 * @param manager IDO蓝牙管理中心 | IDO Bluetooth Management Center
49 * @param state 状态 | Status
50 */
51- (void)bluetoothManager:(IDOBluetoothManager *)manager
52 didUpdateState:(IDO_BLUETOOTH_MANAGER_STATE)state;
53
54/**
55 * @brief 连接设备错误回调,当解绑设备断开连接时不会回调此方法
56 * Connection Device Error Callback,This method is not called back when the unbound device is disconnected.
57 * @param manager IDO蓝牙管理中心 | IDO Bluetooth Management Center
58 * @param error 错误信息 | Error message
59 */
60- (void)bluetoothManager:(IDOBluetoothManager *)manager
61 connectPeripheralError:(NSError *)error;
62
63@end
64
65@interface IDOBluetoothManager : NSObject
66
67/**
68 设置代理 | Setting up the agent
69 */
70@property (nonatomic,weak) id<IDOBluetoothManagerDelegate> delegate;
71
72/**
73 * 自动扫描连接超时时长 默认 20
74 * Auto Scan Connection Timeout Duration Default 20
75 */
76@property (nonatomic,assign) NSInteger timeout;
77
78/**
79 * 设置扫描过滤信号弱的设备 默认值 80 大于80会被过滤
80 * Set the device with weak scan filtering signal. Default value 80 is greater than 80 will be filtered.
81 */
82@property (nonatomic,assign) NSInteger rssiNum;
83
84/**
85 * 是否启动超时,间隔扫描 默认 yes 默认10秒间隔扫描一次
86 * Whether to start timeout, interval scan Default yes Default scan at 10-second intervals
87 */
88@property (nonatomic,assign) BOOL isIntervalScan;
89
90/**
91 * 是否需要重连机制 默认 YES 如果设置 NO 断线后不会重连
92 * Whether a reconnect mechanism is required,if NO set,connection will not be reconnected
93 */
94@property (nonatomic,assign) BOOL isReconnect;
95
96/**
97 * 设置扫描间隔时长 默认 10秒 如果不启动超时间隔扫描,则无效
98 * Set the scan interval to 10 seconds by default.if timeout interval scanning is not started, it is not valid.
99 */
100@property (nonatomic,assign) NSInteger autoScanInterval;
101
102/**
103 蓝牙扫描设备模式 | Bluetooth Scanning Device Mode
104 */
105@property (nonatomic,assign,readonly) IDO_SCAN_DEVICE_MODE scanMode;
106
107/**
108 蓝牙管理连接状态 | Bluetooth management connection status
109 */
110@property (nonatomic,assign,readonly) IDO_BLUETOOTH_MANAGER_STATE state;
111
112/**
113 蓝牙连接错误码 | Bluetooth connection error code
114 */
115@property (nonatomic,assign,readonly) IDO_BLUETOOTH_CONNECT_ERROR_TYPE errorCode;
116
117/**
118 * 手动点击连接设备的总时长
119 * Total time to manually click on the connected device
120 */
121@property (nonatomic,assign,readonly) NSInteger manualConnectTotalTime;
122
123/**
124 * 自动扫描到成功连接设备的总时长
125 * Total time from automatic scanning to successful connection to the device
126 */
127@property (nonatomic,assign,readonly) NSInteger autoConnectTotalTime;
128
129/**
130 * @brief 初始化IDO蓝牙管理中心对象
131 * Initialize IDO the Bluetooth Management Center object
132 * @return IDOBluetoothManager
133 */
134+ (__kindof IDOBluetoothManager *)shareInstance;
135
136/**
137 * @brief 初始化系统蓝牙管理中心对象并刷新蓝牙代理
138 * Initializes the system bluetooth management center object and refreshes the bluetooth delegate
139 */
140+ (void)refreshDelegate;
141
142/**
143 开始扫描 | Start scanning
144 */
145+ (void)startScan;
146
147/**
148 停止扫描 | Stop scanning
149 */
150+ (void)stopScan;
151
152/**
153 * @brief 1、普通模式下选择外围设备连接 2、ota模式下选择外围设备连接
154 * 1. Select peripheral device connection in normal mode
155 * 2. Select peripheral device connection in ota mode
156 * @param model IDOPeripheralModel 对象 | IDOPeripheralModel object
157 */
158+ (void)connectDeviceWithModel:(IDOPeripheralModel *)model;
159
160/**
161 断开当前外围设备的连接 | Disconnect the current peripheral device
162 */
163+ (void)cancelCurrentPeripheralConnection;
164
165@end
166