Mop Channel

2023-03-29
No Rating

The header file of SDK interconnection related functions is dji_mop_channel.h. This document describes the key information and usage of the structure and function prototypes in the dji_mop_channel.h file.

Notice: Only load devices developed on Linux support developers to use the SDK interconnection function.

Definition, Enum and Struct

typedef void *T_DjiMopChannelHandle;

typedef enum E_DjiMopChannelTransType

typedef enum {
    DJI_MOP_CHANNEL_TRANS_RELIABLE = 0, /*!< Reliable transmission type. */
    DJI_MOP_CHANNEL_TRANS_UNRELIABLE, /*!< Unreliable transmission type. */
} E_DjiMopChannelTransType;

Function

function DjiMopChannel_Init

Function:Initialize the mop channel for operation about mop channel handle later.product:all
T_DjiReturnCode DjiMopChannel_Init(void);


Return
The details for the return code please refer to: DjiErrorCode

function DjiMopChannel_Create

Function:Create the mop channel handle by specified transmission type. product:all
T_DjiReturnCode DjiMopChannel_Create(T_PsdkMopChannelHandle *channelHandle, E_DjiMopChannelTransType transType);
Parameter
channelHandle: pointer to the created mop channel.
transType:the transmission type for mop channel ::E_DjiMopChannelTransType.
Return
The details for the return code please refer to:PsdkErrorCode

function DjiMopChannel_Destroy

Function:Destroy the created mop channel and release the resource that referenced by the channel handle. product:all
T_DjiReturnCode DjiMopChannel_Destroy(T_PsdkMopChannelHandle channelHandle);
Parameter
channelHandle:pointer to the created mop channel.
Return
The details for the return code please refer to: DjiErrorCode

function DjiMopChannel_Bind

Function:Bind the channel id to the created mop channel handle. product:all
T_DjiReturnCode DjiMopChannel_Bind(T_PsdkMopChannelHandle channelHandle,
                                     uint16_t channelId);
Parameter
channelHandle:pointer to the created mop channel handle.
channelId:the channel id of mop handle for accepting client device connection.
Return
The details for the return code please refer to: DjiErrorCode

function DjiMopChannel_Accept

Function:Accept the connection by binded channel id for created mop channel. product:all
T_DjiReturnCode DjiMopChannel_Accept(T_PsdkMopChannelHandle channelHandle,
                                       T_PsdkMopChannelHandle *outChannelHandle);
Parameter
channelHandle: pointer to the created mop channel.
outChannelHandle:pointer to the accepted output mop channel.
Return
The details for the return code please refer to: DjiErrorCode

function DjiMopChannel_Connect

Function:MOP channel connection product:all
T_DjiReturnCode DjiMopChannel_Connect(T_DjiMopChannelHandle channelHandle, E_DjiChannelAddress channelAddress,
                                      uint16_t channelId);
Parameter
channelHandle: pointer to the created mop channel.
outChannelHandle:pointer to the accepted output mop channel.
Return
The details for the return code please refer to: DjiErrorCode

function DjiMopChannel_Close

Function:Close the created mop channel.product:all
T_DjiReturnCode DjiMopChannel_Close(T_PsdkMopChannelHandle channelHandle);
Parameter
channelHandle:pointer to the created mop channel.
Return
The details for the return code please refer to: DjiErrorCode

function DjiMopChannel_SendData

Function:Send data by the accepted output mop channel.product:all
T_DjiReturnCode DjiMopChannel_SendData(T_DjiMopChannelHandle channelHandle,
                                       uint8_t *data,
                                       uint32_t len,
                                       uint32_t *realLen);
Parameter
channelHandle:pointer to accepted output mop handle ::outChannelHandle by calling interface ::DjiMopChannel_Accept.
data:pointer to data to be sent.
len:length of data to be sent via accepted output mop handle, unit: byte.
realLen:pointer to real length of data that already sent.
Return
The details for the return code please refer to: DjiErrorCode

function DjiMopChannel_RecvData

Function:Receive data from the accepted output mop channel.product:all
T_DjiReturnCode DjiMopChannel_RecvData(T_DjiMopChannelHandle channelHandle,
                                       uint8_t *data,
                                       uint32_t len,
                                       uint32_t *realLen);
Parameter
channelHandle:pointer to accepted output mop handle ::outChannelHandle by calling interface ::DjiMopChannel_Accept.
data:pointer to data to store the received data.
len:length of data to be received via accepted output mop handle, unit: byte.
realLen:pointer to real length of data that already received.
Return
The details for the return code please refer to: DjiErrorCode
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.