Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated openssl, fixed linux-gnu building issue #120

Merged
merged 1 commit into from
Jul 23, 2024
Merged
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
38 changes: 29 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/bluetooth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ edition = "2021"
log = "0.4"
tokio = { version = "1", features = ["io-util", "sync"] }
enumflags2 = "0.7"
nix = { version = "0.29.0", features = ["ioctl"] }

[target.'cfg(target_os = "macos")'.dependencies]
core_bluetooth = "0.1"

[target.'cfg(target_os = "linux")'.dependencies]
libc = "0.2"
nix = "0.29.0"

[build-dependencies]
pkg-config = "*"
16 changes: 13 additions & 3 deletions lib/bluetooth/src/os/linux/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use libc::{c_char, c_int, c_uint};
use libc::{c_char, c_int, c_uint, c_ulong};
use nix::request_code_write;

pub const HCI_MAX_EVENT_SIZE: c_int = 260;

Expand Down Expand Up @@ -30,7 +31,16 @@ const fn _iow<T>(r#type: c_char, nr: c_int) -> c_int {
_ioc(_IOC_WRITE, r#type, nr, std::mem::size_of::<T>())
}

pub const HCIDEVUP: c_int = _iow::<c_int>(b'H' as c_char, 201);
pub const HCIDEVDOWN: c_int = _iow::<c_int>(b'H' as c_char, 202);
#[cfg(not(target_env = "musl"))]
pub const HCIDEVUP: c_ulong = request_code_write!(b'H', 201, std::mem::size_of::<c_int>());

#[cfg(target_env = "musl")]
pub const HCIDEVUP: c_int = request_code_write!(b'H', 201, std::mem::size_of::<c_int>());

#[cfg(not(target_env = "musl"))]
pub const HCIDEVDOWN: c_ulong = request_code_write!(b'H', 202, std::mem::size_of::<c_int>());

#[cfg(target_env = "musl")]
pub const HCIDEVDOWN: c_int = request_code_write!(b'H', 202, std::mem::size_of::<c_int>());

pub const EVT_LE_ADVERTISING_REPORT: u8 = 0x02;
2 changes: 1 addition & 1 deletion lib/xiaomi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "ne

serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
serde_repr = { git = "https://github.com/chipp/serde-repr", branch = "master" }
serde_repr = "0.1"

md-5 = "0.10"

Expand Down