Within the UIAF mobile terminal platform realisation a discovery framework is realised, allowing the integration of several discovery mechanisms. The according UIAF device discovery functionalities are described in Chapter 4 in Section 4.1. The contribution of this thesis is the general design of the UIAF device discovery functionalities and the transfer to the actual implemented framework structure (code skeleton) as presented in this section. The according detailed implementation and validation has been performed by project partners within the EU-IST
MobiLife project. The discovery adapters for Bluetooth and UPnP are part o f the project implementation as w ell and are not explained in this section. The example o f UPnP discovery is utilised in the evaluation in Section 5.4 later.
From the discovery interaction sequence o f the UIAF initial system architecture (Section 3.4.1.4) and the device discovery framework description (Section 4.1), a reference architecture interface design for the device discovery framework, the UIAF - DeGan, is derived. Further it details the components and their relationships o f the UIAF initial system architecture as introduced in Section 3.4.2. c m p U IA F D e G a n D e a M o n : : D e v i c e H a n d l e r d e v i c e U s t : D e v i c e D e s c r i p t i o n [ ] + g e t A g e n t M a t c h ( c h a r ) : v o i d + u p d a t e ( D e v i c e D e s c r i p t i o n ) : v o i d D e G a n : : D i s c o v e r y D e G a n D e G a n : ; A g e n t M n g r - a d a p t e r L i s t : D i s c o v e r y A d a p t e r I F - a g e n t L i s t : H a s t i M a p ---> + r e m o v e A d a p t e r O : v o i d + s h u t d o w n Q : v o i d + t r i g g e r D i s c o v e r y O : v o i d + c r e a t e A g e n t s ( D e v i c e D e s c r i p t i o n [ ] ) : v o i d + g e t A g e n t O : A g e n t I F + r e m o v e A g e n t s ( D e v i c e D e s c r i p t i o n D ) : v o i d + u p d a t e ( D e v i c e D e s c r i p t i o n [ ] ) : v o i d
0
Î
g D e G a n ; ; D i s c o v e r y A d a p t e r - d i s c o v e r e d D e v i c e s : D e v i c e D e @ crip tio n [) + a d v e r t i s e ( S t r i n g ) : v o i d + g e l A d a p t e r N a m e O : S t r i n g + ru n O : v o i d + S ta rtO : v o i d + s to p O : v o i d 1 V 7 D e G a n : : D e v i c e A g e n t c o n t r o i ( S t r i n g ) : v o i d i n v o k e ( S t r i n g ) : v o i d s u b s c r i b e ( i n t ) : v o i d u n s u b s c r i b e ( i n t ) : v o i d 1--- « i n t e r f a c e » De Gan::DiscovervAdaDterlF + a dvert! s e (S in n g) : v o id+ g etA d a p terN a rreO : S trin g
+ startO : void + stopO : v o id
SL
« i n t e r f a c e » DeGan::Runnable run() : vo idSL
« i n t e r f a c e » DeGan::AaentlFcon tro i(String ) : vo id in vo k e (S trin g ) : v o id su b scrib e (in t) : vo id u n s u b s c r ib e (in t) : v o id
Figure 44: Device discovery framework realisation
Figure 44 illustrates the DeGan component with its classes. The interfacing with the DeaMon
DeviceHandler component is shown. In the follow ing details o f each class, its behaviour and
interfaces are explained.
Discovery Adapter - Discovery adapters encapsulate the functionalities o f a concrete discovery
mechanism (e.g. Bluetooth, UPnP, and RFID). Besides the actual details o f the adapter specific
implementation, adapters have to implement the DiscoveryAdapterIF and have to run in an own
states, activated and deactivated. They are deactivated initially until the start method is invoked. After the initialisation during the start-up of the adapter the activated state is reached. That means at the end of the start method the run method is invoked, performing the continuous discovery process. As mentioned earlier this either uses a timer based checking of the environment for discovery information or a wait state for receiving register messages. The advertise method represents a method for user interface devices to advertise their device information. Further each discovery adapter holds a list of discovered devices for itself. Initially this list is empty. After every discovery attempt or retrieved device announcement new devices are added to this list or removed. In case a change in the list has appeared, the new composed list is forwarded to the Device Handler through the discovery component. Finally, the getAdapterName method allows the system to distinguish between different discovery mechanisms.
Discovery - This component acts as a manager for the discovery process as a whole. It allows the UIAF system to add or remove discovery adapters based on the UIAF configuration using the
addAdapter and removeAdapter methods. Discovery can be started using the triggerDiscovery
method. Hereby the UIAF configuration is read and the discovery adapters needed are initialised according to the explanation given before. Similar to this, the discovery process can be stopped using the shutdown mexhod. All device information gathered by the discovery adapters is delivered to the discovery component using the update method. The methods parameter is an array of device descriptions. From here the discovery components forwards the device descriptions to the Device Handler, where the system device table is updated accordingly. Further the discovery instantiates the according Device Agents (DeviceAgent) for each discovered device through the agent manager (agentMngr).
AgentMngr - The agent manager holds a list of available Device Agents. These are related to according device descriptions of modality input or output devices stored in the Device Handler. As such the agent manager provides the methods for creation, removal, retrieving and stopping Device Agents. The createAgents method initialises Device Agents for a specific modality input or output type based on a given device description. One device could support several modalities and therefore multiple Device Agents are initialised for those. The removeAgents method functions opposite to the createAgents method. Given a device description the agent manager stops and removes all Device Agents belonging to this device. With getAgent meXhod. it is possible to get a reference to a certain Device Agent.
DeviceAgent - Device Agents are designed to implement all communication mechanisms for the invocation of certain device functionalities or the retrieval of device input streams, using TCP sockets, SIP, UPnP and others. All Device Agents have to be implemented using the
DeviceAgentlF. The interface unifies three basic functionalities. First the invoke method allows
represents a String for the multimedia description used. This can be a single content URL as used in the mobile device implementation of the UIAF or complex multimedia presentation description handling (i.e. SMIL), as realised in the service platform implementation of the UIAF. With the invocation, the rendering of the media items starts automatically. Furthermore, Device Agents provide their controls to the UIAF or the Mobile application via the control method. The String parameter includes the control description to be invoked (e.g. control “pause” or “play” of a video Device Agent).
This concludes the device discovery framework implementation description. The realisation of a discovery adapter and how it is utilised for the scenario evaluation is described in Section 5.5.1.