top

How to check the firmware version?

Published 2014-10-27 | (Compatible with SDK 5.0,5.1 and 2014 models)

Receiving the device release year and current firmware version from within the app

Some of the SmartTV apps functionalities are available to use only from a specific firmware update or from some specific year release onwards. If your application needs to use one of these features, it is necessary to check the firmware code and if it is lower than required, notify the users to upgrade the firmware.

There are two ways to check the firmware version code:

Source Files

Note

The files needed for the sample application are here.

General case

Add to the index.html file below:

<script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js"></script>

Call the function GetFirmware in main.js (or the window.onShow function):

try {   
    var firmware = webapis.tv.info.getFirmware();
    alert (firmware);

   if (firmware < 'T-INFOLINK2010-1004') {
       throw 'Firmware version is too low';
   }
} catch (e) {
   alert ("Exception(Firmware check): " + e);
   // Firmware version is too low
   return;
}

Using the Application Framework

Add the API library to the index.html file:

<script type='text/javascript' src='$CAPH/1.0.0/caph-level1-unified.min.js'></script>

Call the function GetFirmware in main.js (or the window.onShow function):

try {

   var firmware = caph.platform.dtv.Device.plugin("NNAVI").GetFirmware();
   alert (firmware);
   
   if (firmware < 'T-INFOLINK2010-1004') {
       throw 'Firmware is low';
   }

} catch (e) {

   alert ("Exception(Firmware check): " + e);
   // Firmware version is too low
   return;

}

The GetFirmware function returns a string in the form ‘T-INFOLINKxxxx-yyyyy’, where xxxx is the device release year and yyyy the current Infolink version.

Note

There is no possibility to check the platform-specific firmware code like ‘T-GAPDEUC-10xx’.
The API NNAVI GetFirmware function returns a string in the form ‘T-INFOLINKxxxx-yyyyy’, where xxxx is the device release year and yyyy the current version of Infolink, which is the widget manager engine. If you need only the production year of the device, you can parse the result easily to get it. If your application requires some particular firmware or higher, each firmware update which affects SmartTV apps behavior in a significant way is reflected by a new Infolink version, so it should be sufficient for most cases. Before implementing this function in your application, please check which Infolink version is installed with your current firmware.