Tuya iOS Smart Life App SDK 5.15.0
ThingBLECentralManager Class Reference

#import <ThingBLECentralManager.h>

Inheritance diagram for ThingBLECentralManager:

Instance Methods

(nullable instancetype) - initWithAgentKey:
 
(void) - thingble_performSelector:withObject:afterDelay:
 
(void) - thingble_cancelPreviousPerformRequestsWithTarget:selector:object:
 
(nullable instancetype) - initWithAgentKey:
 
(void) - thingble_performSelector:withObject:afterDelay:
 
(void) - thingble_cancelPreviousPerformRequestsWithTarget:selector:object:
 
(void) - addConnectionDelegate:
 
(void) - addConnectionDelegate:
 
(void) - removeConnectionDelegate:
 
(void) - removeConnectionDelegate:
 
(void) - connectPeripheral:timeout:
 
(void) - connectPeripheral:timeout:
 
(void) - connectPeripheral:options:timeout:
 
(void) - connectPeripheral:options:timeout:
 
(void) - disconnectPeripheral:timeout:
 
(void) - disconnectPeripheral:timeout:
 
(void) - disconnectAllPeripherals
 
(void) - disconnectAllPeripherals
 
(void) - cancelConnectionTimer:
 
(void) - cancelConnectionTimer:
 
(void) - addDiscoveryDelegate:
 
(void) - addDiscoveryDelegate:
 
(void) - removeDiscoveryDelegate:
 
(void) - removeDiscoveryDelegate:
 
(void) - scanForPeripheralsWithServices:options:timeout:
 
(void) - scanForPeripheralsWithServices:options:timeout:
 
(void) - scanForPeripherals:
 
(void) - scanForPeripherals:
 
(NSArray< CBPeripheral * > *) - retrievePeripheralsWithIdentifiers:
 
(NSArray< CBPeripheral * > *) - retrievePeripheralsWithIdentifiers:
 
(NSArray< ThingBLEPeripheral * > *) - retrieveConnectedPeripheralsWithServices:
 
(NSArray< ThingBLEPeripheral * > *) - retrieveConnectedPeripheralsWithServices:
 
(void) - stopScan
 
(void) - stopScan
 
(void) - cleanScanedCache
 
(void) - cleanScanedCache
 
(void) - cleanScanedCache:
 
(void) - cleanScanedCache:
 
(void) - cleanScanedCacheWithServices:
 
(void) - cleanScanedCacheWithServices:
 

Properties

BOOL isPoweredOn
 
NSString * agentKey
 
CBCentralManager * cbManager
 
NSArray< ThingBLEPeripheral * > * discoveredDevices
 
BOOL shouldAutoDiscoveryWhenCenteralPoweredOn
 

Detailed Description

Definition at line 11 of file ThingBLECentralManager.h.

Method Documentation

◆ addConnectionDelegate: [1/2]

- (void) addConnectionDelegate: (id< ThingBLECentralManagerSessionDelegate >)  delegate

Adds a connection delegate.

Parameters
delegateThe delegate.

Provided by category ThingBLECentralManager(Connection).

◆ addConnectionDelegate: [2/2]

- (void) addConnectionDelegate: (id< ThingBLECentralManagerSessionDelegate >)  delegate

Adds a connection delegate.

Parameters
delegateThe delegate.

Provided by category ThingBLECentralManager(Connection).

◆ addDiscoveryDelegate: [1/2]

- (void) addDiscoveryDelegate: (id< ThingBLECentralManagerDiscoveryDelegate >)  delegate

Adds a discovery delegate.

Parameters
delegateThe discovery delegate.

Provided by category ThingBLECentralManager(Discovery).

◆ addDiscoveryDelegate: [2/2]

- (void) addDiscoveryDelegate: (id< ThingBLECentralManagerDiscoveryDelegate >)  delegate

Adds a discovery delegate.

Parameters
delegateThe discovery delegate.

Provided by category ThingBLECentralManager(Discovery).

◆ cancelConnectionTimer: [1/2]

- (void) cancelConnectionTimer: (ThingBLEPeripheral *)  peripheral

Provided by category ThingBLECentralManager(Connection).

◆ cancelConnectionTimer: [2/2]

- (void) cancelConnectionTimer: (ThingBLEPeripheral *)  peripheral

Provided by category ThingBLECentralManager(Connection).

◆ cleanScanedCache [1/2]

- (void) cleanScanedCache

Clears the discovery cache.

Provided by category ThingBLECentralManager(Discovery).

◆ cleanScanedCache [2/2]

- (void) cleanScanedCache

Clears the discovery cache.

Provided by category ThingBLECentralManager(Discovery).

◆ cleanScanedCache: [1/2]

- (void) cleanScanedCache: (NSString *)  service

Provided by category ThingBLECentralManager(Discovery).

◆ cleanScanedCache: [2/2]

- (void) cleanScanedCache: (NSString *)  service

Provided by category ThingBLECentralManager(Discovery).

◆ cleanScanedCacheWithServices: [1/2]

- (void) cleanScanedCacheWithServices: (NSArray< NSString * > *)  services

Provided by category ThingBLECentralManager(Discovery).

◆ cleanScanedCacheWithServices: [2/2]

- (void) cleanScanedCacheWithServices: (NSArray< NSString * > *)  services

Provided by category ThingBLECentralManager(Discovery).

◆ connectPeripheral:options:timeout: [1/2]

- (void) connectPeripheral: (ThingBLEPeripheral *)  peripheral
options: (nullable NSDictionary< NSString *, id > *)  options
timeout: (NSTimeInterval)  timeout 

Connects to a peripheral.

Parameters
peripheralThe peripheral to be connected.
optionsThe connection parameters.
timeoutThe connection timed out.

Provided by category ThingBLECentralManager(Connection).

◆ connectPeripheral:options:timeout: [2/2]

- (void) connectPeripheral: (ThingBLEPeripheral *)  peripheral
options: (nullable NSDictionary< NSString *, id > *)  options
timeout: (NSTimeInterval)  timeout 

Connects to a peripheral.

Parameters
peripheralThe peripheral to be connected.
optionsThe connection parameters.
timeoutThe connection timed out.

Provided by category ThingBLECentralManager(Connection).

◆ connectPeripheral:timeout: [1/2]

- (void) connectPeripheral: (ThingBLEPeripheral *)  peripheral
timeout: (NSTimeInterval)  timeout 

Connects to a peripheral.

Parameters
peripheralThe peripheral to be connected.
timeoutThe connection timed out.

Provided by category ThingBLECentralManager(Connection).

◆ connectPeripheral:timeout: [2/2]

- (void) connectPeripheral: (ThingBLEPeripheral *)  peripheral
timeout: (NSTimeInterval)  timeout 

Connects to a peripheral.

Parameters
peripheralThe peripheral to be connected.
timeoutThe connection timed out.

Provided by category ThingBLECentralManager(Connection).

◆ disconnectAllPeripherals [1/2]

- (void) disconnectAllPeripherals

Disconnects from all peripherals.

Provided by category ThingBLECentralManager(Connection).

◆ disconnectAllPeripherals [2/2]

- (void) disconnectAllPeripherals

Disconnects from all peripherals.

Provided by category ThingBLECentralManager(Connection).

◆ disconnectPeripheral:timeout: [1/2]

- (void) disconnectPeripheral: (ThingBLEPeripheral *)  peripheral
timeout: (NSTimeInterval)  timeout 

Disconnects from a peripheral.

Parameters
peripheralThe connected peripheral.
timeoutThe disconnection timed out.

Provided by category ThingBLECentralManager(Connection).

◆ disconnectPeripheral:timeout: [2/2]

- (void) disconnectPeripheral: (ThingBLEPeripheral *)  peripheral
timeout: (NSTimeInterval)  timeout 

Disconnects from a peripheral.

Parameters
peripheralThe connected peripheral.
timeoutThe disconnection timed out.

Provided by category ThingBLECentralManager(Connection).

◆ initWithAgentKey: [1/2]

- (nullable instancetype) initWithAgentKey: (nonnull NSString *)  agentKey

◆ initWithAgentKey: [2/2]

- (nullable instancetype) initWithAgentKey: (nonnull NSString *)  agentKey

◆ removeConnectionDelegate: [1/2]

- (void) removeConnectionDelegate: (id< ThingBLECentralManagerSessionDelegate >)  delegate

Removes a connection delegate.

Parameters
delegateThe delegate.

Provided by category ThingBLECentralManager(Connection).

◆ removeConnectionDelegate: [2/2]

- (void) removeConnectionDelegate: (id< ThingBLECentralManagerSessionDelegate >)  delegate

Removes a connection delegate.

Parameters
delegateThe delegate.

Provided by category ThingBLECentralManager(Connection).

◆ removeDiscoveryDelegate: [1/2]

- (void) removeDiscoveryDelegate: (id< ThingBLECentralManagerDiscoveryDelegate >)  delegate

Removes a discovery delegate.

Parameters
delegateThe discovery delegate.

Provided by category ThingBLECentralManager(Discovery).

◆ removeDiscoveryDelegate: [2/2]

- (void) removeDiscoveryDelegate: (id< ThingBLECentralManagerDiscoveryDelegate >)  delegate

Removes a discovery delegate.

Parameters
delegateThe discovery delegate.

Provided by category ThingBLECentralManager(Discovery).

◆ retrieveConnectedPeripheralsWithServices: [1/2]

- (NSArray< ThingBLEPeripheral * > *) retrieveConnectedPeripheralsWithServices: (NSArray< CBUUID * > *)  serviceUUIDs

Retrieve Connected Peripherals.

Parameters
serviceUUIDsThe service UUID.
Returns
The ThingBLEPeripheral array.

Provided by category ThingBLECentralManager(Discovery).

◆ retrieveConnectedPeripheralsWithServices: [2/2]

- (NSArray< ThingBLEPeripheral * > *) retrieveConnectedPeripheralsWithServices: (NSArray< CBUUID * > *)  serviceUUIDs

Retrieve Connected Peripherals.

Parameters
serviceUUIDsThe service UUID.
Returns
The ThingBLEPeripheral array.

Provided by category ThingBLECentralManager(Discovery).

◆ retrievePeripheralsWithIdentifiers: [1/2]

- (NSArray< CBPeripheral * > *) retrievePeripheralsWithIdentifiers: (NSArray< NSUUID * > *)  identifiers

Provided by category ThingBLECentralManager(Discovery).

◆ retrievePeripheralsWithIdentifiers: [2/2]

- (NSArray< CBPeripheral * > *) retrievePeripheralsWithIdentifiers: (NSArray< NSUUID * > *)  identifiers

Provided by category ThingBLECentralManager(Discovery).

◆ scanForPeripherals: [1/2]

- (void) scanForPeripherals: (NSTimeInterval)  timeout

Discovers all Bluetooth devices.

Parameters
timeoutThe discovery timed out.

Provided by category ThingBLECentralManager(Discovery).

◆ scanForPeripherals: [2/2]

- (void) scanForPeripherals: (NSTimeInterval)  timeout

Discovers all Bluetooth devices.

Parameters
timeoutThe discovery timed out.

Provided by category ThingBLECentralManager(Discovery).

◆ scanForPeripheralsWithServices:options:timeout: [1/2]

- (void) scanForPeripheralsWithServices: (nullable NSArray< CBUUID * > *)  serviceUUIDs
options: (nullable NSDictionary< NSString *, id > *)  options
timeout: (NSTimeInterval)  timeout 

Discovers all Bluetooth devices.

Parameters
timeoutThe discovery timed out.

Provided by category ThingBLECentralManager(Discovery).

◆ scanForPeripheralsWithServices:options:timeout: [2/2]

- (void) scanForPeripheralsWithServices: (nullable NSArray< CBUUID * > *)  serviceUUIDs
options: (nullable NSDictionary< NSString *, id > *)  options
timeout: (NSTimeInterval)  timeout 

Discovers all Bluetooth devices.

Parameters
timeoutThe discovery timed out.

Provided by category ThingBLECentralManager(Discovery).

◆ stopScan [1/2]

- (void) stopScan

Stops discovery.

Provided by category ThingBLECentralManager(Discovery).

◆ stopScan [2/2]

- (void) stopScan

Stops discovery.

Provided by category ThingBLECentralManager(Discovery).

◆ thingble_cancelPreviousPerformRequestsWithTarget:selector:object: [1/2]

- (void) thingble_cancelPreviousPerformRequestsWithTarget: (nonnull id)  aTarget
selector: (nonnull SEL)  aSelector
object: (nullable id)  anArgument 

◆ thingble_cancelPreviousPerformRequestsWithTarget:selector:object: [2/2]

- (void) thingble_cancelPreviousPerformRequestsWithTarget: (nonnull id)  aTarget
selector: (nonnull SEL)  aSelector
object: (nullable id)  anArgument 

◆ thingble_performSelector:withObject:afterDelay: [1/2]

- (void) thingble_performSelector: (nonnull SEL)  aSelector
withObject: (nullable id)  anArgument
afterDelay: (NSTimeInterval)  delay 

◆ thingble_performSelector:withObject:afterDelay: [2/2]

- (void) thingble_performSelector: (nonnull SEL)  aSelector
withObject: (nullable id)  anArgument
afterDelay: (NSTimeInterval)  delay 

Property Documentation

◆ agentKey

- (NSString *) agentKey
readwritenonatomicstrong

Definition at line 20 of file ThingBLECentralManager.h.

◆ cbManager

- (CBCentralManager *) cbManager
readnonatomicstrong

The CBCentralManager object.

Definition at line 24 of file ThingBLECentralManager.h.

◆ discoveredDevices

- (NSArray<ThingBLEPeripheral *>*) discoveredDevices
readnonatomicstrong

The discovered devices.

Provided by category ThingBLECentralManager(Discovery).

Definition at line 18 of file ThingBLECentralManager+Discovery.h.

◆ isPoweredOn

- (BOOL) isPoweredOn
readnonatomicassign

Specifies whether to enable Bluetooth.

Definition at line 16 of file ThingBLECentralManager.h.

◆ shouldAutoDiscoveryWhenCenteralPoweredOn

- (BOOL) shouldAutoDiscoveryWhenCenteralPoweredOn
readwritenonatomicassign

Provided by category ThingBLECentralManager(Discovery).

Definition at line 20 of file ThingBLECentralManager+Discovery.h.


The documentation for this class was generated from the following files: