What's New / Connectivity & Hardware

What's new in WiFiAware

+2 New−1 RemovediOS

WiFiAware (WA) is Apple's framework for Wi-Fi Aware peer-to-peer networking. Devices discover each other and form direct connections over Wi-Fi without joining a shared access point. Endpoints are modeled by types like WAEndpoint.

The 27 SDK adds two APIs: the struct WAPerformanceForecast and a WAEndpoint.performanceForecast property that returns it. One API is removed, the Network-framework type NWParameters. There are no deprecations.

New

2
struct

WAPerformanceForecast

NewiOS
public struct WAPerformanceForecast : Sendable

The performance forecast for a connection setup to the remote device.

Declaration
public struct WAPerformanceForecast : Sendable {

    /// The time the forecast was generated.
    public let timestamp: Date

    /// The time the forecast was generated, using a local monotonically increasing clock.
    public let localTimestamp: ContinuousClock.Instant

    /// The estimated signal strength of the remote device.
    ///
    /// The resulting value can be between `0.0` (weakest) and `1.0` (strongest), or it can be `nil` if the system can't measure the value.
    public let signalStrength: Double?

    /// The highest throughput a connection from the local device to the remote device is capable of under ideal conditions, given the hardware capabilities of the local device.
    /// The actual throughput achieved can be lower in the presence of other active connections.
    ///
    /// The result is in `Mbps` and can be `nil` if the system can't calculate it.
    public let localThroughputCeiling: Double?

    /// The estimated average throughput capacity of the local device for a connection setup to the remote device.
    ///
    /// The result is in `Mbps` and can be `nil` if the system can't calculate the capacity.
    public let localThroughputCapacity: Double?

    /// The estimated normalized ratio of the local throughput capacity and the local throughput ceiling.
    ///
    /// This ratio reflects the estimated throughput capability for a connection setup to the remote device as a value between `0.0` and `1.0`.
    public let localThroughputCapacityRatio: Double?

    /// The estimated normalized ratio of the local Wi-Fi Infrastructure throughput capacity and the local Wi-Fi Infrastructure throughput ceiling, if a Wi-Fi Aware connection is setup to the remote device.
    ///
    /// This ratio reflects the estimated throughput capability for a connection setup to the remote device as a value between `0.0` and `1.0`.
    public let localInfrastructureThroughputCapacityRatio: Double?

    /// The highest forecasted packet latency due to this device's unavailability.
    ///
    /// This only considers the latency caused by time periods where this local device is not able to communicate to the other device via Wi-Fi Aware.
    /// Additional latency can be caused by channel or RF conditions.
    public let unavailabilityLatencyCeiling: Duration?
}
let

WAEndpoint.performanceForecast

NewiOS
public let performanceForecast: [WAPerformanceMode : WAPerformanceForecast]

The forecasted performance for connections setup to the remote device, per WAPerformanceMode.

This estimation makes certain worst case assumptions about the remote device when calculating performance. A more accurate performance report is available though WAPerformanceReport after a connection is setup. Returns an empty dictionary if the forecast cannot be estimated.

Removed

1
extension

NWParameters

RemovediOS
extension NWParameters
RemovedAbsent from the 27 SDK interface. Declaration shown is from the 26 SDK.

Extends NWParameters to add Wi-Fi Aware specific options.

Declaration
extension NWParameters {

    /// Get and set Wi-Fi Aware specific connection parameters.
    ///
    /// If no Wi-Fi Aware specific properties were previously set, the ``WAParameters/defaults`` are assumed.
    ///
    /// The following code is an example of creating the `NWParameters`, setting, and getting the WiFi Aware parameters.
    ///
    /// ```swift
    /// // Create NWParameters
    /// var networkParameters = NWParameters()
    ///
    /// // Set Wi-Fi Aware Parameters
    /// networkParameters.wifiAware = .defaults
    ///
    /// // Get Wi-Fi Aware Parameters
    /// let wifiAwareParameters = networkParameters.wifiAware
    /// ```
    final public var wifiAware: WAParameters

    /// Configure Wi-Fi Aware properties on an `NWParameters` object.
    ///
    /// If not previously set, parameters will have ``WAParameters/defaults`` applied initially.
    ///
    /// Example:
    /// ```swift
    /// // Create NWParameters & apply wifiAware parameters
    /// let networkParameters = NWParameters().wifiAware {
    /// 	$0 = .defaults
    /// }
    /// ```
    ///
    /// - Parameter configurator: The function that will apply the desired `WAParameters` to the network parameters.
    /// - Returns: the updated parameters, with the configured Wi-Fi Aware parameters applied.
    final public func wifiAware(_ configurator: (inout WAParameters) -> Void) -> Self
}

No APIs match your filter.

← More in Connectivity & Hardware