dji_hms.hpp
Go to the documentation of this file.
1 
30 #ifndef ONBOARDSDK_DJI_HMS_H
31 #define ONBOARDSDK_DJI_HMS_H
32 
33 #include "dji_type.hpp"
34 #include <vector>
35 
36 
37 namespace DJI{
38 namespace OSDK{
39 
40 // Forward Declarations
41 class Vehicle;
42 class DJIHMSImpl;
43 
44 #pragma pack(1)
45 
46 typedef struct ErrList{
47  uint32_t alarmID;
48  uint8_t sensorIndex;
49  uint8_t reportLevel;
50 } ErrList;
51 
53 typedef struct HMSPushData {
54  uint8_t msgVersion;
55  uint8_t globalIndex;
56  uint8_t msgEnd : 1;
57  uint8_t msgIndex : 7;
58  std::vector<ErrList> errList;
59 } HMSPushData;
60 #pragma pack()
61 
63 typedef struct HMSPushPacket
64 {
65  HMSPushData hmsPushData;
66  uint32_t timeStamp;
68 
69 typedef enum
70 {
71  CameraIndex1 = 1,
72  CameraIndex2 = 2,
73  CameraIndex3 = 3,
74 } CameraIndex;
75 
76 typedef enum
77 {
78  GimbalIndex1 = 1,
79  GimbalIndex2 = 2,
80  GimbalIndex3 = 3,
81  InvalidIndex = 0xff,
82 } GimbalIndex;
83 
84 typedef enum
85 {
86  ResetALLSubcriberExceptAPP = 0,
87  OSDKSubALLData = 1,
88 } HMSSubcribeCmd;
89 
90 typedef enum
91 {
92  OSDKSubSuccess = 0,
93 } HMSSubcribeStatus;
94 
97 class DJIHMS {
98 public:
99  DJIHMS(Vehicle *vehicle = 0);
100 
101  ~DJIHMS();
102 
122  bool subscribeHMSInf(bool enable, uint32_t timeOutMs = 500);
123 
129  std::string getHMSVersion();
130 
141 
151  uint8_t getDeviceIndex();
152 
153 private:
154  Vehicle *vehicle;
155  DJIHMSImpl *djiHMSImpl;
156 
166  bool enableListeningHmsData(bool enable);
167 };
168  }
169 }
170 #endif //ONBOARDSDK_DJI_HMS_H
struct DJI::OSDK::HMSPushPacket HMSPushPacket
bool subscribeHMSInf(bool enable, uint32_t timeOutMs=500)
Send subscribe request to your flight controller to get HMS(Health Management System)'s information,...
Definition: dji_hms.cpp:86
DJI health manager system of drone.
Definition: dji_hms.hpp:97
uint8_t getDeviceIndex()
The interface of getting device(camera or gimbal) index.
Definition: dji_hms.cpp:144
Definition: dji_hms.hpp:63
struct DJI::OSDK::ErrList ErrList
uint8_t sensorIndex
Definition: dji_hms.hpp:48
uint8_t msgIndex
Definition: dji_hms.hpp:57
Definition: dji_hms.hpp:53
uint8_t msgEnd
Definition: dji_hms.hpp:56
Definition: dji_hms.hpp:46
struct DJI::OSDK::HMSPushData HMSPushData
uint32_t timeStamp
Definition: dji_hms.hpp:66
Data type and Data Structure definitions for use throughout DJI OSDK.
uint8_t globalIndex
Definition: dji_hms.hpp:55
HMSPushPacket getHMSPushPacket()
The interface of getting HMS's pushing data which has a timestamp.
Definition: dji_hms.cpp:136
Definition: dji_ack.cpp:38
std::vector< ErrList > errList
Definition: dji_hms.hpp:58
std::string getHMSVersion()
The interface of getting hms version.
Definition: dji_hms.cpp:131
uint8_t reportLevel
Definition: dji_hms.hpp:49