core-foundation-rs icon indicating copy to clipboard operation
core-foundation-rs copied to clipboard

add bindings for CoreWLAN

Open mainrs opened this issue 4 years ago • 4 comments

Not sure if this belongs here. It would be awesome to have bindings to the CoreWLAN interface which provides functionality for WLAN and AirDrop.

Documentation: https://developer.apple.com/documentation/corewlan Since:: macOS 10.6+

I do have access to a MacBook. If you guys could provide me a small how-to I can try to implement it myself and create a PR.

mainrs avatar Oct 15 '19 17:10 mainrs

I'd recommend doing this in a separate crate that depends on core-foundation. Perhaps take a look at https://github.com/kornelski/rust-security-framework for inspiration.

jrmuizel avatar Oct 15 '19 18:10 jrmuizel

Thank you very much! This question applies to any C interop I guess, but what exactly is the difference between the crate and crate_sys types? E.g. I checked out the project that you linked in your response. I just thought that _sysd are raw bindings whereas the normal crate would provide "rust-ified" types. Why would the non-sys crate ever want to import from core_foundation_sys? Couldn't it always use core_foundation instead?

mainrs avatar Oct 15 '19 21:10 mainrs

Yes, I believe that's generally the approach to take. There may be situations where importing core_foundation_sys makes sense but none jump to mind.

jrmuizel avatar Oct 15 '19 21:10 jrmuizel

Thanks for the explanation :)

mainrs avatar Oct 15 '19 21:10 mainrs