Skip to content

Commit

Permalink
Add support for PPP mode (#81)
Browse files Browse the repository at this point in the history
* Simplify initialization of both ppp mode and ublox mode, by providing batteries included new functions that sets up ATAT and all related resources

* Refactor async completely for a more intuitive API. URCs over PPP UDP socket is still not working properly

* Bump embassy-sync to 0.6

* Fix internal-network-stack compiling

* Rework runner, add Proxy client and add working Control handle

* Working control handle for connect and disconnect, with ppp udp bridge

* Add a large number of convenience functions to Control and cleanup runner patterns
  • Loading branch information
MathiasKoch authored Jul 16, 2024
1 parent 8ab1612 commit 67807ba
Show file tree
Hide file tree
Showing 67 changed files with 2,404 additions and 4,170 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/audit.yml

This file was deleted.

61 changes: 29 additions & 32 deletions .github/workflows/lint.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: CI

on:
push:
Expand All @@ -10,9 +10,6 @@ defaults:
run:
shell: bash

env:
CLIPPY_PARAMS: -W clippy::all -W clippy::pedantic -W clippy::nursery -W clippy::cargo

jobs:
rustfmt:
name: rustfmt
Expand All @@ -35,33 +32,6 @@ jobs:
command: fmt
args: --all -- --check --verbose

# tomlfmt:
# name: tomlfmt
# runs-on: ubuntu-latest
# steps:
# - name: Checkout source code
# uses: actions/checkout@v2

# - name: Install Rust
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: nightly
# override: true

# - name: Install tomlfmt
# uses: actions-rs/install@v0.1
# with:
# crate: cargo-tomlfmt
# version: latest
# use-tool-cache: true

# - name: Run Tomlfmt
# uses: actions-rs/cargo@v1
# with:
# command: tomlfmt
# args: --dryrun

clippy:
name: clippy
runs-on: ubuntu-latest
Expand All @@ -81,4 +51,31 @@ jobs:
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- ${{ env.CLIPPY_PARAMS }}
args: --features odin-w2xx,ppp

test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7m-none-eabi
override: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all --target thumbv7m-none-eabi --features odin-w2xx,ppp

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --lib --features odin-w2xx,ppp
47 changes: 0 additions & 47 deletions .github/workflows/docs.yml

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/grcov.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/test.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"rust-analyzer.cargo.target": "thumbv6m-none-eabi",
"rust-analyzer.check.allTargets": false,
"rust-analyzer.linkedProjects": [],
"rust-analyzer.cargo.features": [
"odin-w2xx",
// "internal-network-stack"
"ppp"
],
"rust-analyzer.server.extraEnv": {
"WIFI_NETWORK": "foo",
"WIFI_PASSWORD": "foo",
Expand Down
71 changes: 38 additions & 33 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,62 +15,66 @@ name = "ublox_short_range"
doctest = false

[dependencies]
atat = { version = "0.21", features = ["derive", "bytes"] }
# atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "70283be", features = ["derive", "defmt", "bytes"] }
atat = { version = "0.23", features = ["derive", "bytes"] }

heapless = { version = "^0.8", features = ["serde"] }
no-std-net = { version = "0.6", features = ["serde"] }
serde = { version = "^1", default-features = false, features = ["derive"] }
# ublox-sockets = { version = "0.5", features = ["edm"], optional = true }
ublox-sockets = { git = "https://github.com/BlackbirdHQ/ublox-sockets", rev = "9f7fe54", features = ["edm"], optional = true }
postcard = "1.0.4"
portable-atomic = "1.5"
# ublox-sockets = { version = "0.5", optional = true }
ublox-sockets = { git = "https://github.com/BlackbirdHQ/ublox-sockets", rev = "9f7fe54", optional = true }
portable-atomic = "1.6"

defmt = { version = "0.3", optional = true }
log = { version = "0.4.14", optional = true }
log = { version = "^0.4", default-features = false, optional = true }
defmt = { version = "^0.3", optional = true }

embedded-hal = "1.0"
embassy-time = "0.3"
embassy-sync = "0.5"
embassy-sync = "0.6"
embassy-futures = "0.1"
embassy-net-driver = "0.2"

embedded-nal-async = { version = "0.7" }
futures = { version = "0.3.17", default-features = false, features = [
"async-await",
] }
futures-util = { version = "0.3.29", default-features = false }

embedded-io = "0.6"
embedded-io-async = "0.6"

embassy-net-ppp = { version = "0.1", optional = true }
embassy-net = { version = "0.4", features = [
"proto-ipv4",
"medium-ip",
], optional = true }


[features]
default = ["odin_w2xx", "ublox-sockets", "socket-tcp", "socket-udp"]
default = ["socket-tcp", "socket-udp"]

internal-network-stack = ["dep:ublox-sockets", "edm"]
edm = ["ublox-sockets?/edm"]

ipv6 = ["embassy-net?/proto-ipv6"]

std = []
# PPP mode requires UDP sockets enabled, to be able to do AT commands over UDP port 23
ppp = ["dep:embassy-net-ppp", "dep:embassy-net", "socket-udp"]

socket-tcp = ["ublox-sockets?/socket-tcp", "embassy-net?/tcp"]
socket-udp = ["ublox-sockets?/socket-udp", "embassy-net?/udp"]

defmt = [
"dep:defmt",
"postcard/use-defmt",
"heapless/defmt-03",
"atat/defmt",
"ublox-sockets?/defmt",
"embassy-net-ppp?/defmt",
"embassy-net?/defmt",
]
log = ["dep:log", "ublox-sockets?/log", "atat/log"]

odin_w2xx = []
nina_w1xx = []
nina_b1xx = []
anna_b1xx = []
nina_b2xx = []
nina_b3xx = []

socket-tcp = [
"ublox-sockets?/socket-tcp",
# "smoltcp?/socket-tcp"
]
socket-udp = [
"ublox-sockets?/socket-udp",
# "smoltcp?/socket-udp"
]
# Supported Ublox modules
odin-w2xx = []
nina-w1xx = []
nina-b1xx = []
anna-b1xx = []
nina-b2xx = []
nina-b3xx = []

[workspace]
members = []
Expand All @@ -80,4 +84,5 @@ exclude = ["examples"]

[patch.crates-io]
no-std-net = { git = "https://github.com/rushmorem/no-std-net", branch = "issue-15" }
atat = { path = "../atat/atat" }
atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "a466836" }
# atat = { path = "../atat/atat" }
1 change: 0 additions & 1 deletion Design_diagram.drawio

This file was deleted.

Binary file removed Design_diagram.png
Binary file not shown.
Loading

0 comments on commit 67807ba

Please sign in to comment.