DJI Payload SDK  1.5.3
psdk_cmdset_payload_state.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file psdk_cmdset_payload_state.h
4  * @version V1.0.0
5  * @date 2017/08/10
6  * @brief This file defines the payload state command set.
7  *
8  * @copyright (c) 2017-2018 DJI. All rights reserved.
9  *
10  * All information contained herein is, and remains, the property of DJI.
11  * The intellectual and technical concepts contained herein are proprietary
12  * to DJI and may be covered by U.S. and foreign patents, patents in process,
13  * and protected by trade secret or copyright law. Dissemination of this
14  * information, including but not limited to data and other proprietary
15  * material(s) incorporated within the information, in any form, is strictly
16  * prohibited without the express written consent of DJI.
17  *
18  * If you receive this source code without DJI’s authorization, you may not
19  * further disseminate the information, and you must immediately remove the
20  * source code and notify DJI of its removal. DJI reserves the right to pursue
21  * legal actions against you for any loss(es) or damage(s) caused by your
22  * failure to do so.
23  *
24  ******************************************************************************
25  */
26 
27 /* Define to prevent recursive inclusion -------------------------------------*/
28 #ifndef PSDK_CMDSET_PAYLOAD_STATE_H
29 #define PSDK_CMDSET_PAYLOAD_STATE_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /* Includes ------------------------------------------------------------------*/
36 #include <psdk_typedef.h>
37 #include <psdk_core.h>
38 
39 /** @addtogroup PSDK
40  * @{
41  */
42 
43 /** @addtogroup PSDK_Upper
44  * @{
45  */
46 
47 /* Exported constants --------------------------------------------------------*/
48 
49 /** @addtogroup Upper_Exported_Constants
50  * @{
51  */
52 
53 /** @defgroup Payload_State_Related Payload State Related
54  * @{
55  */
56 
57 #define PAYLOADSTATE_MAX_PINGDATA_SIZE 32 /*!< Specifies PING command request data max size. */
58 #define PAYLOADSTATE_MAX_PRODUCT_NAME_SIZE 32 /*!< Specifies product name max size. */
59 #define PAYLOADSTATE_MAX_PRODUCT_ID_SIZE 16 /*!< Specifies product ID max size. */
60 #define PAYLOADSTATE_MAX_DEV_ACCOUNT_SIZE 64 /*!< Specifies developer account max size. */
61 
62 /**
63  * @}
64  */
65 
66 /**
67  * @}
68  */
69 
70 /* Exported macros -----------------------------------------------------------*/
71 /* Exported types ------------------------------------------------------------*/
72 
73 /** @defgroup Upper_Exported_Types Exported Types
74  * @{
75  */
76 
77 #pragma pack(1)
78 
79 /**
80  * @brief Payload State Command ID
81  */
82 typedef enum {
83  PSDK_PAYLOADSTATE_CMDID_IDENTITY_VERIFY = 0x01, /*!< identity verify command */
84  PSDK_PAYLOADSTATE_CMDID_SDK_VERSION = 0x02, /*!< acquire PSDK version command */
85  PSDK_PAYLOADSTATE_CMDID_LINK_HANDSHAKE = 0x03, /*!< communication link hand-shake command */
86  PSDK_PAYLOADSTATE_CMDID_PRODUCT_INFO = 0x04, /*!< acquire PSDK product information command */
87  PSDK_PAYLOADSTATE_CMDID_FIX_SKYPORT_VERSION = 0x05, /*!< acquire support version of skyport for PSDK command */
88  PSDK_PAYLOADSTATE_CMDID_PRODUCT_ALIAS = 0x06, /*!< acquire PSDK product alias command */
90 
91 // PSDK_PAYLOADSTATE_CMDID_IDENTITY_VERIFY
92 /**
93  * @brief Identity verify command request data structure.
94  */
95 typedef struct {
96  uint8_t random[16]; /*!< Random character string. */
98 
99 /**
100  * @brief Identity verify command ack data structure.
101  */
102 typedef struct {
103  uint8_t ackCode; /*!< Specifies PSDK command ack code.
104  This parameter can be any value of ::E_PsdkCmdAckCode. */
105  uint8_t md5[16]; /*!< MD5 value calculated by payload. */
107 
108 // PSDK_PAYLOADSTATE_CMDID_SDK_VERSION
109 /**
110  * @brief Acquire PSDK version command ack data structure.
111  */
112 typedef struct {
113  uint8_t ackCode; /*!< Specifies PSDK command ack code.
114  This parameter can be any value of ::E_PsdkCmdAckCode. */
115  union {
116  struct {
117  uint32_t verDebug : 8;
118  uint32_t verModify : 8;
119  uint32_t verMinor : 8;
120  uint32_t verMajor : 8;
121  } ver;
122  uint32_t data;
123  } version; /*!< Specifies PSDK version number. */
125 
126 // PSDK_PAYLOADSTATE_CMDID_LINK_HANDSHAKE
127 /**
128  * @brief PSDK communication link hand-shake command request data structure.
129  */
130 typedef struct {
131  uint8_t pingData[PAYLOADSTATE_MAX_PINGDATA_SIZE]; /*!< Specifies data used to detecting link state.
132  @note The data length is between 1 and PAYLOADSTATE_MAX_PINGDATA_SIZE. */
134 
135 /**
136  * @brief PSDK communication link hand-shake command ack data structure.
137  */
138 typedef struct {
139  uint8_t ackCode; /*!< Specifies PSDK command ack code.
140  This parameter can be any value of ::E_PsdkCmdAckCode */
141  uint8_t pingData[PAYLOADSTATE_MAX_PINGDATA_SIZE]; /*!< Specifies data used to detecting link state.
142  @note The data length is between 1 and PAYLOADSTATE_MAX_PINGDATA_SIZE. */
144 
145 // PSDK_PAYLOADSTATE_CMDID_PRODUCT_INFO
146 /**
147  * @brief Acquire PSDK product information command ack data structure.
148  */
149 typedef struct {
150  uint8_t ackCode; /*!< Specifies PSDK command ack code.
151  This parameter can be any value of ::E_PsdkCmdAckCode */
152  char productName[PAYLOADSTATE_MAX_PRODUCT_NAME_SIZE]; /*!< Specifies PSDK product name. */
153  char productID[PAYLOADSTATE_MAX_PRODUCT_ID_SIZE]; /*!< Specifies PSDK product ID. */
154  char developerAccount[PAYLOADSTATE_MAX_DEV_ACCOUNT_SIZE];/*!< Specifies PSDK developer account email. */
156 
157 /**
158  * @brief Acquire support version of skyport for PSDK command request data structure.
159  */
160 typedef struct {
161  PSDK_EMPTY_STRUCT
163 
164 /**
165  * @brief Acquire support version of skyport for PSDK command ack data structure.
166  */
167 typedef struct {
168  uint8_t ackCode; /*!< Specifies PSDK command ack code.
169  This parameter can be any value of ::E_PsdkCmdAckCode */
170  union {
171  struct {
172  uint32_t debugVer : 8;
173  uint32_t modifyVer : 8;
174  uint32_t minorVer : 8;
175  uint32_t majorVer : 8;
176  } ver;
177  uint32_t data;
178  } version; /*!< Specifies PSDK version. */
180 
181 /**
182  * @brief Acquire PSDK product alias command request data structure.
183  */
184 typedef struct {
185  PSDK_EMPTY_STRUCT
187 
188 /**
189  * @brief Acquire PSDK product alias command ack data structure.
190  */
191 typedef struct {
192  uint8_t ackCode; /*!< Specifies PSDK command ack code.
193  This parameter can be any value of ::E_PsdkCmdAckCode */
194  char productName[PAYLOADSTATE_MAX_PRODUCT_NAME_SIZE]; /*!< Specifies PSDK product name. */
196 
197 #pragma pack()
198 
199 /**
200  * @}
201  */
202 
203 /* Exported variables --------------------------------------------------------*/
204 /* Exported functions --------------------------------------------------------*/
205 /* Private constants ---------------------------------------------------------*/
206 /* Private macros ------------------------------------------------------------*/
207 /* Private types -------------------------------------------------------------*/
208 /* Private variables ---------------------------------------------------------*/
209 /* Private functions ---------------------------------------------------------*/
210 
211 /**
212  * @}
213  */
214 
215 /**
216  * @}
217  */
218 
219 #ifdef __cplusplus
220 }
221 #endif
222 
223 #endif //PSDK_CMDSET_PAYLOAD_STATE_H
224 
225 /************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
Definition: psdk_cmdset_payload_state.h:83
Definition: psdk_cmdset_payload_state.h:88
Acquire PSDK version command ack data structure.
Definition: psdk_cmdset_payload_state.h:112
Definition: psdk_cmdset_payload_state.h:86
Acquire PSDK product alias command ack data structure.
Definition: psdk_cmdset_payload_state.h:191
uint8_t ackCode
Definition: psdk_cmdset_payload_state.h:103
E_PsdkPayLoadStateCmd
Payload State Command ID.
Definition: psdk_cmdset_payload_state.h:82
Identity verify command request data structure.
Definition: psdk_cmdset_payload_state.h:95
Acquire support version of skyport for PSDK command request data structure.
Definition: psdk_cmdset_payload_state.h:160
Identity verify command ack data structure.
Definition: psdk_cmdset_payload_state.h:102
PSDK core include file.
uint8_t ackCode
Definition: psdk_cmdset_payload_state.h:192
Definition: psdk_cmdset_payload_state.h:87
Acquire PSDK product information command ack data structure.
Definition: psdk_cmdset_payload_state.h:149
Definition: psdk_cmdset_payload_state.h:84
uint8_t ackCode
Definition: psdk_cmdset_payload_state.h:113
Acquire PSDK product alias command request data structure.
Definition: psdk_cmdset_payload_state.h:184
Acquire support version of skyport for PSDK command ack data structure.
Definition: psdk_cmdset_payload_state.h:167
uint8_t ackCode
Definition: psdk_cmdset_payload_state.h:168
uint8_t ackCode
Definition: psdk_cmdset_payload_state.h:150
Definition: psdk_cmdset_payload_state.h:85