|
@@ -144,6 +144,9 @@ void MAVLinkSerial::process_packet(mavlink_status_t &status, mavlink_message_t &
|
|
|
}
|
|
}
|
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION: {
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION: {
|
|
|
mavlink_msg_open_drone_id_location_decode(&msg, &location);
|
|
mavlink_msg_open_drone_id_location_decode(&msg, &location);
|
|
|
|
|
+ if (g.options & OPTIONS_PRINT_RID_MAVLINK) {
|
|
|
|
|
+ Serial.printf("MAVLink: got Location\n");
|
|
|
|
|
+ }
|
|
|
if (last_location_timestamp != location.timestamp) {
|
|
if (last_location_timestamp != location.timestamp) {
|
|
|
//only update the timestamp if we receive information with a different timestamp
|
|
//only update the timestamp if we receive information with a different timestamp
|
|
|
last_location_ms = millis();
|
|
last_location_ms = millis();
|
|
@@ -154,6 +157,9 @@ void MAVLinkSerial::process_packet(mavlink_status_t &status, mavlink_message_t &
|
|
|
}
|
|
}
|
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID: {
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID: {
|
|
|
mavlink_open_drone_id_basic_id_t basic_id_tmp;
|
|
mavlink_open_drone_id_basic_id_t basic_id_tmp;
|
|
|
|
|
+ if (g.options & OPTIONS_PRINT_RID_MAVLINK) {
|
|
|
|
|
+ Serial.printf("MAVLink: got BasicID\n");
|
|
|
|
|
+ }
|
|
|
mavlink_msg_open_drone_id_basic_id_decode(&msg, &basic_id_tmp);
|
|
mavlink_msg_open_drone_id_basic_id_decode(&msg, &basic_id_tmp);
|
|
|
if ((strlen((const char*) basic_id_tmp.uas_id) > 0) && (basic_id_tmp.id_type > 0) && (basic_id_tmp.id_type <= MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID)) {
|
|
if ((strlen((const char*) basic_id_tmp.uas_id) > 0) && (basic_id_tmp.id_type > 0) && (basic_id_tmp.id_type <= MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID)) {
|
|
|
//only update if we receive valid data
|
|
//only update if we receive valid data
|
|
@@ -164,15 +170,24 @@ void MAVLinkSerial::process_packet(mavlink_status_t &status, mavlink_message_t &
|
|
|
}
|
|
}
|
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION: {
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION: {
|
|
|
mavlink_msg_open_drone_id_authentication_decode(&msg, &authentication);
|
|
mavlink_msg_open_drone_id_authentication_decode(&msg, &authentication);
|
|
|
|
|
+ if (g.options & OPTIONS_PRINT_RID_MAVLINK) {
|
|
|
|
|
+ Serial.printf("MAVLink: got Auth\n");
|
|
|
|
|
+ }
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID: {
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID: {
|
|
|
mavlink_msg_open_drone_id_self_id_decode(&msg, &self_id);
|
|
mavlink_msg_open_drone_id_self_id_decode(&msg, &self_id);
|
|
|
|
|
+ if (g.options & OPTIONS_PRINT_RID_MAVLINK) {
|
|
|
|
|
+ Serial.printf("MAVLink: got SelfID\n");
|
|
|
|
|
+ }
|
|
|
last_self_id_ms = now_ms;
|
|
last_self_id_ms = now_ms;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM: {
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM: {
|
|
|
mavlink_msg_open_drone_id_system_decode(&msg, &system);
|
|
mavlink_msg_open_drone_id_system_decode(&msg, &system);
|
|
|
|
|
+ if (g.options & OPTIONS_PRINT_RID_MAVLINK) {
|
|
|
|
|
+ Serial.printf("MAVLink: got System\n");
|
|
|
|
|
+ }
|
|
|
if ((last_system_timestamp != system.timestamp) || (system.timestamp == 0)) {
|
|
if ((last_system_timestamp != system.timestamp) || (system.timestamp == 0)) {
|
|
|
//only update the timestamp if we receive information with a different timestamp
|
|
//only update the timestamp if we receive information with a different timestamp
|
|
|
last_system_ms = millis();
|
|
last_system_ms = millis();
|
|
@@ -181,6 +196,9 @@ void MAVLinkSerial::process_packet(mavlink_status_t &status, mavlink_message_t &
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE: {
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE: {
|
|
|
|
|
+ if (g.options & OPTIONS_PRINT_RID_MAVLINK) {
|
|
|
|
|
+ Serial.printf("MAVLink: got System update\n");
|
|
|
|
|
+ }
|
|
|
mavlink_open_drone_id_system_update_t pkt_system_update;
|
|
mavlink_open_drone_id_system_update_t pkt_system_update;
|
|
|
mavlink_msg_open_drone_id_system_update_decode(&msg, &pkt_system_update);
|
|
mavlink_msg_open_drone_id_system_update_decode(&msg, &pkt_system_update);
|
|
|
system.operator_latitude = pkt_system_update.operator_latitude;
|
|
system.operator_latitude = pkt_system_update.operator_latitude;
|
|
@@ -201,6 +219,9 @@ void MAVLinkSerial::process_packet(mavlink_status_t &status, mavlink_message_t &
|
|
|
}
|
|
}
|
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID: {
|
|
case MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID: {
|
|
|
mavlink_msg_open_drone_id_operator_id_decode(&msg, &operator_id);
|
|
mavlink_msg_open_drone_id_operator_id_decode(&msg, &operator_id);
|
|
|
|
|
+ if (g.options & OPTIONS_PRINT_RID_MAVLINK) {
|
|
|
|
|
+ Serial.printf("MAVLink: got OperatorID\n");
|
|
|
|
|
+ }
|
|
|
last_operator_id_ms = now_ms;
|
|
last_operator_id_ms = now_ms;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|