Wireles Interactive Networked Display (WIND)

This document specifies the Wireles Interactive Networked Display (WIND) device. It covers the device architecture, the components and their state machines, the interfaces between them, the handlers wrapping external resources, and the messages and functions used throughout. Cross-references are clickable; hover the underlined identifiers to navigate to their definitions.

Device specification

The device is a Wireless Interactive Networked Display (WIND) which is controlled by a central server (not in scope). It operates by creating a connection to the server and then handling requests to display content formatted as a PNG image. Some content must be interactive which is enabled by the display being touch sensitive and the server sending an indexed coordinates map of touch-squares on the display. The device must be extremely low cost, so interaction is limited by the device mapping touch coordinates to the proper id and sending that id back to the server.

The device further has a speaker for supplying audio cues, which comprises a set of indexed predefined sounds. Each square on the touch-map can have an audio cue associated with it, specified by the index of the sound. The server can update the stored audio samples.

Device architecture

Wireles Interactive Networked Display (WIND)DeviceConnectionPeripheralsContentAudioDisplayServerConnectorDevice StatusControllerUIControllerWirelessTransceiverPeripheralHandlerTouchDisplayAudioHandler

The descriptions of the identified components are given in the table below.

ComponentDescription
Server ConnectorControls and establishes the connection with the server. It waits for the device to become ready and then starts advertising its presence on the network to be discoverable by a server.
Device Status ControllerTakes care of initializing the components in the device by waiting for all the peripherals to be operational.
UI ControllerControls the user interaction by interfacing with the TouchDisplay and the AudioHandler.

The descriptions of the identified handlers are given in the table below.

HandlerDescription
Wireless TransceiverThis handler takes care of receiving and transmitting data packets on the radio front-end by interfacing with the radio hardware peripheral. By looking at the message-type of incoming messages, indications are forwarded either to the Connection or Content interface.
Peripheral HandlerTakes care of detecting, initializing and configuring hardware peripherals, e.g. by accessing low level drivers and serial communication lines.
Touch DisplayHandles the interface to the touch display to show images and capture touch events.
Audio HandlerEnables the ability to play audio cues to the user upon touch events. It stores audio samples internally, which can be updated via the interface.

Interfaces

Interfaces define the message vocabulary that connects components and handlers.

The following table lists the defined interfaces.

NameDescription
AudioStatus indication from the audio.
ConnectionWireless transceiver messages for connection handling.
ContentExchange of interaction with the server.
DeviceDevice status messages.
DisplayDisplay status and control messages.
PeripheralsStatus indications of all the peripherals.

The messages for the interfaces are specified in the following sections.

Device

Device status messages.

MessageMessage descriptionParameterTypeParameter description
ErrorIndAn error occurred and the device is no longer operational.
ReadyIndAll peripherals are ready and the device can be initialised.

Connection

Wireless transceiver messages for connection handling.

MessageMessage descriptionParameterTypeParameter description
AdvertiseIndBroadcast to be discoverable.iduintID of the device.
ConnectedIndConnected to the server.
ConnectReqRequest received to connect to a server.serverIduintID of the server what wants to connect.
DisconnectedIndThe transceiver detected that the server is disconnected.
ReadyIndThe transceiver is ready for operation.

Peripherals

Status indications of all the peripherals.

MessageMessage descriptionParameterTypeParameter description
FailureIndA peripheral initialisation failed or is no longer operational.
ReadyIndIndication that a specific peripheral is ready.peripheralIduintID of the peripheral that became operational.

Content

Exchange of interaction with the server.

MessageMessage descriptionParameterTypeParameter description
ContentIndA new image to display with touch map and audio queues.imagebyteMatrixThe PNG image to display.
soundMapuintArrayMaps a touch ID to a sound ID.
touchMapuintMatrixMapping the pixels in the image to touch area IDs.
SoundIndAn update of a sound.iduintThe ID of the location where to place the sound.
soundDatabyteArrayThe audio samples.

Audio

Status indication from the audio.

MessageMessage descriptionParameterTypeParameter description
ReadyIndIndication that the audio device is ready.numSoundsuintThe number of stored sounds in the audio device.

Display

Display status and control messages.

MessageMessage descriptionParameterTypeParameter description
ReadyIndIndication that the touch display is initialized.heightuintThe height of the display in pixels.
widthuintThe width of the display in pixels.
TouchedIndIndication that a touch event occurred on the display.xuintThe x-coordinate of the touched pixel.
yuintThe y-coordinate of the touched pixel.

Server Connector

Controls and establishes the connection with the server. It waits for the device to become ready and then starts advertising its presence on the network to be discoverable by a server.

Context

DeviceConnectionServerConnectorWirelessTransceiver

Constants

NameValueDescription
ADVERTISEMENT1000Advertisement interval in ms.
CONNECTION_TIMEOUT500Timeout waiting for server to connect in ms.

State variables

NameTypeDescription
serverIduintThe ID of the connected or connecting server.
whitelistuintArrayWhitelist of servers.

States

StateDescription
AdvertisingBroadcasting advertisement packets on the network to be discoverable by a server.
ConnectedConnected to the server.
ConnectingEstablishing a connection to the server.
InitialisingWaiting until all components are ready.
UninitialisedWaiting for the device to become ready.

Choice-points

QuestionDescription
Is Server Whitelisted?Check whether the server that tries to connect is whitelisted.

State diagram

Server ConnectorAdvertisingInitialisingUninitialisedConnectedConnecting*Is ServerWhitelisted?Device:ReadyIndConnection:ReadyIndConnection:ConnectReqNoConnection:ConnectedIndConnection:DisconnectedIndTimeoutYesTimeoutDevice:ErrorIndConnection:ConnectedInd*

State transition table

SourceTargetInterfaceMessageAction
Uninitialised
AdvertisingIs Server Whitelisted?ConnectionConnectReqStop the timer.
serverId =ConnectReq:serverId
AdvertisingAdvertisingTimerTimeoutCall doAdvertise().
ConnectedConnectedConnectionConnectedInd
ConnectedAdvertisingConnectionDisconnectedIndCall doAdvertise().
ConnectingConnectedConnectionConnectedInd
ConnectingAdvertisingTimerTimeoutCall doAdvertise().
InitialisingAdvertisingConnectionReadyIndCall doAdvertise().

Is Server Whitelisted?AdvertisingLogicalNoCall the WirelessTransceiver:rejectServer().
Call the WirelessTransceiver:sendAdvertisementPacket().
Start the timer with the ADVERTISEMENT interval.
Is Server Whitelisted?ConnectingLogicalYesCall WirelessTransceiver:connectServer(serverId).
Start the timer with the CONNECTION_TIMEOUT interval.
UninitialisedUninitialised**
UninitialisedInitialisingDeviceReadyInd
UninitialisedDeviceErrorIndCall the WirelessTransceiver:disable().

Local functions

NameDescriptionSteps
doAdvertiseSend advertisement packet and start timer.Call the WirelessTransceiver:sendAdvertisementPacket().
Start the timer with the ADVERTISEMENT interval.

Device Status Controller

Takes care of initializing the components in the device by waiting for all the peripherals to be operational.

Context

DevicePeripheralsDevice StatusControllerPeripheralHandler

Constants

NameValueDescription
NUM_PERIPHERALS3Number of expected peripherals.

State variables

NameTypeDescription
peripheralsuintArrayList of operational peripherals.

States

StateDescription
Awaiting PeripheralsWaiting for all the peripherals to become ready.
ErrorInitialisation of the device failed or peripherals became unavailable.
OperationalAll peripherals are operational.

Choice-points

QuestionDescription
All Peripherals Operational?Are all expected NUM_PERIPHERALS peripherals operational?

State diagram

Device Status ControllerAwaitingPeripheralsOperationalErrorAll PeripheralsOperational?Peripherals:ReadyIndNoYesPeripherals:FailureIndPeripherals:FailureInd*

State transition table

SourceTargetInterfaceMessageAction
Awaiting Peripherals
All Peripherals Operational?Awaiting PeripheralsLogicalNo
All Peripherals Operational?OperationalLogicalYesSend the Device:ReadyInd message.
Awaiting PeripheralsErrorPeripheralsFailureIndSend the Device:ErrorInd message.
Awaiting PeripheralsAll Peripherals Operational?PeripheralsReadyIndAdd the ReadyInd:peripheralId in the peripherals list.
ErrorError**
OperationalErrorPeripheralsFailureInd

Local functions

This component has no local functions.

UI Controller

Controls the user interaction by interfacing with the TouchDisplay and the AudioHandler.

Context

DeviceContentAudioDisplayUIControllerWirelessTransceiverTouchDisplayAudioHandler

Constants

This component has no constants.

State variables

NameTypeDescription
imagebyteArrayThe PNG image currently displayed or to be displayed.
numSoundsuintNumber of sounds stored in the audio device.
sampleDatabyteArraySample data of a sound.
soundIduintSound to play or that is playing.
soundMapuintArrayMaps a touch ID with a sound ID.
touchedAreaIduintID of the touched area.
touchMapuintMatrixMapping the pixels in the image to touch area IDs.

States

StateDescription
Initializing AudioInitializing the audio device.
Initializing DisplayInitializing the touch display.
InteractingInteractive content is shown on the display.
OperationalReady to interact.
UninitialisedWaiting for the device to become ready.

Choice-points

This component has no choice-points.

State diagram

UI ControllerUninitialisedInitializingAudioInitializingDisplayOperationalInteracting*Device:ReadyIndAudio:ReadyIndDisplay:ReadyIndContent:ContentIndDisplay:TouchedIndContent:SoundIndDevice:ErrorIndContent:SoundInd

State transition table

SourceTargetInterfaceMessageAction
Uninitialised
Initializing AudioInitializing DisplayAudioReadyIndnumSounds = ReadyInd:numSounds.
Call the TouchDisplay:initialize().
Initializing DisplayOperationalDisplayReadyIndSend WirelessTransceiver:sendContentDimensions() with the ReadyInd:width and ReadyInd:height as parameters.
InteractingOperationalContentSoundIndCall TouchDisplay:unresponsive()
soundId = SoundInd:id
sampleData = SoundInd:soundData
DisplayTouchedIndtouchedAreaId = touchMap[TouchedInd:x][TouchedInd:y]
soundId = soundMap[touchedAreaId]
Call AudioHandler:playSound(soundId).
Call TouchDisplay:unresponsive().
Call WirelessTransceiver:sendTouchEvent().
OperationalInteractingContentContentIndimage = ContentInd:image
Call TouchDisplay:display(image).
touchMap = ContentInd:touchMap
soundMap = ContentInd:soundMap
OperationalOperationalContentSoundIndsoundId = SoundInd:id
sampleData = SoundInd:soundData
Call updateSound().
UninitialisedInitializing AudioDeviceReadyIndCall AudioHandler:initialize().
UninitialisedDeviceErrorIndCall TouchDisplay:unresponsive().
Call the TouchDisplay:displayError().

Local functions

NameDescriptionSteps
updateSoundUpdate a sound on the audio peripheral.Call AudioHandler:updateSound()with soundId and sampleData as parameters.

Handlers

Handlers wrap external resources (timers, network endpoints, hardware peripherals) so the components can interact with them through interfaces and function calls.

Wireless Transceiver

This handler takes care of receiving and transmitting data packets on the radio front-end by interfacing with the radio hardware peripheral. By looking at the message-type of incoming messages, indications are forwarded either to the Connection or Content interface.

FunctionFunction descriptionParameterTypeParameter description
connectServerConnect to the indicated server.serverIduintThe ID of the server to connect to.
disableDisable the radio frontend.
initialiseInitialise the radio frontend.
rejectServerBlock further requests from the indicated server.serverIduintThe ID of the server that is to be rejected from now on.
sendAdvertisementPacketSend a single advertisement packet to become discoverable.
sendContentDimensionsInform the server of the dimensions of the content the display supports.displayHeightuintThe height of the display in pixels.
displayWidthuintThe width of the display in pixels.
sendTouchEventSend the touch event information to the server.touchAreaIduintID of the area that was touched.

Peripheral Handler

Takes care of detecting, initializing and configuring hardware peripherals, e.g. by accessing low level drivers and serial communication lines.

FunctionFunction descriptionParameterTypeParameter description
startStart initialising and configuring the peripherals.

Touch Display

Handles the interface to the touch display to show images and capture touch events.

FunctionFunction descriptionParameterTypeParameter description
displayDisplay the supplied image.imagebyteArrayThe PNG image to be displayed.
displayErrorDisplay the default error message.
initializeInitialize the touch display.
unresponsiveDisable the touch sensitivity to allow for handling the touch event first.

Audio Handler

Enables the ability to play audio cues to the user upon touch events. It stores audio samples internally, which can be updated via the interface.

FunctionFunction descriptionParameterTypeParameter description
initializeInitialize the audio device.
playSoundPlay the specified sound.soundIduintThe ID of the sound to play.
updateSoundUpdate a stored sound.samplebyteArraySample data
soundIduintIndex of the sound.

Type definitions

The types referenced by parameter and state-variable declarations are defined below. Type names in tables elsewhere in this document link back to these entries.

NameDescriptionSpecification
byteArrayA one dimensional array of bytesuint8[]
byteMatrix2-dimensional array of bytes.byte[][]
uintUnsigned integer32-bit numerical value representing an integer value.
uintArrayOne dimensional array of uintuint[]
uintMatrix2-dimensional array of integers.uint[][]