WAC Server API

Includes:
"HTTPServer.h"
"MFiSAPServer.h"
"dns_sd.h"
<semaphore.h>

Introduction

This header contains the functions your WAC application must call to interact with the WAC server.



Functions

WACServerStart(WACContext_t * const)

This function stops the WAC engine asynchronously. WAC will respond with an WACCallbackMessage_Stopped message to the callback provided to WACServerStart.

WACServerStart(WACContext_t * const, void *)

This function starts the WAC engine with the selected platform parameters. This will start the asynchronous WAC callback messages to inform the application of the WAC process status.

WACServerStop

This function stops the WAC engine asynchronously. WAC will respond with an WACCallbackMessage_Stopped message to the callback provided to WACServerStart.


WACServerStart(WACContext_t * const)


This function stops the WAC engine asynchronously. WAC will respond with an WACCallbackMessage_Stopped message to the callback provided to WACServerStart.

OSStatus WACServerStop(
    WACContext_t *const inContext );  
Return Value

kNoErr if successful or an error code indicating failure.


WACServerStart(WACContext_t * const, void *)


This function starts the WAC engine with the selected platform parameters. This will start the asynchronous WAC callback messages to inform the application of the WAC process status.

// TODO: This should take the platform params 
OSStatus WACServerStart(
    WACContext_t *const inContext,
    void *WACPlatformCallback );  
Parameters
inPlatformParams

The parameters for WAC defined by the platform. See WACPlatformParameters_t typedef.

WACPlatformCallback

The pointer to the function the platform would like the be called back on for WAC status updates.

Return Value

kNoErr if successful or an error code indicating failure.


WACServerStop


This function stops the WAC engine asynchronously. WAC will respond with an WACCallbackMessage_Stopped message to the callback provided to WACServerStart.

OSStatus WACServerStop(
    WACContext_t *const inContext );  
Return Value

kNoErr if successful or an error code indicating failure.


Typedefs

WACCallbackMessage_t

Callback message types to the host WAC application on the platform.

WACPlatformParameters_t

Parameters controlled by the platform to configure the WAC process.


WACCallbackMessage_t


Callback message types to the host WAC application on the platform.

typedef enum { 
    WACCallbackMessage_Initializing = 0, 
    WACCallbackMessage_Ready = 1, 
    WACCallbackMessage_ConfigStart = 2, 
    WACCallbackMessage_ConfigReceived = 3, 
    WACCallbackMessage_ConfigComplete = 4, 
    WACCallbackMessage_Stopped = 5, 
    // TODO: Use the error status 
    WACCallbackMessage_Error = 6  
} WACCallbackMessage_t;  

WACPlatformParameters_t


Parameters controlled by the platform to configure the WAC process.

typedef struct { 
    uint8_t macAddress[ 6 ];  
    bool isUnconfigured;
    ; 
    bool supportsAirPlay; 
    bool supportsAirPrint; 
    bool supports2_4GHzWiFi; 
    bool supports5GHzWiFi; 
    bool supportsWakeOnWireless;  
    char *firmwareRevision; 
    char *hardwareRevision; 
    char *serialNumber;  
    char *name; 
    char *model; 
    char *manufacturer;  
    char **supportedExternalAccessoryProtocols; 
    uint8_t numSupportedExternalAccessoryProtocols; 
    char *preferredAppBundleSeedIdentifier;  
} WACPlatformParameters_t;  
Fields
macAddress

REQUIRED: Accessory MAC address, e.g. 00:11:22:33:44:55

isUnconfigured

TRUE/FALSE: whether the accessory is unconfigured

supportsAirPlay

TRUE/FALSE: whether the accessory supports AirPlay

supportsAirPrint

TRUE/FALSE: whether the accessory supports AirPrint

supports2_4GHzWiFi

TRUE/FALSE: whether the accessory supports 2.4 GHz Wi-Fi

supports5GHzWiFi

TRUE/FALSE: whether the accessory supports 5 GHz Wi-Fi

supportsWakeOnWireless

TRUE/FALSE: whether the accessory supports Wake On Wireless

firmwareRevision

REQUIRED: Version of the accessory's firmware, e.g. 1.0.0

hardwareRevision

REQUIRED: Version of the accessory's hardware, e.g. 1.0.0

serialNumber

OPTIONAL: Accessory's serial number

name

REQUIRED: Name of the accessory

model

REQUIRED: Model name of the accessory

manufacturer

REQUIRED: Manufacturer name of the accessory

supportedExternalAccessoryProtocols

OPTIONAL: Array of EA Protocol strings

numSupportedExternalAccessoryProtocols

OPTIONAL: Number of EA Protocol strings contained in the supportedExternalAccessoryProtocols array

preferredAppBundleSeedIdentifier

OPTIONAL: Accessory manufacturer's preferredAppBundleSeedIdentifier