home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Thomson (Residential)
/
TGSTPv7203.iso
/
mac
/
HIW
/
xml
/
mod_setupdevice_wireless.xml
< prev
next >
Wrap
Extensible Markup Language
|
2008-02-11
|
15KB
|
306 lines
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fsm SYSTEM "fsm.dtd">
<!--
/*!
Description
Shows the setup device page. Does all necessary steps for actually configuring the device
over a wireless link.
- Upload language pack: if the application runs in another language than English, the
according language pack isn't already on the device and the file is available.
- Create user.ini from profile and upload.
- Rebooting the device.
- Restoring the wireless radiolink.
- Authenticating the device again.
- Configuring the interface on the host computer.
Possible errors are caught within the module.
Input properties:
- profile: The profile object which will be finalized for upload. (required)
- newInterface: Interface object to which the host will be configured. (required)
properties to restore the radiolink _after_ setup:
- ssid: network ssid
- networkKey: network encryptionkey
- securityMode: encryption type
- adaptorManager: wireless adaptor manager
- languagePackPath: Absolute path where the language packs reside.
Output properties:
- profile: The final profile object.
Exit events:
- finished: Device is set up successfully.
-->
<fsm>
<property key="profile" required="yes"/>
<property key="adaptorManager" required="yes"/>
<property key="newInterface" required="yes"/>
<property key="languagePackPath" required="yes"/>
<property key="ssid" required="yes"/>
<property key="securityMode" required="yes"/>
<property key="networkKey" required="yes"/>
<states>
<state type="taskPageFsm" name="setupFsm" weight="10">
<!-- required inputs -->
<property key="profile" required="yes"/>
<property key="languagePackPath" required="yes"/>
<property key="newInterface" required="yes"/>
<property key="adaptorManager" required="yes"/>
<property key="ssid" required="yes"/>
<property key="securityMode" required="yes"/>
<property key="networkKey" required="yes"/>
<!-- page configuration -->
<property key="task1" value="tr(Identification of gateway)" />
<property key="task2" value="tr(Configuration of gateway)" />
<property key="task3" value="tr(Configuration of wireless connection)" />
<property key="task4" value="tr(Verification of gateway configuration)" />
<property key="task5" value="tr(Configuration of computer)" />
<property key="autoContinue" value="yes"/>
<property key="autoContinueTime" value="1"/>
<!-- states -->
<states>
<state type="showTaskPage" name="showSetupTaskPage">
<property key="title" value="tr(Configuration of gateway)" />
<property key="subTitle" value="tr(Please wait, the wizard is setting up your Thomson Gateway and local network.)" />
<property key="helpText" value="tr(The wizard will automatically set up your Thomson Gateway through following tasks:)" />
<property key="registerPage" value="1"/>
</state>
<!-- discover device -->
<state type="actionDiscoverDevice" name="discover" weight="3">
<property key="taskId" value="1"/>
<property key="timeout" value="10000"/>
</state>
<!-- check device languages and decide to upload language pack -->
<state file="mod_setup_includefiles.xml" name="uploadIncludeFiles" weight="5">
<property key="taskId" value="2"/>
</state>
<!-- check device languages and decide to upload language pack -->
<state file="mod_setup_langpack.xml" name="uploadLangPack" weight="7">
<property key="taskId" value="2"/>
</state>
<!-- create the template and upload it -->
<state file="mod_setup_userini.xml" name="uploadTpl" weight="3">
<property key="taskId" value="2"/>
</state>
<!-- reboot -->
<state type="actionActivateConfig" name="activateConfig" weight="15">
<property key="taskId" value="2"/>
<property key="timeout" value="20000"/>
</state>
<!-- restore wireless link -->
<state type="configRadioLink" name="configLink" weight="1">
<property key="taskId" value="3"/>
</state>
<state type="waitRadioLink" name="waitForLink" weight="5">
<property key="taskId" value="3"/>
<property key="timeout" value="180"/>
</state>
<!-- authenticate -->
<state type="actionDiscoverDevice" name="reDiscover" weight="10">
<property key="taskId" value="4"/>
<property key="timeout" value="60000"/>
</state>
<state type="actionAuthenticateDevice" name="authenticate" weight="2">
<property key="taskId" value="4"/>
<property key="timeout" value="15000"/>
</state>
<state type="actionInvokeCli" name="invokeFinalCli">
<property key="taskId" value="4"/>
</state>
<!-- host configuration -->
<state file="mod_setup_hostconfig.xml" name="hostConfig" weight="10">
<property key="taskId" value="5"/>
</state>
<!-- retry mechanism -->
<state type="compare" name="checkRetry">
<property key="type" value="number"/>
<property key="comparisonType" value="smallerorequal"/>
<property key="input1" value="0"/>
</state>
<state type="switch" name="returnToState">
<property key="outputs" value="configLink;authenticate;invokeFinalCli"/>
</state>
</states>
<events>
<event name="finished"/>
<event name="errorIdentication"/>
<event name="errorVerification"/>
<event name="errorFileNotSent"/>
<event name="errorRadioLinkSetup"/>
<event name="errorAuthentication"/>
</events>
<transitions>
<transition name="start" startstate="showSetupTaskPage">
<propertymap target="fsm.nbRetries" function="3"/>
</transition>
<!-- discover -->
<transition fromstate="showSetupTaskPage" tostate="discover" event="continue">
<propertymap target="device" function="$app.device"/>
</transition>
<!-- upload files -->
<transition fromstate="discover" tostate="uploadIncludeFiles" event="finished">
<propertymap target="profile" function="$fsm.profile"/>
</transition>
<transition fromstate="uploadIncludeFiles" tostate="uploadLangPack" event="finished">
<propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
</transition>
<transition fromstate="uploadLangPack" tostate="uploadTpl" event="finished">
<!-- output --><propertymap target="fsm.deviceLanguage" function="$deviceLanguage"/>
<propertymap target="profile" function="$fsm.profile"/>
<propertymap target="newInterface" function="$fsm.newInterface"/>
</transition>
<!-- activate new config -->
<transition fromstate="uploadTpl" tostate="activateConfig" event="finished">
<!-- output --><propertymap target="fsm.profile" function="$profile"/>
<propertymap target="device" function="$app.device"/>
</transition>
<!-- restore wireless link -->
<transition fromstate="activateConfig" tostate="configLink" event="failed">
<propertymap target="adaptorManager" function="$fsm.adaptorManager"/>
<propertymap target="ssid" function="$fsm.ssid"/>
<propertymap target="networkKey" function="$fsm.networkKey"/>
<propertymap target="encryptionType" function="$fsm.securityMode"/>
</transition>
<transition fromstate="configLink" tostate="waitForLink" event="success">
<propertymap target="adaptorManager" function="$fsm.adaptorManager"/>
<propertymap target="fsm.nbRetries" function="3"/>
</transition>
<!-- verify -->
<!-- rediscover when activate config succeeded -->
<transition fromstate="activateConfig" tostate="reDiscover" event="finished">
<propertymap target="device" function="$app.device"/>
</transition>
<!-- rediscover when link is up -->
<transition fromstate="waitForLink" tostate="reDiscover" event="radioLinkUp">
<propertymap target="device" function="$app.device"/>
</transition>
<!-- authenticate when no profile found -->
<transition fromstate="uploadTpl" tostate="authenticate" event="noProfile">
<propertymap target="device" function="$app.device"/>
<propertymap target="systemUserid" function="property($app.device,'user')"/>
<propertymap target="systemPassword" function="property($app.device,'password')"/>
<propertymap target="fsm.nbRetries" function="3"/>
</transition>
<!-- authenticate when device rediscovered -->
<transition fromstate="reDiscover" tostate="authenticate" event="finished">
<propertymap target="device" function="$app.device"/>
<propertymap target="systemUserid" function="property($fsm.profile,'%ST_SYS_USERID')"/>
<propertymap target="systemPassword" function="property($fsm.profile,'%ST_SYS_PASSWORD')"/>
<propertymap target="fsm.nbRetries" function="3"/>
</transition>
<!-- invoke CLI's after authentication -->
<transition fromstate="authenticate" tostate="invokeFinalCli" event="finished">
<!-- output --><propertymap target="app.device" function="$device"/>
<propertymap target="device" function="$device"/>
<propertymap target="command" function="concat('language config language ', $fsm.deviceLanguage)"/>
<propertymap target="fsm.nbRetries" function="3"/>
</transition>
<!-- host config -->
<transition fromstate="invokeFinalCli" tostate="hostConfig" event="finished">
<propertymap target="currentInterface" function="property($app.device, 'lanInterface')"/>
<propertymap target="newInterface" function="$fsm.newInterface"/>
</transition>
<transition fromstate="hostConfig" toexit="finished" event="finished|needReboot"/>
<!-- retry mechanism -->
<transition fromstate="configLink" tostate="checkRetry" event="failed">
<propertymap target="fsm.retryState" function="configLink"/>
<propertymap target="fsm.nbRetries" function="add($fsm.nbRetries, -1)"/>
<propertymap target="input2" function="$fsm.nbRetries"/>
</transition>
<transition fromstate="authenticate" tostate="checkRetry" event="failed">
<propertymap target="fsm.retryState" function="authenticate"/>
<propertymap target="fsm.nbRetries" function="add($fsm.nbRetries, -1)"/>
<propertymap target="input2" function="$fsm.nbRetries"/>
</transition>
<transition fromstate="invokeFinalCli" tostate="checkRetry" event="failed">
<propertymap target="fsm.retryState" function="invokeFinalCli"/>
<propertymap target="fsm.nbRetries" function="add($fsm.nbRetries, -1)"/>
<propertymap target="input2" function="$fsm.nbRetries"/>
</transition>
<!-- 0 <= nbRetries; retry -->
<transition fromstate="checkRetry" tostate="returnToState" event="true">
<propertymap target="input" function="$fsm.retryState"/>
</transition>
<!-- 0 > nbRetries; fail -->
<transition fromstate="checkRetry" toexit="errorVerification" event="false"/>
<!-- catch default output -->
<transition fromstate="returnToState" toexit="errorVerification" event="default"/>
<!-- return to configLink -->
<transition fromstate="returnToState" tostate="configLink" event="configLink">
<propertymap target="adaptorManager" function="$fsm.adaptorManager"/>
<propertymap target="ssid" function="$fsm.ssid"/>
<propertymap target="networkKey" function="$fsm.networkKey"/>
<propertymap target="encryptionType" function="$fsm.securityMode"/>
</transition>
<!-- return to authenticate -->
<transition fromstate="returnToState" tostate="authenticate" event="authenticate">
<propertymap target="device" function="$app.device"/>
<propertymap target="systemUserid" function="property($fsm.profile,'%ST_SYS_USERID')"/>
<propertymap target="systemPassword" function="property($fsm.profile,'%ST_SYS_PASSWORD')"/>
</transition>
<!-- return to invokeFinalCli -->
<transition fromstate="returnToState" tostate="invokeFinalCli" event="invokeFinalCli">
<propertymap target="device" function="$device"/>
<propertymap target="command" function="concat('language config language ', $fsm.deviceLanguage)"/>
</transition>
<!-- catch errors -->
<transition fromstate="discover" toexit="errorIdentication" event="failed"/>
<transition fromstate="uploadLangPack" toexit="errorFileNotSent" event="uploadFailed"/>
<transition fromstate="uploadLangPack" toexit="errorIdentication" event="cliFailed"/>
<transition fromstate="uploadTpl" toexit="errorFileNotSent" event="uploadFailed"/>
<transition fromstate="uploadIncludeFiles" toexit="errorFileNotSent" event="failed"/>
<transition fromstate="configLink" toexit="errorVerification" event="notStarted"/>
<transition fromstate="waitForLink" toexit="errorRadioLinkSetup" event="timeout"/>
<transition fromstate="waitForLink" toexit="errorVerification" event="unknown"/>
<transition fromstate="reDiscover" toexit="errorVerification" event="failed"/>
<transition fromstate="authenticate" toexit="errorAuthentication" event="authenticationFailed"/>
</transitions>
</state>
<state type="showPageError" name="errorPage" />
</states>
<events>
<event name="finished"/>
</events>
<transitions>
<transition startstate="setupFsm">
<propertymap target="profile" function="$fsm.profile"/>
<propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
<propertymap target="newInterface" function="$fsm.newInterface"/>
<propertymap target="adaptorManager" function="$fsm.adaptorManager"/>
<propertymap target="ssid" function="$fsm.ssid"/>
<propertymap target="networkKey" function="$fsm.networkKey"/>
<propertymap target="securityMode" function="$fsm.securityMode"/>
</transition>
<!-- success -->
<transition fromstate="setupFsm" toexit="finished" event="finished">
<!-- output --><propertymap target="fsm.profile" function="$profile"/>
</transition>
<!-- catch errors -->
<transition fromstate="setupFsm" tostate="errorPage" event="errorIdentication">
<propertymap target="errorType" function="DevSetupIdentication"/>
</transition>
<transition fromstate="setupFsm" tostate="errorPage" event="errorFileNotSent">
<propertymap target="errorType" function="FileIsNotSent"/>
</transition>
<transition fromstate="setupFsm" tostate="errorPage" event="errorRadioLinkSetup">
<propertymap target="errorType" function="RadioLinkSetup"/>
</transition>
<transition fromstate="setupFsm" tostate="errorPage" event="errorVerification">
<propertymap target="errorType" function="DevSetupVerification"/>
</transition>
<transition fromstate="setupFsm" tostate="errorPage" event="errorAuthentication">
<propertymap target="errorType" function="AuthenticationFailure"/>
</transition>
</transitions>
</fsm>