Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ homepage = "https://nRF24.github.io/rf24-rs"
edition = "2021"
license = "MIT"

[workspace.dependencies]
linux-embedded-hal = { version = "0.5.0", default-features = false, features = ["gpio_cdev", "spi"] }
nix = "0.31.3"
bitfield-struct = "0.9.5"

[profile.release]
lto = true
strip = "symbols"
12 changes: 6 additions & 6 deletions bindings/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ version = "0.3.3"
repository.workspace = true
edition.workspace = true
license.workspace = true
rust-version = "1.80"
rust-version = "1.88"

[lib]
crate-type = ["cdylib"]

[dependencies]
embedded-hal = "1.0.0"
# Default `napi` features: see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = "3.1.3"
napi-derive = "3.1.1"
napi = "3.12.2"
napi-derive = "3.6.3"
rf24-rs = { path = "../../crates/rf24-rs", features = ["std"] }
rf24ble-rs = { path = "../../crates/rf24ble-rs", features = ["std"] }

[build-dependencies]
napi-build = "2.2.3"
napi-build = "2.4.1"

[target.'cfg(target_os = "linux")'.dependencies]
linux-embedded-hal = {version = "0.4.0", default-features = false, features = ["gpio_cdev", "spi"]}
nix = { version = "0.30.1", features = ["time"]}
linux-embedded-hal.workspace = true
nix = { workspace = true, features = ["time"] }
6 changes: 3 additions & 3 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ crate-type = ["cdylib"]

[dependencies]
embedded-hal = "1.0.0"
pyo3 = {version = "0.26.0", features = ["extension-module", "abi3-py39"]}
pyo3 = {version = "0.29.2", features = ["extension-module", "abi3-py39"]}
rf24-rs = { path = "../../crates/rf24-rs", features = ["std"]}
rf24ble-rs = { path = "../../crates/rf24ble-rs", features = ["std"] }

[target.'cfg(target_os = "linux")'.dependencies]
linux-embedded-hal = {version = "0.4.0", default-features = false, features = ["gpio_cdev", "spi"]}
nix = { version = "0.30.1", features = ["time"]}
linux-embedded-hal.workspace = true
nix = { workspace = true, features = ["time"] }
1 change: 0 additions & 1 deletion bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ uv sync
```

Append `--no-dev` (or set `UV_NO_DEV=1` environment variable) for environments with limited disk space (eg. Raspberry Pi machine).
As of [uv] v0.8.7, the environment variable

[uv]: https://docs.astral.sh/uv

Expand Down
6 changes: 3 additions & 3 deletions bindings/python/src/fake_ble/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use pyo3::prelude::*;
///
/// Conforms to Battery Level format as defined in
/// [GATT Specifications Supplement](https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=502132&vId=542989).
#[pyclass(module = "rf24_py")]
#[pyclass(module = "rf24_py", from_py_object)]
#[derive(Debug, Clone, Copy)]
pub struct BatteryService {
inner: rf24ble::services::BatteryService,
Expand Down Expand Up @@ -45,7 +45,7 @@ impl BatteryService {
///
/// Conforms to the Health Thermometer Measurement format as defined in
/// [GATT Specifications Supplement](https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=502132&vId=542989).
#[pyclass(module = "rf24_py")]
#[pyclass(module = "rf24_py", from_py_object)]
#[derive(Debug, Clone, Copy)]
pub struct TemperatureService {
inner: rf24ble::services::TemperatureService,
Expand Down Expand Up @@ -83,7 +83,7 @@ impl TemperatureService {
/// Conforms to specifications defined by [Google's EddyStone][eddystone] data format.
///
/// [eddystone]: https://github.com/google/eddystone
#[pyclass(module = "rf24_py")]
#[pyclass(module = "rf24_py", from_py_object)]
#[derive(Debug, Clone, Copy)]
pub struct UrlService {
inner: rf24ble::services::UrlService,
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/radio/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use std::borrow::Cow;
///
/// [^1]: The RX address default value is the same as pipe 0 default TX address.
/// [^2]: Remember, pipes 2 - 5 share the same 4 LSBytes as the address on pipe 1.
#[pyclass(module = "rf24_py")]
#[pyclass(module = "rf24_py", from_py_object)]
#[derive(Debug, Clone, Copy)]
pub struct RadioConfig {
inner: rf24::radio::RadioConfig,
Expand Down
11 changes: 6 additions & 5 deletions bindings/python/src/radio/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use pyo3::prelude::*;
/// - [`RF24.set_status_flags()`][rf24_py.RF24.set_status_flags]
/// - [`RF24.clear_status_flags()`][rf24_py.RF24.clear_status_flags]
/// - [`RF24.update()`][rf24_py.RF24.update]
#[pyclass(frozen, get_all, module = "rf24_py")]
#[pyclass(frozen, get_all, module = "rf24_py", from_py_object)]
#[derive(Default, Clone)]
pub struct StatusFlags {
/// A flag to describe if RX Data Ready to read.
Expand Down Expand Up @@ -78,7 +78,7 @@ impl StatusFlags {
/// | nRF24L01 | Si24R1 with<br>LNA Enabled | Si24R1 with<br>LNA Disabled |
/// | :-------:|:--------------------------:|:---------------------------:|
/// | 0 dBm | 7 dBm | 4 dBm |
#[pyclass(eq, eq_int, module = "rf24_py")]
#[pyclass(eq, eq_int, module = "rf24_py", from_py_object)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PaLevel {
Min,
Expand Down Expand Up @@ -112,7 +112,7 @@ impl PaLevel {
/// Mbps1: Represents 1 Mbps
/// Mbps2: Represents 2 Mbps
/// Kbps250: Represents 250 Kbps
#[pyclass(eq, eq_int, module = "rf24_py")]
#[pyclass(eq, eq_int, module = "rf24_py", from_py_object)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DataRate {
Mbps1,
Expand Down Expand Up @@ -145,7 +145,7 @@ impl DataRate {
/// Disabled: Represents no CRC checksum is used.
/// Bit8: Represents CRC 8 bit checksum is used.
/// Bit16: Represents CRC 16 bit checksum is used.
#[pyclass(name = "CrcLength", eq, eq_int, module = "rf24_py")]
#[pyclass(name = "CrcLength", eq, eq_int, module = "rf24_py", from_py_object)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CrcLength {
Disabled,
Expand Down Expand Up @@ -179,14 +179,15 @@ impl CrcLength {
/// Full: Represent the state of a FIFO when it is full.
/// Empty: Represent the state of a FIFO when it is empty.
/// Occupied: Represent the state of a FIFO when it is not full but not empty either.
#[pyclass(eq, eq_int, module = "rf24_py")]
#[pyclass(eq, eq_int, module = "rf24_py", from_py_object)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FifoState {
Full,
Empty,
Occupied,
}

#[cfg(target_os = "linux")]
impl FifoState {
pub fn into_inner(self) -> rf24::FifoState {
match self {
Expand Down
4 changes: 2 additions & 2 deletions crates/rf24-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ homepage.workspace = true
exclude = [".github/", "codecov.yml", "docs", "examples"]
keywords = ["nrf24l01", "wireless", "transceiver", "embedded", "RF24"]
categories = ["embedded", "no-std"]
rust-version = "1.65"
rust-version = "1.68"

[lib]
name = "rf24"

[dependencies]
bitfield-struct = "0.9.5"
bitfield-struct.workspace = true
defmt = {version = "1.0.1", optional = true}
embedded-hal = "1.0.0"

Expand Down
6 changes: 3 additions & 3 deletions crates/rf24ble-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ license.workspace = true
exclude = [".github/", "codecov.yml", "docs", "examples"]
keywords = ["nrf24l01", "wireless", "transceiver", "embedded", "BLE"]
categories = ["embedded", "no-std"]
rust-version = "1.65"
rust-version = "1.68"

[lib]
name = "rf24ble"

[dependencies]
rf24-rs = { path = "../rf24-rs", version = "0.3.1" }
bitfield-struct = "0.9.5"
bitfield-struct.workspace = true
embedded-hal = "1.0.0"

[dev-dependencies]
embedded-hal-mock = "0.11.1"
embedded-hal-mock = {git = "https://github.com/2bndy5/embedded-hal-mock.git", branch = "dev"}

[features]
std = []
Expand Down
4 changes: 2 additions & 2 deletions examples/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ name = "rf24_rs_examples"
rf24-rs = {path = "../../crates/rf24-rs", version = "0.3.1"}
rf24ble-rs = {path = "../../crates/rf24ble-rs", version = "0.1.4"}
embedded-hal = "1.0.0"
anyhow = {version = "1.0.98", default-features = false}
linux-embedded-hal = {version = "0.4.0", optional = true, default-features = false, features = ["gpio_cdev", "spi"]}
anyhow = {version = "1.0.100", default-features = false}
linux-embedded-hal = {workspace = true, optional = true, default-features = false, features = ["gpio_cdev", "spi"]}

[features]
default = ["linux"]
Expand Down
Loading