Skip to content

Commit

Permalink
Hotfix Release for A3 FW 1.5.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Sant committed Nov 16, 2016
1 parent 2fca05b commit af0903e
Show file tree
Hide file tree
Showing 18 changed files with 568 additions and 257 deletions.
10 changes: 6 additions & 4 deletions osdk-core/inc/DJI_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

#ifndef DJI_API_H
#define DJI_API_H
#include "DJI_Type.h"
//#include "DJI_Mission.h"

#include "DJI_Type.h"
#include "DJI_HardDriver.h"
#include "DJI_App.h"

namespace DJI
{
namespace onboardSDK
Expand Down Expand Up @@ -72,11 +72,13 @@ enum ACK_ACTIVE_CODE

enum ACK_SETCONTROL_CODE
{
ACK_SETCONTROL_NEED_MODE_F = 0x0000,
ACK_SETCONTROL_ERROR_MODE = 0x0000,
ACK_SETCONTROL_RELEASE_SUCCESS = 0x0001,
ACK_SETCONTROL_OBTAIN_SUCCESS = 0x0002,
ACK_SETCONTROL_OBTAIN_RUNNING = 0x0003,
ACK_SETCONTROL_RELEASE_RUNNING = 0x0004,
ACK_SETCONTROL_NEED_MODE_F = 0x0006,
ACK_SETCONTROL_NEED_MODE_P = 0x0005,
ACK_SETCONTROL_IOC = 0x00C9,

};
Expand Down Expand Up @@ -227,6 +229,7 @@ class CoreAPI
void ack(req_id_t req_id, unsigned char *ackdata, int len);

//! Notify caller ACK frame arrived
void allocateACK(Header *protocolHeader);
void notifyCaller(Header *protocolHeader);
void notifyNonBlockingCaller(Header *protocolHeader);

Expand Down Expand Up @@ -658,7 +661,6 @@ class CoreAPI
ActivateData accountData;

unsigned short seq_num;
unsigned char *version_ack_data;

SDKFilter filter;

Expand Down
2 changes: 1 addition & 1 deletion osdk-core/inc/DJI_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define API_STATUS_DATA

//! @note if you do NOT want to use AES encrypt, comment this macro below
#define USE_ENCRYPT
//#define USE_ENCRYPT

//! @todo Not supported in this release.
//#define USE_SIMULATION
Expand Down
53 changes: 39 additions & 14 deletions osdk-core/inc/DJI_Type.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! @file DJI_Type.h
* @version 3.1.7
* @date Jul 01 2016
* @version 3.1.9
* @date November 10, 2016
*
* @brief
* Type definition for DJI onboardSDK library.
Expand All @@ -22,6 +22,8 @@
#include "DJI_Config.h"
#include "DJICommonType.h"
#include <stdio.h>
#include <exception>
#include <stdexcept>

#define NAME(x) #x

Expand Down Expand Up @@ -122,6 +124,13 @@ extern uint8_t encrypt;
const size_t SESSION_TABLE_NUM = 32;
const size_t CALLBACK_LIST_NUM = 10;

/**
* @note size is in Bytes
*/
const size_t MAX_ACK_SIZE = 64;
const size_t M100_MAX_ACK_SIZE = 64;
const size_t A3_MAX_ACK_SIZE = 63;

//! The CoreAPI class definition is detailed in DJI_API.h
class CoreAPI;

Expand Down Expand Up @@ -337,18 +346,7 @@ typedef struct WayPointVelocityACK
float32_t idleVelocity;
} WayPointVelocityACK;


typedef union MissionACKUnion
{
uint8_t raw_ack_array[5];
MissionACK missionACK;
SimpleACK simpleACK;
HotPointStartACK hotpointStartACK;
WayPointDataACK waypointDataACK;
WayPointVelocityACK waypointVelocityACK;
} MissionACKUnion;

// These big structs have structs within and don't seem to be used
// HotPoint data read from flight controller
typedef struct HotPointReadACK
{
MissionACK ack;
Expand All @@ -361,6 +359,33 @@ typedef struct WayPointInitACK
WayPointInitData data;
} WayPointInitACK;

typedef struct DroneVersionACK
{
unsigned char ack[MAX_ACK_SIZE];
};

typedef union MissionACKUnion
{
uint8_t raw_ack_array[MAX_ACK_SIZE];
DroneVersionACK droneVersion;
MissionACK missionACK;

SimpleACK simpleACK;

HotPointStartACK hotpointStartACK;

// Contains 1-Byte ACK plus hotpoint mission
// information read from flight controller
HotpointReadACK hotpointReadACK;

// Contains 1-Byte ACK plus waypoint mission
// information read from flight controller
WayPointInitACK waypointInitACK;

WayPointDataACK waypointDataACK;
WayPointVelocityACK waypointVelocityACK;
} MissionACKUnion;

typedef struct QuaternionData
{
float32_t q0;
Expand Down
1 change: 1 addition & 0 deletions osdk-core/inc/DJI_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ typedef uint32_t Version;
const Version versionM100_23 = (MAKE_VERSION(2, 3, 10, 0));
const Version versionM100_31 = (MAKE_VERSION(3, 1, 10, 0));
const Version versionA3_31 = (MAKE_VERSION(3, 1, 100, 0));
const Version versionA3_32 = (MAKE_VERSION(3, 2, 0, 0));

#ifdef SDK_DEV
#include "dev.h"
Expand Down
Loading

0 comments on commit af0903e

Please sign in to comment.