Skip to content

Inner value of CWPHYMode appears to change between integer and bitflags index between macOS versions #662

Open
@keabarnes

Description

@keabarnes

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 as CWPHYMode(16) but should be CWPHYMode(4)
    • 802.11ax is returned as CWPHYMode(64) but should be CWPHYMode(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",
] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frameworkAffects the framework crates and the translator for thembugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions