From 3df2e11f2deb1ebbd5a04381a75e7ace14d6debe Mon Sep 17 00:00:00 2001 From: litinoveweedle <15144712+litinoveweedle@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:56:20 +0100 Subject: [PATCH 01/15] Create build.yml --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a1a1209 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: "Build" + +on: + push: + branches: + - "main" + tags: + - 'v*' + workflow_dispatch: +jobs: + release: + name: Release - ${{ matrix.platform.os-name }} + strategy: + fail-fast: false + matrix: + platform: + - os-name: Linux-x86_64 + runs-on: ubuntu-22.04 + target: x86_64-unknown-linux-musl + - os-name: Linux-arm + runs-on: ubuntu-22.04 + target: arm-unknown-linux-musleabihf + - os-name: Linux-arm + runs-on: ubuntu-22.04 + target: armv7-unknown-linux-musleabihf + - os-name: Linux-i686 + runs-on: ubuntu-22.04 + target: i686-unknown-linux-musl + - os-name: Linux-aarch64 + runs-on: ubuntu-22.04 + target: aarch64-unknown-linux-musl + runs-on: ${{ matrix.platform.runs-on }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libudev-dev + - name: Build binary + uses: houseabsolute/actions-rust-cross@v1 + with: + command: "build" + target: ${{ matrix.platform.target }} + args: "--locked --release" + strip: true + - name: Publish artifacts and release + uses: houseabsolute/actions-rust-release@v0 + with: + executable-name: taptap + target: ${{ matrix.platform.target }} From ab9f84b4b58661a81ef6ccb91ef03acc63934c3e Mon Sep 17 00:00:00 2001 From: litinoveweedle <15144712+litinoveweedle@users.noreply.github.com> Date: Fri, 7 Mar 2025 00:13:15 +0100 Subject: [PATCH 02/15] Update main.rs --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index f72c394..c433edb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,7 +53,7 @@ enum Commands { } #[derive(Args, Debug, Clone)] -#[group(required = true, multiple = false)] +#[group(required = true, multiple = true)] struct Source { /// The name of the serial port (try `taptap list-serial-ports`) #[arg(long, group = "mode", value_name = "SERIAL-PORT")] From bc992878ba78ed8fb5bd9b956795bc7aaf5d8b8c Mon Sep 17 00:00:00 2001 From: litinoveweedle <15144712+litinoveweedle@users.noreply.github.com> Date: Wed, 22 Oct 2025 22:53:52 +0200 Subject: [PATCH 03/15] Reconnect logic * implemented TCP keep alives * reconnect logic implementation * updated README for new features * read code de-duplication into function --- Cargo.lock | 17 ++- Cargo.toml | 1 + README.md | 28 ++-- src/config.rs | 39 +++++- src/gateway/physical/tcp.rs | 51 ++++++- src/gateway/transport.rs | 2 +- src/main.rs | 256 ++++++++++++++++++++++-------------- 7 files changed, 277 insertions(+), 117 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77d1006..d779e1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "adler" @@ -300,9 +300,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libudev" @@ -553,6 +553,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "strsim" version = "0.11.1" @@ -584,6 +594,7 @@ dependencies = [ "serde", "serde_json", "serialport", + "socket2", "thiserror", "zerocopy", ] diff --git a/Cargo.toml b/Cargo.toml index 6a5e22a..ad2d4df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ libc = "0.2.155" zerocopy = { version = "0.8.0-alpha.16", features = ["derive"] } flate2 = "1.0" log = "0.4.22" +socket2 = { version = "0.5.10", features = ["all"] } # Optional library features serialport = { version = "4.4", optional = true } diff --git a/README.md b/README.md index 35a206d..b1c690a 100644 --- a/README.md +++ b/README.md @@ -105,19 +105,29 @@ etc. It is a fast way to get started for some users, but consider wiring in a se ```console % taptap -Usage: taptap +Usage: taptap