void mf_daq_send_report(void) { // Send report over normal telemetry if (mf_daq.nb > 0) { DOWNLINK_SEND_PAYLOAD_FLOAT(DefaultChannel, DefaultDevice, 9, mf_daq.values); } // Test if log is started if (pprzLogFile != -1) { if (log_started == FALSE) { // Log MD5SUM once DOWNLINK_SEND_ALIVE(pprzlog_tp, chibios_sdlog, 16, MD5SUM); log_started = true; } // Log GPS for time reference uint8_t foo = 0; int16_t climb = -gps.ned_vel.z; int16_t course = (DegOfRad(gps.course) / ((int32_t)1e6)); struct UtmCoor_f utm = *stateGetPositionUtm_f(); int32_t east = utm.east * 100; int32_t north = utm.north * 100; DOWNLINK_SEND_GPS(pprzlog_tp, chibios_sdlog, &gps.fix, &east, &north, &course, &gps.hmsl, &gps.gspeed, &climb, &gps.week, &gps.tow, &utm.zone, &foo); } }
/**Send by downlink the GPS and rad_of_ir messages with \a DOWNLINK_SEND_GPS * and \a DOWNLINK_SEND_RAD_OF_IR \n * If \a estimator_flight_time is null and \a estimator_hspeed_mod is greater * than \a MIN_SPEED_FOR_TAKEOFF, set the \a estimator_flight_time to 1 and \a * launch to true (which is not set in non auto launch. Then call * \a DOWNLINK_SEND_TAKEOFF */ void use_gps_pos( void ) { if (GpsFixValid()) { last_gps_msg_t = cpu_time_sec; estimator_update_state_gps(); } DOWNLINK_SEND_GPS(&gps_mode, &gps_utm_east, &gps_utm_north, &gps_course, &gps_alt, &gps_gspeed,&gps_climb, &gps_itow, &gps_utm_zone, &gps_nb_ovrn); static uint8_t i; if (i == gps_nb_channels) i = 0; if (i < gps_nb_channels && gps_svinfos[i].cno > 0) DOWNLINK_SEND_SVINFO(&i, &gps_svinfos[i].svid, &gps_svinfos[i].flags, &gps_svinfos[i].qi, &gps_svinfos[i].cno, &gps_svinfos[i].elev, &gps_svinfos[i].azim); i++; }