-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from vpetrigo/sntpc-30
Add `no_std` networking primitives for end users
- Loading branch information
Showing
24 changed files
with
607 additions
and
228 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[profile.no-std] | ||
inherits = "dev" | ||
panic = "abort" |
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
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,60 +1,4 @@ | ||
[package] | ||
name = "sntpc" | ||
version = "0.3.9" | ||
description = "Library for making SNTP requests" | ||
homepage = "https://github.com/vpetrigo/sntpc" | ||
repository = "https://github.com/vpetrigo/sntpc" | ||
documentation = "https://docs.rs/sntpc" | ||
readme = "README.md" | ||
categories = ["date-and-time", "no-std", "embedded", "asynchronous"] | ||
keywords = ["sntp", "ntp", "sntp-client", "ntp-client"] | ||
license = "BSD-3-Clause" | ||
authors = ["Vladimir Petrigo <[email protected]>"] | ||
edition = "2018" | ||
autoexamples = false | ||
|
||
exclude = [ | ||
".github/*", | ||
"CONTRIBUTING.md", | ||
".*", | ||
] | ||
|
||
[features] | ||
default = ["std"] | ||
std = [] | ||
utils = ["std", "chrono/clock"] | ||
async = [] | ||
async_tokio = ["std", "async", "tokio", "async-trait"] | ||
|
||
[dependencies] | ||
log = { version = "~0.4", optional = true } | ||
chrono = { version = "~0.4", default-features = false, optional = true } | ||
# requred till this https://github.com/rust-lang/rfcs/pull/2832 is not addressed | ||
no-std-net = "~0.6" | ||
|
||
async-trait = { version = "0.1", optional = true } | ||
tokio = { version = "1", features = ["full"], optional = true } | ||
|
||
[dev-dependencies] | ||
simple_logger = { version = "~1.13" } | ||
smoltcp = { version = "~0.9", default-features = false, features = ["phy-tuntap_interface", "socket-udp", "proto-ipv4"] } | ||
clap = { version = "2.33", default-features = false } | ||
|
||
[badges] | ||
maintenance = { status = "actively-developed" } | ||
|
||
[[example]] | ||
name = "simple_request" | ||
required-features = ["std"] | ||
|
||
[[example]] | ||
name = "timesync" | ||
required-features = ["utils"] | ||
|
||
[[example]] | ||
name = "smoltcp_request" | ||
required-features = ["std"] | ||
|
||
[[example]] | ||
name = "tokio" | ||
required-features = ["async_tokio"] | ||
[workspace] | ||
members = ["sntpc", "examples/*"] | ||
default-members = ["sntpc"] | ||
resolver = "2" |
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
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,9 @@ | ||
[package] | ||
name = "example-simple-no-std" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
[dependencies] | ||
sntpc = { path = "../../sntpc", default-features = false, features = ["async"] } | ||
yash-executor = { version = "1.0.0", default-features = false } |
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,7 @@ | ||
fn main() { | ||
if cfg!(target_os = "linux") { | ||
println!("cargo::rustc-link-arg=-nostartfiles"); | ||
println!("cargo::rustc-link-arg=-lc"); | ||
} | ||
println!("cargo::rerun-if-changed=build.rs"); | ||
} |
Oops, something went wrong.