use crate::data_messages::*;
use crate::ffi::helpers::*;
use std::os::raw::c_char;

// Start of code block #0 generated by x-IMU3-API/Rust/src/data_messages/generate_data_messages.py

#[no_mangle]
pub extern "C" fn XIMU3_inertial_message_to_string(message: InertialMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_magnetometer_message_to_string(message: MagnetometerMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_high_g_accelerometer_message_to_string(message: HighGAccelerometerMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_quaternion_message_to_string(message: QuaternionMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_rotation_matrix_message_to_string(message: RotationMatrixMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_euler_angles_message_to_string(message: EulerAnglesMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_linear_acceleration_message_to_string(message: LinearAccelerationMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_earth_acceleration_message_to_string(message: EarthAccelerationMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_ahrs_status_message_to_string(message: AhrsStatusMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_serial_accessory_message_to_string(message: SerialAccessoryMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_sync_message_to_string(message: SyncMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_ltc_message_to_string(message: LtcMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_temperature_message_to_string(message: TemperatureMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_battery_message_to_string(message: BatteryMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_rssi_message_to_string(message: RssiMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_button_message_to_string(message: ButtonMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_notification_message_to_string(message: NotificationMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

#[no_mangle]
pub extern "C" fn XIMU3_error_message_to_string(message: ErrorMessage) -> *const c_char {
    str_to_char_ptr(&message.to_string())
}

// End of code block #0 generated by x-IMU3-API/Rust/src/data_messages/generate_data_messages.py

#[no_mangle]
pub extern "C" fn XIMU3_quaternion_message_to_euler_angles_message(message: QuaternionMessage) -> EulerAnglesMessage {
    message.into()
}

#[no_mangle]
pub extern "C" fn XIMU3_rotation_matrix_message_to_euler_angles_message(message: RotationMatrixMessage) -> EulerAnglesMessage {
    message.into()
}

#[no_mangle]
pub extern "C" fn XIMU3_euler_angles_message_to_quaternion_message(message: EulerAnglesMessage) -> QuaternionMessage {
    message.into()
}