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

Typedefs

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

Functions

int32_t RDT_Server_Create (int32_t nIOTCSessionID, uint8_t nIOTCChannelID, rdtServerAuthCb pfxServerAuthFn, const void *pArg, int32_t nTimeoutMs)
 Create a RDT server.
 

Detailed Description

This file describes RDT module APIs for server.

Typedef Documentation

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

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

Parameters
cszAccount[in] Account from RDT agent
cszPassword[out] The password input by user, set "" means authenticate fail
nPasswordMaxLength[in] Max size of cszPassword
pArg[in] RDT server pass user data
Attention
Set empty string "" to cszPassword meas reject this tunnel connection

Function Documentation

int32_t RDT_Server_Create ( int32_t  nIOTCSessionID,
uint8_t  nIOTCChannelID,
rdtServerAuthCb  pfxServerAuthFn,
const void *  pArg,
int32_t  nTimeoutMs 
)

Create a RDT server.

This function will create a RDT server 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
pfxServerAuthFn[in] The function pointer of authenticate account function, if IOTC is login by Nebula, this param can be NULL.
pArg[in] User can give data pointer to pass to pfxServerAuthFn 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()
Attention
(1) The IOTC channel of specified channel ID will be turned on automatically by RDT_Server_Create() (2) If IOTC session is created by Nebula, pfxServerAuthFn will NOT invoke when this API called.