static void print_one_field(mavlink_message_t *msg, const mavlink_field_info_t *f, int idx) { #define PRINT_FORMAT(f, def) (f->print_format?f->print_format:def) switch (f->type) { case MAVLINK_TYPE_CHAR: printf(PRINT_FORMAT(f, "%c"), _MAV_RETURN_char(msg, f->wire_offset+idx*1)); break; case MAVLINK_TYPE_UINT8_T: printf(PRINT_FORMAT(f, "%u"), _MAV_RETURN_uint8_t(msg, f->wire_offset+idx*1)); break; case MAVLINK_TYPE_INT8_T: printf(PRINT_FORMAT(f, "%d"), _MAV_RETURN_int8_t(msg, f->wire_offset+idx*1)); break; case MAVLINK_TYPE_UINT16_T: printf(PRINT_FORMAT(f, "%u"), _MAV_RETURN_uint16_t(msg, f->wire_offset+idx*2)); break; case MAVLINK_TYPE_INT16_T: printf(PRINT_FORMAT(f, "%d"), _MAV_RETURN_int16_t(msg, f->wire_offset+idx*2)); break; case MAVLINK_TYPE_UINT32_T: printf(PRINT_FORMAT(f, "%lu"), (unsigned long)_MAV_RETURN_uint32_t(msg, f->wire_offset+idx*4)); break; case MAVLINK_TYPE_INT32_T: printf(PRINT_FORMAT(f, "%ld"), (long)_MAV_RETURN_int32_t(msg, f->wire_offset+idx*4)); break; case MAVLINK_TYPE_UINT64_T: printf(PRINT_FORMAT(f, "%llu"), (unsigned long long)_MAV_RETURN_uint64_t(msg, f->wire_offset+idx*8)); break; case MAVLINK_TYPE_INT64_T: printf(PRINT_FORMAT(f, "%lld"), (long long)_MAV_RETURN_int64_t(msg, f->wire_offset+idx*8)); break; case MAVLINK_TYPE_FLOAT: printf(PRINT_FORMAT(f, "%f"), (double)_MAV_RETURN_float(msg, f->wire_offset+idx*4)); break; case MAVLINK_TYPE_DOUBLE: printf(PRINT_FORMAT(f, "%f"), _MAV_RETURN_double(msg, f->wire_offset+idx*8)); break; } }
/** * @brief Get field onboard_control_sensors_health from sys_status message * * @return Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR */ uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_health(const mavlink_message_t* msg) { return _MAV_RETURN_uint32_t(msg, 8); }