scs-rs/scs_rs/README.md

22 lines
No EOL
664 B
Markdown

# SCS SDK Bindings
## Usage Example
```rust
#[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
}
```