Tuya iOS Smart Life App SDK 5.15.0
<ThingSmartBLEConfigProtocol> Protocol Reference

#import <ThingSmartBLEDeviceProtocol.h>

Inheritance diagram for <ThingSmartBLEConfigProtocol>:

Instance Methods

(BOOL) - hasScannedBLEDeviceWithUUID:
 
(void) - publishDpsWithDeviceInfo:dps:success:failure:
 
(void) - publishQueryDpCommand:dpIds:success:failure:
 
(void) - connectWithDeviceInfo:success:failure:
 
(void) - disconnectWithDeviceInfo:success:failure:
 
(void) - removeWithDeviceInfo:success:failure:
 
(void) - resetWithDeviceInfo:success:failure:
 
(void) - sendOTAPackWithDeviceInfo:otaData:otaType:otaVersion:success:failure:
 
(NSInteger) - peripheralRSSI:
 
(BOOL) - deviceOnlineState:
 
(void) - getBLECapabilityWithUUID:success:failure:
 
(BOOL) - hasScannedBLEDeviceWithUUID:
 
(void) - publishDpsWithDeviceInfo:dps:success:failure:
 
(void) - publishQueryDpCommand:dpIds:success:failure:
 
(void) - connectWithDeviceInfo:success:failure:
 
(void) - disconnectWithDeviceInfo:success:failure:
 
(void) - removeWithDeviceInfo:success:failure:
 
(void) - resetWithDeviceInfo:success:failure:
 
(void) - sendOTAPackWithDeviceInfo:otaData:otaType:otaVersion:success:failure:
 
(NSInteger) - peripheralRSSI:
 
(BOOL) - deviceOnlineState:
 
(void) - getBLECapabilityWithUUID:success:failure:
 

Detailed Description

Definition at line 63 of file ThingSmartBLEDeviceProtocol.h.

Method Documentation

◆ connectWithDeviceInfo:success:failure: [1/2]

- (void) connectWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Connects to a device.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ connectWithDeviceInfo:success:failure: [2/2]

- (void) connectWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Connects to a device.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ deviceOnlineState: [1/2]

- (BOOL) deviceOnlineState: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo

Returns the local connection status of the Bluetooth LE device by deviceInfo.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
Returns
The local connection status of the Bluetooth LE device.

◆ deviceOnlineState: [2/2]

- (BOOL) deviceOnlineState: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo

Returns the local connection status of the Bluetooth LE device by deviceInfo.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
Returns
The local connection status of the Bluetooth LE device.

◆ disconnectWithDeviceInfo:success:failure: [1/2]

- (void) disconnectWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Disconnects a device.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ disconnectWithDeviceInfo:success:failure: [2/2]

- (void) disconnectWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Disconnects a device.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ getBLECapabilityWithUUID:success:failure: [1/2]

- (void) getBLECapabilityWithUUID: (NSString *)  uuid
success: (ThingSuccessString success
failure: (ThingFailureError failure 

Ability to acquire Bluetooth device: hexadecimal.

Parameters
uuidThe device uuid.
successCalled when the task finishes successfully.
failureCalled when the task is interrupted by an error.

◆ getBLECapabilityWithUUID:success:failure: [2/2]

- (void) getBLECapabilityWithUUID: (NSString *)  uuid
success: (ThingSuccessString success
failure: (ThingFailureError failure 

Ability to acquire Bluetooth device: hexadecimal.

Parameters
uuidThe device uuid.
successCalled when the task finishes successfully.
failureCalled when the task is interrupted by an error.

◆ hasScannedBLEDeviceWithUUID: [1/2]

- (BOOL) hasScannedBLEDeviceWithUUID: (NSString *)  uuid

Has scanned the target device.

Parameters
uuiduuid

◆ hasScannedBLEDeviceWithUUID: [2/2]

- (BOOL) hasScannedBLEDeviceWithUUID: (NSString *)  uuid

Has scanned the target device.

Parameters
uuiduuid

◆ peripheralRSSI: [1/2]

- (NSInteger) peripheralRSSI: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo

Returns the Received Signal Strength Indicator (RSSI) value of the Bluetooth LE device.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
Returns
The RSSI value of the Bluetooth LE device.

◆ peripheralRSSI: [2/2]

- (NSInteger) peripheralRSSI: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo

Returns the Received Signal Strength Indicator (RSSI) value of the Bluetooth LE device.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
Returns
The RSSI value of the Bluetooth LE device.

◆ publishDpsWithDeviceInfo:dps:success:failure: [1/2]

- (void) publishDpsWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
dps: (NSDictionary *)  dps
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Sends a DP.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
dpsThe DP dictionary.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ publishDpsWithDeviceInfo:dps:success:failure: [2/2]

- (void) publishDpsWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
dps: (NSDictionary *)  dps
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Sends a DP.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
dpsThe DP dictionary.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ publishQueryDpCommand:dpIds:success:failure: [1/2]

- (void) publishQueryDpCommand: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
dpIds: (NSArray *)  dpIds
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Queries device DP data through Bluetooth channels.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
dpIdsThe array of DP IDs to be queried.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ publishQueryDpCommand:dpIds:success:failure: [2/2]

- (void) publishQueryDpCommand: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
dpIds: (NSArray *)  dpIds
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Queries device DP data through Bluetooth channels.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
dpIdsThe array of DP IDs to be queried.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ removeWithDeviceInfo:success:failure: [1/2]

- (void) removeWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Removes a device.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ removeWithDeviceInfo:success:failure: [2/2]

- (void) removeWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Removes a device.

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ resetWithDeviceInfo:success:failure: [1/2]

- (void) resetWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Restores factory settings

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ resetWithDeviceInfo:success:failure: [2/2]

- (void) resetWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Restores factory settings

Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ sendOTAPackWithDeviceInfo:otaData:otaType:otaVersion:success:failure: [1/2]

- (void) sendOTAPackWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
otaData: (NSData *)  otaData
otaType: (ThingSmartBLEOTAType)  otaType
otaVersion: (NSString *)  otaVersion
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Sends an OTA package to update the firmware.

The values of otaData, otaType, and otaVersion can be obtained from ThingSmartFirmwareUpgradeModel. You can get ThingSmartFirmwareUpgradeModel by using getFirmwareUpgradeInfo:failure: (ThingSmartDevice).

Note
Your device must be connected over Bluetooth before the update.
Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
otaDataThe OTA package data.
otaTypeThe OTA update type.
otaVersionThe OTA version.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

◆ sendOTAPackWithDeviceInfo:otaData:otaType:otaVersion:success:failure: [2/2]

- (void) sendOTAPackWithDeviceInfo: (id< ThingSmartBLEDeviceProtocol >)  deviceInfo
otaData: (NSData *)  otaData
otaType: (ThingSmartBLEOTAType)  otaType
otaVersion: (NSString *)  otaVersion
success: (ThingSuccessHandler success
failure: (ThingFailureError failure 

Sends an OTA package to update the firmware.

The values of otaData, otaType, and otaVersion can be obtained from ThingSmartFirmwareUpgradeModel. You can get ThingSmartFirmwareUpgradeModel by using getFirmwareUpgradeInfo:failure: (ThingSmartDevice).

Note
Your device must be connected over Bluetooth before the update.
Parameters
deviceInfoThe Thing Bluetooth LE-based device object.
otaDataThe OTA package data.
otaTypeThe OTA update type.
otaVersionThe OTA version.
successCalled when the task is finished.
failureCalled when the task is interrupted by an error.

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