IOTC Platform  Ver: 4.3.6.2-0-ge1f616e
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
RDTClient.h File Reference
#include "RDTCommon.h"

Typedefs

typedef void(__stdcall * rdtClientAuthCb )(char *cszAccount, uint32_t nAccountMaxLength, char *cszPassword, uint32_t nPasswordMaxLength, const void *pArg)
 

Functions

int32_t RDT_Client_Create (int32_t nIOTCSessionID, uint8_t nIOTCChannelID, rdtClientAuthCb pfxClientAuthFn, const void *pArg, int32_t nTimeoutMs)
 Create a RDT client.
 

Detailed Description

This file describes RDT module APIs for client.

Typedef Documentation

typedef void(__stdcall * rdtClientAuthCb)(char *cszAccount, uint32_t nAccountMaxLength, char *cszPassword, uint32_t nPasswordMaxLength, const void *pArg)

The prototype of authenticating connect informations, used by a RDT agent to be notified when connection start.

Parameters
cszAccount[out] The account input by user
nAccountMaxLength[in] Max size of cszAccount
cszPassword[out] The password input by user
nPasswordMaxLength[in] Max size of cszPassword
pArg[in] RDT agent pass user data
Attention
Set empty string "" to cszPassword meas reject this tunnel connection

Function Documentation

int32_t RDT_Client_Create ( int32_t  nIOTCSessionID,
uint8_t  nIOTCChannelID,
rdtClientAuthCb  pfxClientAuthFn,
const void *  pArg,
int32_t  nTimeoutMs 
)

Create a RDT client.

This function will create a RDT client based on specified IOTC channel with DTLS

Parameters
nIOTCSessionID[in] The session ID of the IOTC session to create RDT channel
nIOTCChannelID[in] The channel ID of the IOTC channel to create RDT channel
pfxClientAuthFn[in] The function pointer of authenticate account function if IOTC session is crate by Nebula, this param can be NULL.
pArg[in] User can give data pointer to pass to pfxClientAuthFn when this call back function is triggered. Can be NULL.
nTimeoutMs[in] The timeout for this function in unit of million-second. Specify it as 0 will make this function block forever until a RDT channel is successfully created or error happens
Returns
RDT channel ID if return value >= 0
Error code if return value < 0
See Also
RDT_Destroy() and RDT_Abort() RDT_Create_Exit()
Attention
(1) The IOTC channel of specified channel ID will be turned on automatically by RDT_Client_Create() (2) If IOTC session is created by Nebula, pfxServerAuthFn will NOT invoke when this API called.