Cisco Systems OL-27172-01 Mobility Aid User Manual


 
6-15
Cisco Broadband Access Center 3.8 Administrator Guide
OL-27172-01
Chapter 6 Firmware Management
Using Template Constructs with Firmware Rule Templates
Using Conditionals
Cisco BAC supports powerful conditional expressions in template constructs to enable ultimate
configuration customization. You can use these conditional expression constructs to include or exclude
blocks of text within a template. These construct elements are tc:if, tc:choose, and tc:when. For detailed
information and specific examples on conditionals, see Using Conditionals, page 5-19.
By using conditionals, you can also enable devices to bypass firmware upgrade. If a device does not
match the required conditions specified in the firmware rules template, then the device bypasses an
upgrade. See Example 6-6.
Example 6-6 Firmware Upgrade Bypass
The following is an example of a firmware rule template that describes a firmware upgrade bypass using
the if construct.
If
checkVersion is set to true, the rules check the software version on the device; if the version does not
match, firmware upgrade is bypassed. If
checkVersion is set to false, the rules do not check for the
software version and the device gets instructions on firmware download.
<tc:Template xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tc="urn:com:cisco:bac:common-template" xmlns="urn:com:cisco:bac:firmware-template"
xsi:schemaLocation="urn:com:cisco:bac:common-template CommonTemplateConstructs.xsd">
<FirmwareTemplate>
<ParameterDictionaries>
<ParameterDictionary>tr069-cwmp-dictionary.xml</ParameterDictionary>
</ParameterDictionaries>
<!-- Upgrade rule: if software version is 0.00.22, direct the device to download
sample-firmware-image.bin -->
<!-- devices that do not have software version 0.00.22 , will bypass firmware
upgrade. -->
<FirmwareRule name="LinksysWAG54G2Rule">
<tc:if test="equals(VAR(name=/cpe/checkVersion,defaultValue=false), true)">
<Expression>
<ParameterName>InternetGatewayDevice.DeviceInfo.SoftwareVersion</ParameterName>
<Value>0.00.22</Value>
<Operator>matchIgnoreCase</Operator>
</Expression>
</tc:if>
<InternalFirmwareFile>
<FileName>sample-firmware-image.bin</FileName>
<DeliveryTransport>service http 1</DeliveryTransport>
</InternalFirmwareFile>
</FirmwareRule