Difference between revisions of "IR/GSD codes syncronization"

From LinuxMCE
Jump to: navigation, search
m (Any one know if this is still correct?)
Line 1: Line 1:
<table width="100%"> <tr><td bgcolor="#FFCFCF">This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007.  In general any information should apply to LinuxMCE.  However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.</td></tr> </table>To decrease the installation time, the infrared or Ruby codes (who are in fact records from the table pluto_main.InfraredGroup_Command) are fetched from our server through a syncronization script.
+
[[Category: Programmer's Guide]]
 +
To decrease the installation time, the infrared or Ruby codes (who are in fact records from the table pluto_main.InfraredGroup_Command) are fetched from our server through a syncronization script.
  
 
   /usr/pluto/bin/WebDB_GetIR.sh [deviceID] [deviceTemplateID] [restriction flag]
 
   /usr/pluto/bin/WebDB_GetIR.sh [deviceID] [deviceTemplateID] [restriction flag]

Revision as of 18:17, 30 October 2007

To decrease the installation time, the infrared or Ruby codes (who are in fact records from the table pluto_main.InfraredGroup_Command) are fetched from our server through a syncronization script.

 /usr/pluto/bin/WebDB_GetIR.sh [deviceID] [deviceTemplateID] [restriction flag]

Called with deviceID parameter (PK_Device from Device table) will extract the device template from Device (FK_DeviceTemplate) and use it as second parameter. If Device template parameter is provided, device ID is ignored.

The script will wget a mysqldump generated on our server with the codes with the same manufacturer and device category as the device template, and also the codes with the same FK_InfraredGroup as the device template. The output from server will also contain a list with the psc_id (unique key) of the codes, and those with psc_mod = 0 will be deleted and updated with server codes from sqldump.

Restriction flag is used to retrieve the codes only for a specific set of commands (On, Off, 1, vol up, vol down and so on), those used in last step of "add A/V device" wizard.

The synchronization script is called every time a device is created, and its device template had FK_InfraredGroup not null. If the internet connection is not available, the script can be called from LinuxMCE admin, by choosing "Resync codes" from "A/V equipment" or "generic serial devices" pages.

The web interface had an checkbox, to allow the user to override the codes he changed manually. This also act as a backup, if user messed the codes, he can update them with correct versions.