31 #include "pprzlink/messages.h"
32 #include "pprzlink/dl_protocol.h"
34 #if defined NAV || defined WIND_INFO
48 #define MOfMM(_x) (((float)(_x))/1000.)
52 uint8_t msg_id = IdOfPprzMsg(buf);
59 if (DL_BLOCK_ac_id(buf) != AC_ID) {
break; }
66 if (DL_MOVE_WP_ac_id(buf) != AC_ID) {
break; }
67 uint8_t wp_id = DL_MOVE_WP_wp_id(buf);
71 lla.
lat = RadOfDeg((
float)(DL_MOVE_WP_lat(buf) / 1e7));
72 lla.
lon = RadOfDeg((
float)(DL_MOVE_WP_lon(buf) / 1e7));
73 lla.
alt =
MOfMM(DL_MOVE_WP_alt(buf));
90 if (DL_WIND_INFO_ac_id(buf) != AC_ID) {
break; }
91 uint8_t flags = DL_WIND_INFO_flags(buf);
94 if (bit_is_set(flags, 0)) {
95 wind.
x = DL_WIND_INFO_north(buf);
96 wind.
y = DL_WIND_INFO_east(buf);
99 if (bit_is_set(flags, 1)) {
100 upwind = DL_WIND_INFO_up(buf);
104 if (bit_is_set(flags, 2)) {
110 pprz_msg_send_WIND_INFO_RET(trans,
dev, AC_ID, &flags, &wind.
y, &wind.
x, &upwind, &airspeed);
118 case DL_HITL_INFRARED: {
128 if (gps_msg_received) {
131 ubx_class = DL_HITL_UBX_class(buf);
132 ubx_id = DL_HITL_UBX_id(buf);
133 uint8_t l = DL_HITL_UBX_ubx_payload_length(buf);
134 uint8_t *ubx_payload = DL_HITL_UBX_ubx_payload(buf);
135 memcpy(ubx_msg_buf, ubx_payload, l);
136 gps_msg_received =
true;