DJI Payload SDK  1.5.0
Functions | Variables
psdk_upper.c File Reference

This file provides the API functions for establishing PSDK communication and authorization. More...

#include "psdk_upper.h"
#include <string.h>
#include <psdk.h>
#include <psdk_cmdset_define/psdk_cmdset_payload_state.h>
#include "psdk_cmdset.h"

Functions

static uint8_t * Str_PutStrToBuff (uint8_t *pBuff, char *str, uint32_t maxStrLen)
 Put a string to buffer. More...
 
static E_PsdkStat PsdkProtoUpper_CalTransferKey (const T_PsdkUserInfo *userInfo, uint8_t *pKey, uint16_t *pKeyBitSize)
 Calculate a key used for data transmission. More...
 
static E_PsdkStat PsdkPayloadStateCmd_IdentityVerify (struct _PsdkProt *protHandle, const T_PsdkProtInfo *inProtInfo, const uint8_t *inProtData)
 Payload identity verify. More...
 
static E_PsdkStat PsdkPayloadStateCmd_GetVersion (struct _PsdkProt *protHandle, const T_PsdkProtInfo *inProtInfo, const uint8_t *inProtData)
 Handle PSDK version acquire command. More...
 
static E_PsdkStat PsdkPayloadStateCmd_LinkHandShake (struct _PsdkProt *protHandle, const T_PsdkProtInfo *inProtInfo, const uint8_t *inProtData)
 Handle communication link hand-shake command. More...
 
static E_PsdkStat PsdkPayloadStateCmd_GetPayloadProductInfo (struct _PsdkProt *protHandle, const T_PsdkProtInfo *inProtInfo, const uint8_t *inProtData)
 Handle product information acquire command. More...
 
static E_PsdkStat PsdkPayloadStateCmd_GetSkyportVersionInfo (struct _PsdkProt *protHandle, const T_PsdkProtInfo *inProtInfo, const uint8_t *inProtData)
 Handle upgrade SKYPORT version acquire command. More...
 
static E_PsdkStat PsdkPayloadStateCmd_GetPayloadProductAlias (struct _PsdkProt *protHandle, const T_PsdkProtInfo *inProtInfo, const uint8_t *inProtData)
 Handle payload product alias acquire command. More...
 
E_PsdkStat PsdkUpper_Init (T_PsdkUpper *psdkUpper, const T_PsdkUserInfo *userInfo)
 Initialize the PSDK in top-level. More...
 
E_PsdkStat PsdkUpper_SetFixVersion (const T_PsdkUserFixSkyport *fixSkyport)
 Set the version of FW that you want your SkyPort adapter to stay on, regardless of FW upgrades. More...
 
E_PsdkStat PsdkUpper_SetProductAlias (const T_PsdkUserCustomInfo *customInfo)
 Set a string (part of the customInfo parameter) that will serve as your product alias of the PSDK in top-level. More...
 
E_PsdkStat PsdkUpper_ProcessReceiveData (T_PsdkUpper *psdkUpper, const uint8_t *pData, uint16_t len)
 Process the stream from PSDK port. More...
 
E_PsdkStat PsdkUpper_RegSendFunction (T_PsdkUpper *psdkUpper, PsdkSendCallbackFunc sendCallbackFunc)
 Register the send function for PSDK, which is externally provided by the user. More...
 
E_PsdkStat PsdkUpper_RegReceiveFunction (T_PsdkUpper *psdkUpper, PsdkReceiveCallbackFunc receiveCallbackFunc)
 Register the receive function for PSDK, which is externally provided by the user. More...
 

Variables

static T_PsdkUserInfo s_userInfo = {0}
 Payload SDK application information, please refer to T_PsdkUserInfo for details. More...
 
static T_PsdkUserFixSkyport s_fixSkyport = {0}
 Payload SDK APP alias, plaese refer to T_PsdkUserFixSkyport for details. More...
 
static T_PsdkUserCustomInfo s_customInfo = {0}
 Supported SkyPort FW version for Payload SDK, please refer to T_PsdkUserCustomInfo for details. More...
 
static const T_PsdkProtCmdItem s_payloadStateProtCmdList []
 Payload state commands process function list. More...
 

Detailed Description

This file provides the API functions for establishing PSDK communication and authorization.

Version
V1.5.0
Date
2019/07/31

All information contained herein is, and remains, the property of DJI. The intellectual and technical concepts contained herein are proprietary to DJI and may be covered by U.S. and foreign patents, patents in process, and protected by trade secret or copyright law. Dissemination of this information, including but not limited to data and other proprietary material(s) incorporated within the information, in any form, is strictly prohibited without the express written consent of DJI.

If you receive this source code without DJI’s authorization, you may not further disseminate the information, and you must immediately remove the source code and notify DJI of its removal. DJI reserves the right to pursue legal actions against you for any loss(es) or damage(s) caused by your failure to do so.