// // TYBLECentralManager+Discovery.h // Pods-TYBluetooth_Example // // Created by 黄凯 on 2019/4/19. // #import "TYBLECentralManager.h" NS_ASSUME_NONNULL_BEGIN @interface TYBLECentralManager (Discovery) /** 扫描到的设备 */ @property (nonatomic, strong, readonly) NSArray *discoveredDevices; @property (nonatomic, assign) BOOL shouldAutoDiscoveryWhenCenteralPoweredOn; /** 添加发现代理 @param delegate 发现代理 */ - (void)addDiscoveryDelegate:(id)delegate; /** 移除发现代理 @param delegate 发现代理 */ - (void)removeDiscoveryDelegate:(id)delegate; /** * 扫描周围所有BLE设备 * * @param timeout 超时时间 */ - (void)scanForPeripheralsWithServices:(nullable NSArray *)serviceUUIDs options:(nullable NSDictionary *)options timeout:(NSTimeInterval)timeout; /** * 扫描周围所有BLE设备 * * @param timeout 超时时间 */ - (void)scanForPeripherals:(NSTimeInterval)timeout; - (NSArray *)retrievePeripheralsWithIdentifiers:(NSArray *)identifiers; - (NSArray *)retrieveConnectedPeripheralsWithServices:(NSArray *)serviceUUIDs; /** * 停止扫描 */ - (void)stopScan; /** 清理扫描的缓存 */ - (void)cleanScanedCache; @end NS_ASSUME_NONNULL_END