Add extra info from serial (#1754)

* Inject GPS postition from serial
This commit is contained in:
Totoo
2024-01-11 17:46:35 +01:00
committed by GitHub
parent 49e719ded8
commit 831dbeaab5
6 changed files with 154 additions and 0 deletions

View File

@@ -118,6 +118,8 @@ class Message {
SubGhzFPRxConfigure = 60,
WeatherData = 61,
SubGhzDData = 62,
GPSPosData = 63,
OrientationData = 64,
MAX
};
@@ -1301,4 +1303,33 @@ class SubGhzDDataMessage : public Message {
uint64_t data = 0;
};
class GPSPosDataMessage : public Message {
public:
constexpr GPSPosDataMessage(
float lat = 200.0,
float lon = 200.0,
int32_t altitude = 0,
int32_t speed = 0)
: Message{ID::GPSPosData},
lat{lat},
lon{lon},
altitude{altitude},
speed{speed} {
}
float lat = 200.0;
float lon = 200.0;
int32_t altitude = 0;
int32_t speed = 0;
};
class OrientationDataMessage : public Message {
public:
constexpr OrientationDataMessage(
uint16_t angle = 400)
: Message{ID::OrientationData},
angle{angle} {
}
uint16_t angle = 400; //>360 -> no orientation set
};
#endif /*__MESSAGE_H__*/