Appearance
HAP Rust SDK 文档
Rust client SDK for HAP.
Setup
- Download your Rust SDK from HAP Console
- Extract the zip to your project directory
- Run
cargo add --path ./hap
under your project
Usage
rust
fn main() {
if !hap::init("127.0.0.1", 16000, hap::ClientVersion::new(1, 0, 0, 0)) {
panic!("init failed");
}
match hap::login("HAPxxxxx") {
Ok(_) => println!("login success"),
Err(e) => println!("login failed: {}", e),
}
println!("cloud_function: {:?}", hap::cloud_function("test"));
}
可联系客服了解详情。