scs-rs/scs_rs
2023-04-30 20:48:42 +08:00
..
sdk@ac9c96e3bc move: sdk path 2023-04-30 20:12:11 +08:00
src add: proc macros 2023-04-30 19:48:01 +08:00
build.rs fix: build.rs add: readmes 2023-04-30 20:47:50 +08:00
Cargo.toml advance version 2023-04-30 20:48:42 +08:00
README.md fix: build.rs add: readmes 2023-04-30 20:47:50 +08:00
wrapper.hpp move: sdk path 2023-04-30 20:12:11 +08:00

SCS SDK Bindings

Usage Example

#[no_mangle]
#[scs_sdk_rs::proc_macros::scs_telemetry_init]
// pub extern "C" fn scs_telemetry_init(version: scs_sdk_rs::scs_u32_t, params: *const scs_sdk_rs::scs_telemetry_init_params_t) -> scs_sdk_rs::scs_result_t
pub fn init() {
    let version_params_ptr = params as *const scs_sdk_rs::scs_telemetry_init_params_v101_t;

    unsafe {
        // example for using params
        let version_params = *version_params_ptr;

        version_params.common.log.unwrap()(scs_sdk_rs::SCS_LOG_TYPE_message, "The Rust telemetry plugin is loaded.".as_ptr() as *const i8);
    }

    // ...

    scs_sdk_rs::SCS_RESULT_ok
}