Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions twinleaf-tools/src/bin/tio-tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ fn get_rpctype(name: &String, device: &proxy::Port) -> String {

fn rpc(args: &[String]) -> Result<(), ()> {
let mut opts = tio_opts();
opts.parsing_style(getopts::ParsingStyle::StopAtFirstFree);
opts.optopt(
"t",
"req-type",
Expand Down Expand Up @@ -167,11 +168,11 @@ fn rpc(args: &[String]) -> Result<(), ()> {
"u8" => s.parse::<u8>().unwrap().to_le_bytes().to_vec(),
"u16" => s.parse::<u16>().unwrap().to_le_bytes().to_vec(),
"u32" => s.parse::<u32>().unwrap().to_le_bytes().to_vec(),
"u64" => s.parse::<u32>().unwrap().to_le_bytes().to_vec(),
"u64" => s.parse::<u64>().unwrap().to_le_bytes().to_vec(),
"i8" => s.parse::<i8>().unwrap().to_le_bytes().to_vec(),
"i16" => s.parse::<i16>().unwrap().to_le_bytes().to_vec(),
"i32" => s.parse::<i32>().unwrap().to_le_bytes().to_vec(),
"i64" => s.parse::<i32>().unwrap().to_le_bytes().to_vec(),
"i64" => s.parse::<i64>().unwrap().to_le_bytes().to_vec(),
"f32" => s.parse::<f32>().unwrap().to_le_bytes().to_vec(),
"f64" => s.parse::<f64>().unwrap().to_le_bytes().to_vec(),
"string" => s.as_bytes().to_vec(),
Expand Down Expand Up @@ -206,7 +207,7 @@ fn rpc(args: &[String]) -> Result<(), ()> {
let t = get_rpctype(&rpc_name, &device);
Some(if t == "" {
println!(
"Unknown RPC ret type, assuming 'string'. Use -T/--ret-type to override."
"Unknown RPC rep type, assuming 'string'. Use -T/--rep-type to override."
);
"string".to_string()
} else {
Expand Down
2 changes: 1 addition & 1 deletion twinleaf-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn tio_parseopts(opts: &Options, args: &[String]) -> (getopts::Matches, Stri
let root = if let Some(url) = matches.opt_str("r") {
url
} else {
"tcp://localhost".to_string()
util::default_proxy_url().to_string()
};
let route = if let Some(path) = matches.opt_str("s") {
DeviceRoute::from_str(&path).unwrap()
Expand Down