Tuya iOS Smart Life App SDK 5.15.0
ThingP2PSdk Class Reference

#import <ThingP2PSdk.h>

Inheritance diagram for ThingP2PSdk:

Class Methods

(int) + initLoggerWithApmLogSender:nativeLogSender:fullLinkLogSender:
 
(void) + deinitLogModule
 
(int) + getVersion
 
(int) + initWithLocalId:mqttSendBlock:httpsRequest:
 
(int) + initWithLocalId:mqttSendBlock:httpsRequest:sessionStateCB:
 
(int) + deInit
 
(int) + connectWithRemoteId:token:traceId:lanMode:timeout:
 
(int) + connectWithRemoteId:devId:skill:token:traceId:lanMode:timeout:preConnectEnable:
 
(int) + connectBreakWithTraceId:
 
(int) + disConnectWithHandle:
 
(int) + disConnectForcedWithHandle:
 
(int) + closeAllSessions
 
(int) + recvWithHandle:channel:buffer:bufferLen:timeOut:
 
(int) + sendWithHandle:channel:buffer:bufferLen:timeOut:
 
(int) + sendAuthorizationInfoWithHandle:channel:requestId:username:password:timeOut:
 
(int) + setSignalingWithMsg:msgLen:
 
(int) + setSignalingSendResultWithRemoteId:msg:msgLen:code:
 
(int) + setRemoteOnlineWithHandle:
 
(int) + activeCheckWithHandle:
 
(int) + setHttpsResponseWithApi:code:content:
 
(char *) + getSessionList
 
(void) + freeSessionListWithSessionList:
 
(int) + startPreConnectWithRemoteId:dev_id:
 
(int) + closePreConnectWithRemoteId:reason:
 
(int) + uploadLogWithLevel:log:
 
(int) + initLoggerWithApmLogSender:nativeLogSender:fullLinkLogSender:
 
(void) + deinitLogModule
 
(int) + getVersion
 
(int) + initWithLocalId:mqttSendBlock:httpsRequest:
 
(int) + initWithLocalId:mqttSendBlock:httpsRequest:sessionStateCB:
 
(int) + deInit
 
(int) + connectWithRemoteId:token:traceId:lanMode:timeout:
 
(int) + connectWithRemoteId:devId:skill:token:traceId:lanMode:timeout:preConnectEnable:
 
(int) + connectBreakWithTraceId:
 
(int) + disConnectWithHandle:
 
(int) + disConnectForcedWithHandle:
 
(int) + closeAllSessions
 
(int) + recvWithHandle:channel:buffer:bufferLen:timeOut:
 
(int) + sendWithHandle:channel:buffer:bufferLen:timeOut:
 
(int) + sendAuthorizationInfoWithHandle:channel:requestId:username:password:timeOut:
 
(int) + setSignalingWithMsg:msgLen:
 
(int) + setSignalingSendResultWithRemoteId:msg:msgLen:code:
 
(int) + setRemoteOnlineWithHandle:
 
(int) + activeCheckWithHandle:
 
(int) + setHttpsResponseWithApi:code:content:
 
(char *) + getSessionList
 
(void) + freeSessionListWithSessionList:
 
(int) + startPreConnectWithRemoteId:dev_id:
 
(int) + closePreConnectWithRemoteId:reason:
 
(int) + uploadLogWithLevel:log:
 

Detailed Description

Definition at line 18 of file ThingP2PSdk.h.

Method Documentation

◆ activeCheckWithHandle: [1/2]

+ (int) activeCheckWithHandle: (int)  handle

Description : check the p2p active or not

Parameters
handle: handle .The return value of connect operation.

◆ activeCheckWithHandle: [2/2]

+ (int) activeCheckWithHandle: (int)  handle

Description : check the p2p active or not

Parameters
handle: handle .The return value of connect operation.

◆ closeAllSessions [1/2]

+ (int) closeAllSessions

closs all sessions for app

◆ closeAllSessions [2/2]

+ (int) closeAllSessions

closs all sessions for app

◆ closePreConnectWithRemoteId:reason: [1/2]

+ (int) closePreConnectWithRemoteId: (char *)  remote_id
reason: (int)  reason 

◆ closePreConnectWithRemoteId:reason: [2/2]

+ (int) closePreConnectWithRemoteId: (char *)  remote_id
reason: (int)  reason 

◆ connectBreakWithTraceId: [1/2]

+ (int) connectBreakWithTraceId: (NSString *)  traceId

Description : break connect while connecting .

Parameters
traceId: traceId for p2p connect

◆ connectBreakWithTraceId: [2/2]

+ (int) connectBreakWithTraceId: (NSString *)  traceId

Description : break connect while connecting .

Parameters
traceId: traceId for p2p connect

◆ connectWithRemoteId:devId:skill:token:traceId:lanMode:timeout:preConnectEnable: [1/2]

+ (int) connectWithRemoteId: (NSString *)  remoteId
devId: (NSString *)  devId
skill: (NSString *)  skill
token: (NSString *)  token
traceId: (NSString *)  traceId
lanMode: (int)  lanMode
timeout: (int)  timeout
preConnectEnable: (int)  preConnectEnable 

connect v3 preConnectEnable preconnect enable or not

◆ connectWithRemoteId:devId:skill:token:traceId:lanMode:timeout:preConnectEnable: [2/2]

+ (int) connectWithRemoteId: (NSString *)  remoteId
devId: (NSString *)  devId
skill: (NSString *)  skill
token: (NSString *)  token
traceId: (NSString *)  traceId
lanMode: (int)  lanMode
timeout: (int)  timeout
preConnectEnable: (int)  preConnectEnable 

connect v3 preConnectEnable preconnect enable or not

◆ connectWithRemoteId:token:traceId:lanMode:timeout: [1/2]

+ (int) connectWithRemoteId: (NSString *)  remoteId
token: (NSString *)  token
traceId: (NSString *)  traceId
lanMode: (int)  lanMode
timeout: (int)  timeout 

Description : connect to the device such as camera.

Parameters
remoteId: the did
token: token for p2p connect
traceId: traceId for p2p connect
lanMode: 0 – not lan mode 1 – lan mode
timeout: time out for connect operation.
Returns
retcode >= 0: handle, retcode < 0: error code

◆ connectWithRemoteId:token:traceId:lanMode:timeout: [2/2]

+ (int) connectWithRemoteId: (NSString *)  remoteId
token: (NSString *)  token
traceId: (NSString *)  traceId
lanMode: (int)  lanMode
timeout: (int)  timeout 

Description : connect to the device such as camera.

Parameters
remoteId: the did
token: token for p2p connect
traceId: traceId for p2p connect
lanMode: 0 – not lan mode 1 – lan mode
timeout: time out for connect operation.
Returns
retcode >= 0: handle, retcode < 0: error code

◆ deInit [1/2]

+ (int) deInit

Description deinit the p2p module.

◆ deInit [2/2]

+ (int) deInit

Description deinit the p2p module.

◆ deinitLogModule [1/2]

+ (void) deinitLogModule

◆ deinitLogModule [2/2]

+ (void) deinitLogModule

◆ disConnectForcedWithHandle: [1/2]

+ (int) disConnectForcedWithHandle: (int)  handle

◆ disConnectForcedWithHandle: [2/2]

+ (int) disConnectForcedWithHandle: (int)  handle

◆ disConnectWithHandle: [1/2]

+ (int) disConnectWithHandle: (int)  handle

Description : disconnect with the device

Parameters
handle: handle .The return value of connect operation.

◆ disConnectWithHandle: [2/2]

+ (int) disConnectWithHandle: (int)  handle

Description : disconnect with the device

Parameters
handle: handle .The return value of connect operation.

◆ freeSessionListWithSessionList: [1/2]

+ (void) freeSessionListWithSessionList: (char *)  session_list

◆ freeSessionListWithSessionList: [2/2]

+ (void) freeSessionListWithSessionList: (char *)  session_list

◆ getSessionList [1/2]

+ (char *) getSessionList

◆ getSessionList [2/2]

+ (char *) getSessionList

◆ getVersion [1/2]

+ (int) getVersion

Description get the p2p version.

◆ getVersion [2/2]

+ (int) getVersion

Description get the p2p version.

◆ initLoggerWithApmLogSender:nativeLogSender:fullLinkLogSender: [1/2]

+ (int) initLoggerWithApmLogSender: (ThingApmLogSender apmLogSender
nativeLogSender: (ThingNativeLogSender nativeLogSender
fullLinkLogSender: (ThingFullLinkLogSender fullLinkLogSender 

◆ initLoggerWithApmLogSender:nativeLogSender:fullLinkLogSender: [2/2]

+ (int) initLoggerWithApmLogSender: (ThingApmLogSender apmLogSender
nativeLogSender: (ThingNativeLogSender nativeLogSender
fullLinkLogSender: (ThingFullLinkLogSender fullLinkLogSender 

◆ initWithLocalId:mqttSendBlock:httpsRequest: [1/2]

+ (int) initWithLocalId: (NSString *)  localId
mqttSendBlock: (ThingMQTTSender mqttSender
httpsRequest: (ThingHttpsRequest httpsRequest 

Description init the p2p module.

Parameters
localId: The local Id
mqttSender:

◆ initWithLocalId:mqttSendBlock:httpsRequest: [2/2]

+ (int) initWithLocalId: (NSString *)  localId
mqttSendBlock: (ThingMQTTSender mqttSender
httpsRequest: (ThingHttpsRequest httpsRequest 

Description init the p2p module.

Parameters
localId: The local Id
mqttSender:

◆ initWithLocalId:mqttSendBlock:httpsRequest:sessionStateCB: [1/2]

+ (int) initWithLocalId: (NSString *)  localId
mqttSendBlock: (ThingMQTTSender tyMqttSender
httpsRequest: (ThingHttpsRequest tyHttpsRequest
sessionStateCB: (imm_p2p_rtc_session_state_cb_t sessionStateCB 

◆ initWithLocalId:mqttSendBlock:httpsRequest:sessionStateCB: [2/2]

+ (int) initWithLocalId: (NSString *)  localId
mqttSendBlock: (ThingMQTTSender tyMqttSender
httpsRequest: (ThingHttpsRequest tyHttpsRequest
sessionStateCB: (imm_p2p_rtc_session_state_cb_t sessionStateCB 

◆ recvWithHandle:channel:buffer:bufferLen:timeOut: [1/2]

+ (int) recvWithHandle: (int)  handle
channel: (int)  channel
buffer: (unsigned char *)  buffer
bufferLen: (int)  bufferLen
timeOut: (int)  timeOut 

Description : read data from p2p channel.

Parameters
handle: handle .The return value of connect operation.
channel: the p2p channel
buffer: buffer pointer
bufferLen: len of buffer
timeOut: timeout in ms
Returns
< 0 错误发生 返回TUYA_P2P_ERROR_TIME_OUT(-3)表示超时,上层可以做重新读取操作。其他错误表示session已经断开 >= 0 实际读到的数据长度

◆ recvWithHandle:channel:buffer:bufferLen:timeOut: [2/2]

+ (int) recvWithHandle: (int)  handle
channel: (int)  channel
buffer: (unsigned char *)  buffer
bufferLen: (int)  bufferLen
timeOut: (int)  timeOut 

Description : read data from p2p channel.

Parameters
handle: handle .The return value of connect operation.
channel: the p2p channel
buffer: buffer pointer
bufferLen: len of buffer
timeOut: timeout in ms
Returns
< 0 错误发生 返回TUYA_P2P_ERROR_TIME_OUT(-3)表示超时,上层可以做重新读取操作。其他错误表示session已经断开 >= 0 实际读到的数据长度

◆ sendAuthorizationInfoWithHandle:channel:requestId:username:password:timeOut: [1/2]

+ (int) sendAuthorizationInfoWithHandle: (int)  handle
channel: (int)  channel
requestId: (int)  requestid
username: (NSString *)  username
password: (NSString *)  password
timeOut: (int)  timeOut 

Description : send data from p2p channel.

Parameters
handle: handle .The return value of connect operation.
channel: the p2p channel
requestid:requestid
username: username
password: password
timeOut: timeout in ms
Returns
< 0 错误发生 返回TUYA_P2P_ERROR_TIME_OUT(-3)表示超时,上层可以做重新发送操作。其他错误表示session已经断开 >= 0 发送成功的数据长度

◆ sendAuthorizationInfoWithHandle:channel:requestId:username:password:timeOut: [2/2]

+ (int) sendAuthorizationInfoWithHandle: (int)  handle
channel: (int)  channel
requestId: (int)  requestid
username: (NSString *)  username
password: (NSString *)  password
timeOut: (int)  timeOut 

Description : send data from p2p channel.

Parameters
handle: handle .The return value of connect operation.
channel: the p2p channel
requestid:requestid
username: username
password: password
timeOut: timeout in ms
Returns
< 0 错误发生 返回TUYA_P2P_ERROR_TIME_OUT(-3)表示超时,上层可以做重新发送操作。其他错误表示session已经断开 >= 0 发送成功的数据长度

◆ sendWithHandle:channel:buffer:bufferLen:timeOut: [1/2]

+ (int) sendWithHandle: (int)  handle
channel: (int)  channel
buffer: (unsigned char *)  buffer
bufferLen: (int)  bufferLen
timeOut: (int)  timeOut 

Description : send data from p2p channel.

Parameters
handle: handle .The return value of connect operation.
channel: the p2p channel
buffer: buffer pointer
bufferLen: len of buffer
timeOut: timeout in ms
Returns
< 0 错误发生 返回TUYA_P2P_ERROR_TIME_OUT(-3)表示超时,上层可以做重新发送操作。其他错误表示session已经断开 >= 0 发送成功的数据长度

◆ sendWithHandle:channel:buffer:bufferLen:timeOut: [2/2]

+ (int) sendWithHandle: (int)  handle
channel: (int)  channel
buffer: (unsigned char *)  buffer
bufferLen: (int)  bufferLen
timeOut: (int)  timeOut 

Description : send data from p2p channel.

Parameters
handle: handle .The return value of connect operation.
channel: the p2p channel
buffer: buffer pointer
bufferLen: len of buffer
timeOut: timeout in ms
Returns
< 0 错误发生 返回TUYA_P2P_ERROR_TIME_OUT(-3)表示超时,上层可以做重新发送操作。其他错误表示session已经断开 >= 0 发送成功的数据长度

◆ setHttpsResponseWithApi:code:content: [1/2]

+ (int) setHttpsResponseWithApi: (const char *)  api
code: (int)  code
content: (const char *)  content 

Description : check the p2p active or not

Parameters
api:
code:
content:

◆ setHttpsResponseWithApi:code:content: [2/2]

+ (int) setHttpsResponseWithApi: (const char *)  api
code: (int)  code
content: (const char *)  content 

Description : check the p2p active or not

Parameters
api:
code:
content:

◆ setRemoteOnlineWithHandle: [1/2]

+ (int) setRemoteOnlineWithHandle: (const char *)  remoteId

Description : ?

Parameters
remoteId: the did .

◆ setRemoteOnlineWithHandle: [2/2]

+ (int) setRemoteOnlineWithHandle: (const char *)  remoteId

Description : ?

Parameters
remoteId: the did .

◆ setSignalingSendResultWithRemoteId:msg:msgLen:code: [1/2]

+ (int) setSignalingSendResultWithRemoteId: (const char *)  remoteId
msg: (const char *)  msg
msgLen: (int)  msgLen
code: (int)  code 

Description : set the p2p signaling msg

Parameters
remoteId: remoteId
msg: p2p signaling msg
msgLen: msg length

◆ setSignalingSendResultWithRemoteId:msg:msgLen:code: [2/2]

+ (int) setSignalingSendResultWithRemoteId: (const char *)  remoteId
msg: (const char *)  msg
msgLen: (int)  msgLen
code: (int)  code 

Description : set the p2p signaling msg

Parameters
remoteId: remoteId
msg: p2p signaling msg
msgLen: msg length

◆ setSignalingWithMsg:msgLen: [1/2]

+ (int) setSignalingWithMsg: (const char *)  msg
msgLen: (int)  msgLen 

Description : set the p2p signaling msg

Parameters
msg: p2p signaling msg
msgLen: msg length

◆ setSignalingWithMsg:msgLen: [2/2]

+ (int) setSignalingWithMsg: (const char *)  msg
msgLen: (int)  msgLen 

Description : set the p2p signaling msg

Parameters
msg: p2p signaling msg
msgLen: msg length

◆ startPreConnectWithRemoteId:dev_id: [1/2]

+ (int) startPreConnectWithRemoteId: (char *)  remote_id
dev_id: (char *)  dev_id 

◆ startPreConnectWithRemoteId:dev_id: [2/2]

+ (int) startPreConnectWithRemoteId: (char *)  remote_id
dev_id: (char *)  dev_id 

◆ uploadLogWithLevel:log: [1/2]

+ (int) uploadLogWithLevel: (imm_p2p_rtc_log_level_e level
log: (NSString *)  log 

Description: upload the log through p2p interface online.

◆ uploadLogWithLevel:log: [2/2]

+ (int) uploadLogWithLevel: (imm_p2p_rtc_log_level_e level
log: (NSString *)  log 

Description: upload the log through p2p interface online.


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