- blobmsg_add_string(&b, "latitude", latitude);
- blobmsg_add_string(&b, "longitude", longitude);
- blobmsg_add_string(&b, "elevation", elevation);
- blobmsg_add_string(&b, "course", course);
- blobmsg_add_string(&b, "speed", speed);
+ if (gps_fields & GPS_FIELD_LAT)
+ blobmsg_add_string(&b, "latitude", latitude);
+ if (gps_fields & GPS_FIELD_LON)
+ blobmsg_add_string(&b, "longitude", longitude);
+ if (gps_fields & GPS_FIELD_ALT)
+ blobmsg_add_string(&b, "elevation", elevation);
+ if (gps_fields & GPS_FIELD_COG)
+ blobmsg_add_string(&b, "course", course);
+ if (gps_fields & GPS_FIELD_SPD)
+ blobmsg_add_string(&b, "speed", speed);