You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use this crate to control some light bulbs with my wireless router through SSH. My wireless router currently runs OpenWRT which uses Musl as default library. However, I'm facing some problems trying to compile the current version using the target triple "mips-unknown-linux-musl":
error[E0425]: cannot find value `SOL_BLUETOOTH` in module `libc`
--> /home/leonardohn/.cargo/registry/src/github.com-1ecc6299db9ec823/rumble-0.2.1/src/bluez/adapter/peripheral.rs:348:40
|
348 | libc::setsockopt(fd, libc::SOL_BLUETOOTH, 4, opt.as_mut_ptr() as *mut libc::c_void, 2)
| ^^^^^^^^^^^^^ did you mean `AF_BLUETOOTH`?
error[E0308]: mismatched types
--> /home/leonardohn/.cargo/registry/src/github.com-1ecc6299db9ec823/rumble-0.2.1/src/bluez/manager/mod.rs:75:35
|
75 | libc::ioctl(*ctl, HCI_GET_DEV_LIST_MAGIC as libc::c_ulong, dl as (*mut c_void)))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32
error[E0308]: mismatched types
--> /home/leonardohn/.cargo/registry/src/github.com-1ecc6299db9ec823/rumble-0.2.1/src/bluez/adapter/mod.rs:468:43
|
468 | handle_error(libc::ioctl(ctl, HCI_GET_DEV_MAGIC as libc::c_ulong,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32
error: aborting due to 3 previous errors
Some errors occurred: E0308, E0425.
For more information about an error, try `rustc --explain E0308`.
error: Could not compile `rumble`.
When I try to compile to my computer architecture it works fine, so, the problem seems to be with using Musl instead of Glibc.
By the way, I'm currently using rust standard library with the project, but it would be nice to move to no_std as it could save some space into the binary file, considering my router has only 8mb in space.
Are you planning to support Musl and no_std implementations?
The text was updated successfully, but these errors were encountered:
SOL_BLUETOOTH is defined in mainline linux so should not be a platform-specific issue. I opened rust-lang/libc#1169 (now merged) to get that fixed for musl and others.
Cross-platforming for HCI_GET_DEV_MAGIC, on the other hand, should be handled by rumble. Further-embracing nix's ioctl macros would be a good solution-- I opened #18 with the intent of going down that path. Otherwise, platform cfg flagging (example) is another common approach.
Great to see the SOL_BLUETOOTH fix merged. I'd be happy to accept a PR that defines the constant internally as well in the meantime (as well as any other fixes needed for no_std).
I'm trying to use this crate to control some light bulbs with my wireless router through SSH. My wireless router currently runs OpenWRT which uses Musl as default library. However, I'm facing some problems trying to compile the current version using the target triple "mips-unknown-linux-musl":
When I try to compile to my computer architecture it works fine, so, the problem seems to be with using Musl instead of Glibc.
By the way, I'm currently using rust standard library with the project, but it would be nice to move to no_std as it could save some space into the binary file, considering my router has only 8mb in space.
Are you planning to support Musl and no_std implementations?
The text was updated successfully, but these errors were encountered: