hammerspoon2-docs
    Preparing search index...

    Function interfaceDetails

    • Returns detailed information about a Wi-Fi interface.

      This is safe to call frequently. The interface's cached scan results and its configuration are available from cachedScanResults() and configuration(), which are kept separate because fetching them can leak memory inside macOS.

      active reports whether the interface is in use, and does not need Location Services authorization, so it's a way to check that Wi-Fi is connected without that permission.

      Parameters

      • Optionalinterface: string | null

        the interface name as returned by interfaces(); omit for the system's default Wi-Fi interface

      Returns
          | {
              active: boolean;
              activePHYMode: string;
              bssid?: string;
              countryCode?: string;
              hardwareAddress?: string;
              interface?: string;
              interfaceMode: string;
              noise: number;
              power: boolean;
              rssi: number;
              security: string;
              ssid?: string;
              supportedChannels: HSWifiChannel[];
              transmitPower: number;
              transmitRate: number;
              wlanChannel?: HSWifiChannel;
          }
          | null

      The interface's details, or null if the interface doesn't exist. ssid/bssid/countryCode/wlanChannel may be absent without Location Services authorization

      • {
            active: boolean;
            activePHYMode: string;
            bssid?: string;
            countryCode?: string;
            hardwareAddress?: string;
            interface?: string;
            interfaceMode: string;
            noise: number;
            power: boolean;
            rssi: number;
            security: string;
            ssid?: string;
            supportedChannels: HSWifiChannel[];
            transmitPower: number;
            transmitRate: number;
            wlanChannel?: HSWifiChannel;
        }
        • active: boolean

          Whether the interface is in use

        • activePHYMode: string

          e.g. "AX" for 802.11ax

        • Optionalbssid?: string

          The MAC address of the access point it's using

        • OptionalcountryCode?: string

          The country code the interface is using

        • OptionalhardwareAddress?: string

          The interface's MAC address

        • Optionalinterface?: string

          The interface's name

        • interfaceMode: string

          e.g. "Station"

        • noise: number

          Noise in dBm

        • power: boolean

          Whether the interface is powered on

        • rssi: number

          Signal strength in dBm

        • security: string

          The security of the network it's on

        • Optionalssid?: string

          The name of the network it's on

        • supportedChannels: HSWifiChannel[]

          The channels the interface supports

        • transmitPower: number

          The transmit power, in mW

        • transmitRate: number

          The transmit rate, in Mbps

        • OptionalwlanChannel?: HSWifiChannel

          The channel it's on

      • null