Open
Description
In the code below, the inner value of CWPHYMode
which is returned by interface.activePHYMode()
differs based on the macOS version.
unsafe {
let client = CWWiFiClient::sharedWiFiClient();
let interface = client.interface().unwrap();
let phy_mode = interface.activePHYMode();
}
From observation I've noticed that
- on macOS 14.5 the inner value is represented by an integer that maps well to the
const ... Self(n)
constants on the enum - on macOS 15.0 it seems like the value represents the naive conversion from a bitflag to an integer
802.11n
is returned asCWPHYMode(16)
but should beCWPHYMode(4)
802.11ax
is returned asCWPHYMode(64)
but should beCWPHYMode(6)
Cargo.toml
for context
objc2 = { version = "0.5", features = ["apple"] }
objc2-foundation = { version = "0.2", features = ["apple"] }
objc2-core-wlan = { version = "0.2", features = [
"CWInterface",
"CWNetwork",
"CWWiFiClient",
"CWChannel",
"CoreWLANTypes",
] }