#import <ThingSmartP2pChannel.h>
Definition at line 19 of file ThingSmartP2pChannel.h.
◆ __deprecated_msg [1/2]
◆ __deprecated_msg [2/2]
◆ activeCheckWithHandle: [1/2]
- (int) activeCheckWithHandle: |
|
(int) |
p2pHandle |
|
check the p2p session status, return a negative number to indicate that the connection has been disconnected
- Parameters
-
p2pHandle | p2p session handle |
◆ activeCheckWithHandle: [2/2]
- (int) activeCheckWithHandle: |
|
(int) |
p2pHandle |
|
check the p2p session status, return a negative number to indicate that the connection has been disconnected
- Parameters
-
p2pHandle | p2p session handle |
◆ breakConnectWithTraceId: [1/2]
- (int) breakConnectWithTraceId: |
|
(NSString *) |
traceId |
|
break connecting session
- Parameters
-
◆ breakConnectWithTraceId: [2/2]
- (int) breakConnectWithTraceId: |
|
(NSString *) |
traceId |
|
break connecting session
- Parameters
-
◆ closePreConnectWithDeviceId: [1/2]
- (int) closePreConnectWithDeviceId: |
|
(NSString *) |
devId |
|
returnValue >= 0 , success
- Parameters
-
◆ closePreConnectWithDeviceId: [2/2]
- (int) closePreConnectWithDeviceId: |
|
(NSString *) |
devId |
|
returnValue >= 0 , success
- Parameters
-
◆ connectWithDeviceId:mode:timeout:success:failure: [1/2]
- (NSString *) connectWithDeviceId: |
|
(NSString *) |
devId |
mode: |
|
(ThingSmartP2pConnectMode) |
mode |
timeout: |
|
(NSInteger) |
timeout |
success: |
|
(void(^)(int p2pHandle)) |
success |
failure: |
|
(void(^)(NSInteger errCode)) |
failure |
|
|
| |
create p2p channel
- Parameters
-
devId | device id |
mode | connect mode |
timeout | timeout, set 0 will use default value, Lan Mode: 3000 ms, Internet Mode: 15000 ms |
success | success callback, and parameter is the p2p session handle |
failure | failure callback |
- Returns
- trace id, break connecting must use trace id to specify p2p session
◆ connectWithDeviceId:mode:timeout:success:failure: [2/2]
- (NSString *) connectWithDeviceId: |
|
(NSString *) |
devId |
mode: |
|
(ThingSmartP2pConnectMode) |
mode |
timeout: |
|
(NSInteger) |
timeout |
success: |
|
(void(^)(int p2pHandle)) |
success |
failure: |
|
(void(^)(NSInteger errCode)) |
failure |
|
|
| |
create p2p channel
- Parameters
-
devId | device id |
mode | connect mode |
timeout | timeout, set 0 will use default value, Lan Mode: 3000 ms, Internet Mode: 15000 ms |
success | success callback, and parameter is the p2p session handle |
failure | failure callback |
- Returns
- trace id, break connecting must use trace id to specify p2p session
◆ connectWithDeviceId:token:traceId:mode:success:failure: [1/2]
- (NSString *) connectWithDeviceId: |
|
(NSString *) |
devId |
token: |
|
(NSString *) |
token |
traceId: |
|
(NSString *) |
traceId |
mode: |
|
(ThingSmartP2pConnectMode) |
mode |
success: |
|
(void(^)(int p2pHandle)) |
success |
failure: |
|
("Use connectWithDeviceId:mode:timeout:success:failure: instead") |
__deprecated_msg |
|
|
| |
create p2p channel
- Parameters
-
devId | device id |
token | p2p token |
traceId | trace id for link, and break a connecting session must use the trace id to specify the p2p session |
mode | connect mode |
success | connect success callback, and parameter is the p2p session handle |
failure | connect failure callback |
- Returns
- trace id, if param
traceId
is nil, there well create one
◆ connectWithDeviceId:token:traceId:mode:success:failure: [2/2]
- (NSString *) connectWithDeviceId: |
|
(NSString *) |
devId |
token: |
|
(NSString *) |
token |
traceId: |
|
(NSString *) |
traceId |
mode: |
|
(ThingSmartP2pConnectMode) |
mode |
success: |
|
(void(^)(int p2pHandle)) |
success |
failure: |
|
("Use connectWithDeviceId:mode:timeout:success:failure: instead") |
__deprecated_msg |
|
|
| |
create p2p channel
- Parameters
-
devId | device id |
token | p2p token |
traceId | trace id for link, and break a connecting session must use the trace id to specify the p2p session |
mode | connect mode |
success | connect success callback, and parameter is the p2p session handle |
failure | connect failure callback |
- Returns
- trace id, if param
traceId
is nil, there well create one
◆ connectWithDevId:mode:timeout:success:failure: [1/2]
- (NSString *) connectWithDevId: |
|
(NSString *) |
devId |
mode: |
|
(ThingSmartP2pConnectMode) |
mode |
timeout: |
|
(NSInteger) |
timeout |
success: |
|
(void(^)(int p2pHandle)) |
success |
failure: |
|
(void(^)(NSInteger errCode)) |
failure |
|
|
| |
create p2p channel new – optimize error code
- Parameters
-
devId | device id |
mode | connect mode |
timeout | timeout, set 0 will use default value, Lan Mode: 3000 ms, Internet Mode: 15000 ms |
success | success callback, and parameter is the p2p session handle |
failure | failure callback, Note: errCode -3 split info more error codes,eg:-33,-38,-39, -40 and so on. |
- Returns
- trace id, break connecting must use trace id to specify p2p session
◆ connectWithDevId:mode:timeout:success:failure: [2/2]
- (NSString *) connectWithDevId: |
|
(NSString *) |
devId |
mode: |
|
(ThingSmartP2pConnectMode) |
mode |
timeout: |
|
(NSInteger) |
timeout |
success: |
|
(void(^)(int p2pHandle)) |
success |
failure: |
|
(void(^)(NSInteger errCode)) |
failure |
|
|
| |
create p2p channel new – optimize error code
- Parameters
-
devId | device id |
mode | connect mode |
timeout | timeout, set 0 will use default value, Lan Mode: 3000 ms, Internet Mode: 15000 ms |
success | success callback, and parameter is the p2p session handle |
failure | failure callback, Note: errCode -3 split info more error codes,eg:-33,-38,-39, -40 and so on. |
- Returns
- trace id, break connecting must use trace id to specify p2p session
◆ deInitP2PSDK [1/2]
deInit P2P SDK, only call when logout
◆ deInitP2PSDK [2/2]
deInit P2P SDK, only call when logout
◆ deInitSDK [1/2]
reset configs, remove msg observing
◆ deInitSDK [2/2]
reset configs, remove msg observing
◆ disconnectWithP2pHandle: [1/2]
- (int) disconnectWithP2pHandle: |
|
(int) |
handle |
|
disconnect p2p
- Parameters
-
◆ disconnectWithP2pHandle: [2/2]
- (int) disconnectWithP2pHandle: |
|
(int) |
handle |
|
disconnect p2p
- Parameters
-
◆ initP2PSDKWithUid: [1/2]
- (void) initP2PSDKWithUid: |
|
(NSString *) |
uid |
|
init P2P SDK, only call when login
◆ initP2PSDKWithUid: [2/2]
- (void) initP2PSDKWithUid: |
|
(NSString *) |
uid |
|
init P2P SDK, only call when login
◆ initSDKWithUid: [1/2]
- (void) initSDKWithUid: |
|
(NSString *) |
uid |
|
init configs, add msg observing
◆ initSDKWithUid: [2/2]
- (void) initSDKWithUid: |
|
(NSString *) |
uid |
|
init configs, add msg observing
◆ isP2pActive: [1/2]
check the p2p session active or not
- Parameters
-
p2pHandle | p2p session handle |
◆ isP2pActive: [2/2]
check the p2p session active or not
- Parameters
-
p2pHandle | p2p session handle |
◆ onDeviceOnline: [1/2]
- (int) onDeviceOnline: |
|
("Use resendOffer: instead") |
__deprecated_msg |
|
notify p2p SDK the device is online, for the low-power device
- Parameters
-
◆ onDeviceOnline: [2/2]
- (int) onDeviceOnline: |
|
("Use resendOffer: instead") |
__deprecated_msg |
|
notify p2p SDK the device is online, for the low-power device
- Parameters
-
◆ readDataWithP2pHandle:channel:buffer: [1/2]
- (int) readDataWithP2pHandle: |
|
(int) |
handle |
channel: |
|
(int) |
channel |
buffer: |
|
(unsigned char *) |
buffer |
|
|
| |
read data from p2p channel
- Parameters
-
handle | p2p session handle |
channel | p2p channel |
buffer | buffer ponter |
- Returns
- the length of read data. if -0, means error. -3 is timeout, and others means session did disconnected
◆ readDataWithP2pHandle:channel:buffer: [2/2]
- (int) readDataWithP2pHandle: |
|
(int) |
handle |
channel: |
|
(int) |
channel |
buffer: |
|
(unsigned char *) |
buffer |
|
|
| |
read data from p2p channel
- Parameters
-
handle | p2p session handle |
channel | p2p channel |
buffer | buffer ponter |
- Returns
- the length of read data. if -0, means error. -3 is timeout, and others means session did disconnected
◆ readDataWithP2pHandle:channel:buffer:timeout: [1/2]
- (int) readDataWithP2pHandle: |
|
(int) |
handle |
channel: |
|
(int) |
channel |
buffer: |
|
(unsigned char *) |
buffer |
timeout: |
|
(int) |
timeout |
|
|
| |
read data from p2p channel
- Parameters
-
handle | p2p session handle |
channel | p2p channel |
buffer | buffer ponter |
- Returns
- the length of read data. if -0, means error. -3 is timeout, and others means session did disconnected
◆ readDataWithP2pHandle:channel:buffer:timeout: [2/2]
- (int) readDataWithP2pHandle: |
|
(int) |
handle |
channel: |
|
(int) |
channel |
buffer: |
|
(unsigned char *) |
buffer |
timeout: |
|
(int) |
timeout |
|
|
| |
read data from p2p channel
- Parameters
-
handle | p2p session handle |
channel | p2p channel |
buffer | buffer ponter |
- Returns
- the length of read data. if -0, means error. -3 is timeout, and others means session did disconnected
◆ resendOffer: [1/2]
- (int) resendOffer: |
|
(NSString *) |
deviceId |
|
resend p2p connect offer
- Parameters
-
◆ resendOffer: [2/2]
- (int) resendOffer: |
|
(NSString *) |
deviceId |
|
resend p2p connect offer
- Parameters
-
◆ sendDataWithP2pHandle:channel:buffer:length: [1/2]
- (int) sendDataWithP2pHandle: |
|
(int) |
handle |
channel: |
|
(int) |
channel |
buffer: |
|
(unsigned char *) |
buffer |
length: |
|
(int) |
len |
|
|
| |
send data by p2p channel
- Parameters
-
handle | p2p session handle |
channel | p2p channel |
buffer | buffer pointer |
len | length of buffer |
- Returns
- the length of send data successfull. if -0, means error. -3 is timeout, and others means session did disconnected
◆ sendDataWithP2pHandle:channel:buffer:length: [2/2]
- (int) sendDataWithP2pHandle: |
|
(int) |
handle |
channel: |
|
(int) |
channel |
buffer: |
|
(unsigned char *) |
buffer |
length: |
|
(int) |
len |
|
|
| |
send data by p2p channel
- Parameters
-
handle | p2p session handle |
channel | p2p channel |
buffer | buffer pointer |
len | length of buffer |
- Returns
- the length of send data successfull. if -0, means error. -3 is timeout, and others means session did disconnected
◆ sendDataWithP2pHandle:channel:buffer:length:timeout: [1/2]
- (int) sendDataWithP2pHandle: |
|
(int) |
handle |
channel: |
|
(int) |
channel |
buffer: |
|
(unsigned char *) |
buffer |
length: |
|
(int) |
len |
timeout: |
|
(int) |
timeout |
|
|
| |
send data by p2p channel
- Parameters
-
handle | p2p session handle |
channel | p2p channel |
buffer | buffer pointer |
len | length of buffer |
- Returns
- the length of send data successfull. if -0, means error. -3 is timeout, and others means session did disconnected
◆ sendDataWithP2pHandle:channel:buffer:length:timeout: [2/2]
- (int) sendDataWithP2pHandle: |
|
(int) |
handle |
channel: |
|
(int) |
channel |
buffer: |
|
(unsigned char *) |
buffer |
length: |
|
(int) |
len |
timeout: |
|
(int) |
timeout |
|
|
| |
send data by p2p channel
- Parameters
-
handle | p2p session handle |
channel | p2p channel |
buffer | buffer pointer |
len | length of buffer |
- Returns
- the length of send data successfull. if -0, means error. -3 is timeout, and others means session did disconnected
◆ sharedInstance [1/2]
+ (instancetype) sharedInstance |
|
|
|
◆ sharedInstance [2/2]
+ (instancetype) sharedInstance |
|
|
|
◆ startPreConnectWithDeviceId: [1/2]
- (int) startPreConnectWithDeviceId: |
|
(NSString *) |
devId |
|
returnValue >= 0 , success
- Parameters
-
◆ startPreConnectWithDeviceId: [2/2]
- (int) startPreConnectWithDeviceId: |
|
(NSString *) |
devId |
|
returnValue >= 0 , success
- Parameters
-
◆ p2pVersion
- (NSString *) p2pVersion |
|
readnonatomiccopy |
◆ readDataTimeOut
- (NSInteger) readDataTimeOut |
|
readwritenonatomicassign |
◆ sendDataTimeOut
- (NSInteger) sendDataTimeOut |
|
readwritenonatomicassign |
The documentation for this class was generated from the following files:
- /Users/humtong/Downloads/Pods_副本/ThingSmartP2pChannelKit/Build/ThingSmartP2pChannelKit.xcframework/ios-arm64_x86_64-simulator/ThingSmartP2pChannelKit.framework/Headers/ThingSmartP2pChannel.h
- /Users/humtong/Downloads/Pods_副本/ThingSmartP2pChannelKit/Build/ThingSmartP2pChannelKit.xcframework/ios-arm64/ThingSmartP2pChannelKit.framework/Headers/ThingSmartP2pChannel.h