-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add serde feature implementation to able to serialize/deserialize
- Loading branch information
Showing
9 changed files
with
198 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 1,3 @@ | ||
{} | ||
{ | ||
"rust-analyzer.cargo.features": "all" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,31 @@ | ||
use mystic_light_sdk::MysticLightSDK; | ||
|
||
const LIB_PATH: &str = if cfg!(target_arch = "x86_64") { | ||
"../sdk/MysticLight_SDK_x64.dll" | ||
} else { | ||
"../sdk/MysticLight_SDK.dll" | ||
}; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let sdk = MysticLightSDK::new(LIB_PATH)?; | ||
|
||
let devices = sdk.get_devices()?; | ||
|
||
println!("devices json: {}", serde_json::to_string_pretty(&devices)?); | ||
|
||
let keyboard_leds = devices[2].leds()?; | ||
|
||
println!( | ||
"keyboard_leds json: {}", | ||
serde_json::to_string_pretty(&keyboard_leds)? | ||
); | ||
|
||
let state = keyboard_leds[0].get_state()?; | ||
|
||
println!( | ||
"Current device state json: {}", | ||
serde_json::to_string_pretty(&state)? | ||
); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.