Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nikiforov-soft/ble-to-mqtt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.4
Choose a base ref
...
head repository: nikiforov-soft/ble-to-mqtt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 2,116 additions and 667 deletions.
  1. +0 −2 .env
  2. +17 −0 .env.dist
  3. +7 −7 .github/workflows/release-docker-ghcr.yml
  4. +5 −5 .github/workflows/release.yml
  5. +2 −2 .github/workflows/rust.yml
  6. +1 −0 .gitignore
  7. +1,782 −572 Cargo.lock
  8. +14 −15 Cargo.toml
  9. +1 −1 Dockerfile
  10. +35 −5 src/config.rs
  11. +124 −58 src/main.rs
  12. +58 −0 src/memphis.rs
  13. +63 −0 src/mqtt.rs
  14. +7 −0 src/publisher.rs
2 changes: 0 additions & 2 deletions .env

This file was deleted.

17 changes: 17 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
BLE_TO_MQTT_ENABLED=true
BLE_TO_MQTT_HOST=127.0.0.1
BLE_TO_MQTT_PORT=1883
BLE_TO_MQTT_USE_TLS_TRANSPORT=false
#BLE_TO_MQTT_USERNAME=
#BLE_TO_MQTT_PASSWORD=
BLE_TO_MQTT_CLIENT_ID=ble-to-mqtt-bridge
BLE_TO_MQTT_TOPIC=ble_events
BLE_TO_MQTT_TOPIC_QOS=0
BLE_TO_MQTT_KEEP_ALIVE_INTERVAL_SEC=10
#BLE_TO_MQTT_CLEAN_START=false
BLE_TO_MEMPHIS_ENABLED=false
BLE_TO_MEMPHIS_HOSTNAME=127.0.0.1:6666
BLE_TO_MEMPHIS_USERNAME=username
BLE_TO_MEMPHIS_PASSWORD=password
BLE_TO_MEMPHIS_STATION=ble-to-memphis
BLE_TO_MEMPHIS_PRODUCER_NAME=ble-to-memphis-bridge
14 changes: 7 additions & 7 deletions .github/workflows/release-docker-ghcr.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
PLATFORMS: linux/amd64,linux/arm64
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

jobs:
@@ -21,24 +21,24 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
@@ -52,7 +52,7 @@ jobs:
org.opencontainers.image.documentation="https://github.com/nikiforov-soft/ble-to-mqtt"
- name: Build and push image to GHCR
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: true
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -18,13 +18,13 @@ jobs:
target: [ x86_64-unknown-linux-gnu, x86_64-pc-windows-gnu, x86_64-apple-darwin, aarch64-apple-darwin ]
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Setup Rust"
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'x86_64-pc-windows-gnu' }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.68
toolchain: 1.80.0
target: ${{ matrix.target }}

- name: "Install dependencies (Linux)"
@@ -49,7 +49,7 @@ jobs:
-e CC=o64-clang \
-e CXX=o64-clang++ \
-e LIBZ_SYS_STATIC=1 \
joseluisq/rust-linux-darwin-builder:1.68.0 \
joseluisq/rust-linux-darwin-builder:1.79.0 \
sh -c "cargo build --release --target x86_64-apple-darwin"
- name: "Build target (macOS arm64)"
@@ -62,7 +62,7 @@ jobs:
-e CC=oa64-clang \
-e CXX=oa64-clang++ \
-e LIBZ_SYS_STATIC=1 \
joseluisq/rust-linux-darwin-builder:1.68.0 \
joseluisq/rust-linux-darwin-builder:1.79.0 \
sh -c "cargo build --release --target aarch64-apple-darwin"
- name: "Package"
@@ -73,7 +73,7 @@ jobs:
cd -
- name: "Publish"
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: '${{ github.event.repository.name }}-*'
env:
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -16,15 +16,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Install dependencies"
run: sudo apt update && sudo apt install -y libdbus-1-dev pkg-config

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.68
toolchain: 1.80.0

- name: Build
run: cargo build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
/target
.env
Loading