-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(*): Full async implementation (#82)
* initial commit - tests not working * Initial work on async client * Working async network management & TCP socket stack * Attempt to rid channel * Working dns + tcp at 11/6kbps * Add performance testing example * Comment out UartExt trait * Update to latest embassy and embedded-io 0.5 * Update dependencies and fix tests * Add TlsSocket * Fix clippy warnings * Fix TlsSocket and module restart with EDM * Reduce stack usage from holding large resources across await points * Correctly handle closing a dropped socket in FinWait1 state * Add support for PPP mode (#81) * 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 * Fix defmt feature gating --------- Co-authored-by: unizippro <[email protected]>
- Loading branch information
1 parent
2d83219
commit 005bcd8
Showing
90 changed files
with
6,078 additions
and
3,293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,81 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
name: CI | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
test: | ||
name: Build & Test | ||
rustfmt: | ||
name: rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
- uses: dsherret/rust-toolchain-file@v1 | ||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
command: build | ||
args: --all --target thumbv7em-none-eabihf | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt | ||
|
||
- name: Test | ||
- name: Run rustfmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --lib | ||
env: | ||
DEFMT_LOG: off | ||
|
||
rustfmt: | ||
name: rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
- uses: dsherret/rust-toolchain-file@v1 | ||
- name: Rustfmt | ||
run: cargo fmt -- --check | ||
command: fmt | ||
args: --all -- --check --verbose | ||
|
||
clippy: | ||
name: clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
- uses: dsherret/rust-toolchain-file@v1 | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: clippy | ||
|
||
- name: Run clippy | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ | |
*.fifo | ||
target/ | ||
*.o | ||
.vscode | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. | ||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp | ||
// List of extensions which should be recommended for users of this workspace. | ||
"recommendations": [ | ||
"rust-lang.rust-analyzer", | ||
"tamasfe.even-better-toml", | ||
], | ||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. | ||
"unwantedRecommendations": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"[toml]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"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", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,88 @@ | ||
[package] | ||
name = "ublox-short-range-rs" | ||
version = "0.1.1" | ||
authors = ["Mads Andresen <[email protected]>"] | ||
description = "Driver crate for u-blox short range devices, implementation follows 'UBX-14044127 - R40'" | ||
readme = "../README.md" | ||
keywords = ["ublox", "wifi", "shortrange", "bluetooth"] | ||
categories = ["embedded", "no-std"] | ||
license = "MIT OR Apache-2.0" | ||
repository = "https://github.com/BlackbirdHQ/ublox-short-range-rs" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "ublox_short_range" | ||
doctest = false | ||
|
||
[dependencies] | ||
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", optional = true } | ||
ublox-sockets = { git = "https://github.com/BlackbirdHQ/ublox-sockets", rev = "9f7fe54", optional = true } | ||
portable-atomic = "1.6" | ||
|
||
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.6" | ||
embassy-futures = "0.1" | ||
|
||
embedded-nal-async = { version = "0.7" } | ||
futures-util = { version = "0.3.29", default-features = false } | ||
|
||
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 = ["socket-tcp", "socket-udp"] | ||
|
||
internal-network-stack = ["dep:ublox-sockets", "edm"] | ||
edm = ["ublox-sockets?/edm"] | ||
|
||
ipv6 = ["embassy-net?/proto-ipv6"] | ||
|
||
# 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", | ||
"heapless/defmt-03", | ||
"atat/defmt", | ||
"ublox-sockets?/defmt", | ||
"embassy-net-ppp?/defmt", | ||
"embassy-net?/defmt", | ||
] | ||
log = ["dep:log", "ublox-sockets?/log", "atat/log"] | ||
|
||
# Supported Ublox modules | ||
odin-w2xx = [] | ||
nina-w1xx = [] | ||
nina-b1xx = [] | ||
anna-b1xx = [] | ||
nina-b2xx = [] | ||
nina-b3xx = [] | ||
|
||
[workspace] | ||
resolver = "2" | ||
members = [ "ublox-short-range" ] | ||
members = [] | ||
default-members = ["."] | ||
exclude = ["examples"] | ||
|
||
|
||
[patch.crates-io] | ||
atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "c5caaf7" } | ||
no-std-net = { git = "https://github.com/rushmorem/no-std-net", branch = "issue-15" } | ||
atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "a466836" } | ||
# atat = { path = "../atat/atat" } |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.