Platform Apply Configuration

Includes:
"Common.h"
"Debug.h"

Introduction

This header contains function prototypes called by the WAC engine that must be implemented by the platform. These functions are called when the platform needs to apply a configuration.



Functions

PlatformApplyAirPlayPlayPassword

This function is called by the WAC engine when the configuration includes an AirPlay Play Password. This function must be implemented by the platform. The platform should store the password in persistant memory and notify AirPlay of the change.

PlatformApplyName

This function is called by the WAC engine when the configuration has been received and the user has changed the name of the device. This function must be implemented by the platform. The name should be saved to persistent memory and used wherever your device can be identified, including but not limited to the bonjour device name.

PlatformJoinDestinationWiFiNetwork

This function is called by the WAC engine when it is time to join the destination Wi-Fi network. This function must be implemented by the platform. The SSID and PSK (when applicable) should be stored in persistent memory and auto joined upon reboots and/or connectivity loss.


PlatformApplyAirPlayPlayPassword


This function is called by the WAC engine when the configuration includes an AirPlay Play Password. This function must be implemented by the platform. The platform should store the password in persistant memory and notify AirPlay of the change.

OSStatus PlatformApplyAirPlayPlayPassword(
    const char *const inPlayPassword );  
Parameters
inPlayPassword

The AirPlay Play Password. If NULL, the password should be disabled.

Return Value

kNoErr if successful or an error code indicating failure.


PlatformApplyName


This function is called by the WAC engine when the configuration has been received and the user has changed the name of the device. This function must be implemented by the platform. The name should be saved to persistent memory and used wherever your device can be identified, including but not limited to the bonjour device name.

OSStatus PlatformApplyName(
    const char *const inName );  
Parameters
inName

The name the user has chosen for the accessory.

Return Value

kNoErr if successful or an error code indicating failure.


PlatformJoinDestinationWiFiNetwork


This function is called by the WAC engine when it is time to join the destination Wi-Fi network. This function must be implemented by the platform. The SSID and PSK (when applicable) should be stored in persistent memory and auto joined upon reboots and/or connectivity loss.

OSStatus PlatformJoinDestinationWiFiNetwork(
    const char *const inSSID,
    const uint8_t *const inWiFiPSK,
    size_t inWiFiPSKLen );  
Parameters
inSSID

The SSID the accessory should scan for and join.

inWiFiPSK

The password for the destination network. If NULL, the network should be treated as unsecured.

inWiFiPSKLen

The length of the password for the destination network. If 0, the network should be treated as unsecured.

Return Value

kNoErr if successful or an error code indicating failure.