50 Commits

Author SHA1 Message Date
Konrad Dybcio b1237dc356 treewide: Migrate to russh
russh doesn't have the libsodium compilation issues on Windows that
ssh2 - migrate to it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
2025-11-07 15:27:10 +01:00
Konrad Dybcio c4d5473db3 client: Add README.md for crates.io 2024-06-22 03:32:40 +02:00
Konrad Dybcio 2fe2b77e8b client: Depend on versioned proto 2024-06-22 03:32:40 +02:00
Konrad Dybcio 83d7c4f1f6 proto: Add README.md for crates.io 2024-06-22 03:32:40 +02:00
Konrad Dybcio c367d3ee53 client/proto: allow publishing 2024-06-22 03:32:40 +02:00
Konrad Dybcio 7eaa496d5d README: now you can actually read me 2024-06-18 02:19:57 +02:00
Konrad Dybcio 5a9168b40f cli: Add a non-interactive control utility
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-06-18 00:56:53 +02:00
Konrad Dybcio b0b60406e3 treewide: Move things around
More binaries inbound

Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-06-18 00:56:53 +02:00
Konrad Dybcio 42730503b4 src/main: Abstract SSH-specific code
There are other cool protocols in the wild

Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-06-18 00:56:53 +02:00
Konrad Dybcio e9eefd21e6 Cargo.lock: cargo update
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-06-18 00:56:53 +02:00
Konrad Dybcio 859bddb5f8 main+lib: Clean up macros further
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio ce1145c373 Cargo.lock: cargo update
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio 89689ec128 Cargo.toml: Set BSD3
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio 39099057e2 main+lib: Implement almost all special keys
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio c41df0a744 main+lib: Allow for interrupting image sending
This could probably be generalized to all messages, but apart from
this one, I think it would only make sense to also handle this for
cases where the user pastes 1.5GiB of plaintext into MsgConsole, but
then stdin is clogged up and there's no signals, so CTRL+A would wait
for its turn anyway..

Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio 883752dfe7 main: Stop the write(ln)!(stdout()..) craziness
stop the crossterm docs propaganda and flush stdout where ncessary

Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio 3e6ce0127e main: Replace LF with CRLF for server status updates
These can apparently be handled too slow (because the stdin handler
thread takes its sweet time to spin up?), and receiving e.g. the
hello message ("Starting cdba server") and some warning (like
"cdba-server: Please switch to yaml config for ftdi_gpio configuration")
separated with a single LF char on the server side ends up with a
janky printout.

This is not ideal, but I suppose acking of the server status updates
could be introduced in a future update..

Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio 5bf2dcc137 lib: Use greentext to signify send_image progress
not to be confused with 4chan memes

Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio 143159b868 main+lib: Locky lock, implement console writing
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
2024-05-21 23:05:03 +02:00
Konrad Dybcio 90e7bfd69e main: Add some context to early returns
Suggested-by: Marijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
2024-05-06 23:44:14 +02:00
Dmitry Baryshkov c9644fd423 main: get rid of unwrap()
Replace .unwrap() with the question-mark returns. The main function can
only choke on the std::io::Error, so it's simple to return this kind of
errors.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov dfe093c804 lib: drop unwrap() from send_msg()
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov e901247cd2 lib: use write! to send image percentage
Use write! instead of writeln! to remove extra linewraps.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov f49bcf417f main: simplify buffer handling
Use temporary mutable slice to reference a part of the buffer that is
used for the data.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-05-06 22:55:02 +02:00
Dmitry Baryshkov b50f910fb5 lib: print_string_msg: drop length argument
There is no need to pass addtional buffer size, use slice length
instead.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-05-06 22:55:02 +02:00