• 沒有找到結果。

Chapter 4 Design Issues

4.3. OSGi View in SUIT System

4.4.1. Case Study: UPnP Bulb

In the SUIT platform, we manage those URC standard profiles from manufacturers’

bundles in the file system. Every directory represents a document set for a home appliance.

The naming convention of the directory is “Manufacturer-DeviceName” as shown in Figure 4-5. Now we have four appliances on our SUIT gateway, they are thermometer produced by AIAP Manufacturer、IR Robot produced by DCSLab Manufacturer、bulb produced by UPnP manufacturer and neon produced by X10 manufacturer. Following we will look into UPnP bulb and show the design of AIAP-URC document set for this electronic product on SUIT platform and the usages of those documents.

Figure 4-5 Home Appliance List

Inside the directory of UPnP bulb, there are four URC documents for this device. The naming convention is “Manufacturer-DeviceName.td.xml” for target description which informs the other three documents. “Manufacturer-DeviceName.uisocket.xml” is for User Interface Socket Description which indicates the functionalities enabled on the appliance.

“Manufacturer-DeviceName.pret.xml” is for Presentation Template that gives hints for remote consoles to build user interface. Finally “Manufacturer-DeviceName.rsheet.xml” is for Resource Sheet that remote consoles use to construct the interactive user interface. Another way to name these documents besides Target Description references them in the Target

Description, in this case, you can name them freely. These four documents should be maintained very well by the SUIT gateway.

Figure 4-6 UPnP Bulb Required URC Documents

Figure 4-7 is the example of UPnP bulb Target Description, we retrieve three important parts in this document. The first part tells the name of User Interface Socket Description. The second part points out the Resource Sheet, and here in this case, the resource is of the Text type, it maybe image type or audio type for other appliances. The last part says the name of the Presentation Template which is used by the UPnP bulb.

Figure 4-7 UPnP Bulb Target Description

Figure 4-8 presents the real case for User Interface Socket Description for UPnP bulb.

Although elements of a socket are all optional which depends on the functionalities provided target device, SUIT requires each Socket Description to provide a “deviceID” of static type.

The reason for that is we are writing descriptions for control point bundle which is able to control multiple products in the same proprietary network. It is not the situation in the typical AIAP-URC architecture which the description is for unique device. In SUIT platform, manufacturers have to specify the device identifier, for control point to recognize which device is the real target. “it.cnr.isti.niche.osgi.sample.light.LightDevice” is the UPnP device identifier that is recognizable for UPnP control point in over UPnP network. “CS703A” is the model number for the UPnP bulb that is unchangeable, so we choose the static type. The UPnP bulb is enabled with a function named “GetStatus” for remote consoles to query the current status of the UPnP bulb. The “GetStatus” action is not representable of a variable, it is a action which will be done after several steps, so we use command type. The last element is

“SetTarget”, which remote consoles are able to set it true or false. The dependency for

“SetTarget” action is if other remote console is also trying to change the state of variable.

Figure 4-9 is the example of UPnP bulb Presentation Template. Presentation gives hints for universal remote consoles to build universal user interface. In this case, we output the model number which is static type to the user, the URI “http://mick.no-ip.org/UPnP-小燈泡 /socket#modelNumber” is the mapping of presentation element to the socket element, here is the “modelNumber” element in Figure 4-8. For the command action “GetStatus” in Figure 4-8, we have the mapping element with “trigger” type as the hint to the remote console. For

“SetStatus” function, the Presentation hint is “input” type for remote console to set status.

Figure 4-9 UPnP Bulb Presentation Template

The last document is Resource Sheet, used to construct concrete user interface.

According to the Presentation Template, there are two functions which need supports from Resource Sheet to help them complete the concrete user interface construction. In this example, we give two Text type resources for remote consoles. These two Text are in Chinese,

“看看現在燈的狀況” is for presenting “GetStatus” to Chinese people, and the Text type resource “控制小燈泡的開關” is for “SetTarget”. We can do multi-language support by substitution of Resource Sheet.

One worth discussing is that the AIAP-URC specifications do not define the presentation of arguments for functions. For example, when we want to open the UPnP bulb, we try

“SetTarget On”, and turning it off by “SetTarget Off”. But in the Scoket Description, the

machine reads Boolean type, not “On” or “Off”. So the mapping job is thrown to the remote console bundle, the remote console manufacturer must pay attention to this. Another possible design is to use “select1” instead of input. The remote console has to provide a user interface structure that only allows users to choose one option from a set of choices, and the set of choices can be defined with <selection> tag. More detail information about the Presentation Template can be found at the specification of INCITS 391: Presentation Template.

Figure 4-10 UPnP Bulb Resource Sheet

相關文件