-
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.
- Loading branch information
1 parent
02d6fae
commit 131fca5
Showing
7 changed files
with
310 additions
and
93 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Folder-specific settings | ||
// | ||
// For a full list of overridable settings, and general information on folder-specific settings, | ||
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files | ||
{ | ||
"lsp": { | ||
"rust-analyzer": { | ||
"cargo": { | ||
"features": "all" | ||
} | ||
} | ||
} | ||
} |
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,20 @@ | ||
use std::io::Cursor; | ||
|
||
use nom_teltonika::TeltonikaStream; | ||
|
||
fn main() { | ||
// Write getinfo command to the device | ||
let mut stream = TeltonikaStream::new(Cursor::new(Vec::new())); | ||
stream.write_command("getinfo").expect("Write failed"); | ||
let mut buffer = stream.into_inner().into_inner(); | ||
|
||
// Compare with actual buffer that should be sent | ||
let cmp = hex::decode("000000000000000F0C010500000007676574696E666F0100004312").unwrap(); | ||
assert_eq!(cmp, buffer); | ||
|
||
// Read back as if it was a response | ||
buffer = hex::decode("000000000000000F0C010600000007676574696E666F0100008017").unwrap(); | ||
stream = TeltonikaStream::new(Cursor::new(buffer)); | ||
let frame = stream.read_frame().unwrap().unwrap_gprs(); | ||
println!("{frame:#?}"); | ||
} |
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.