scs-rs/scs_rs/README.md

22 lines
664 B
Markdown
Raw Normal View History

2023-04-30 20:47:50 +08:00
# 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
}
```