Announcement

Collapse
No announcement yet.

sample 3 - xcr

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • sample 3 - xcr

    Hi,

    I have a problem with sample 3(ok not realy with sample 3 but this is good way to explain it).
    The problem is that config record (upper/lower) is not saved betwhen reboots... ( I change it and then use the write command one level up)

    I change the code a bit to put add tlog lines on sampleXMLCfgImportTestSetItem and on SampleXMLCfgImport and I never saw them....

    Any Ideas why??

    best regards
    --------------------------------------
    Nuno Leit?o
    Senior Field Applications Engineer

    Datelka (Portugal)

    http://www.datelka.pt

  • #2
    Implementing persistent configuration

    Right, it does not work because persistent storage was not designed into sample 3.

    You can make your configuration persistent by keeping your information in a file on the Flash file system.

    For example, use a file named "sample3.cfg". The format on the file is up to you. To keep this explanation simple, let's say you will write a single character to the file, T or F, to represent true or false. Here are your steps to make it work:
    1) In SampleApp, add code to read the first character from "sample3.cfg" and set translateToUpper to 1 if it is a T, or 0 otherwise.
    2) In sampleXMLCfgImportTestSetItem, after the line "translateToUpper = tmpValue;", add code to write to "sample3.cfg" either a T or F as appropriate.

    That's it!

    Comment


    • #3
      Hi,

      yes I know that solution, but since we have entry points to read and write to the xml config file, that solution is a little bit strange..........

      If I use that solution I also have to monitor the ftp server to saw if there is a new file comming to reload the values...... (and that is already done for the xcr....)

      It is a little bit cleaner if you call SDKXMLImportConfigSetup before you load the xml file for the first time.....

      And I only use the sample 3 as example. This is part of the configuration groups for my project

      HTML Code:
      - <configgroup name="axcom">
      - <configitem name="hostlist">
        <value>0.0.0.0</value> 
        <value>0.0.0.0</value> 
        <value>0.0.0.0</value> 
        <value>0.0.0.0</value> 
        <value>0.0.0.0</value> 
        <value>0.0.0.0</value> 
        <value>0.0.0.0</value> 
        <value>0.0.0.0</value> 
        </configitem>
      - <configitem name="watchDog">
        <value>75</value> 
        </configitem>
      - <configitem name="UDPServer">
        <value name="LocalPort">43711</value> 
        </configitem>
      - <configitem name="Logger">
        <value name="LocalPort">43777</value> 
        </configitem>
      - <configitem name="IOsTIn">
        <value>1</value> 
        <value>2</value> 
        <value>3</value> 
        <value>16</value> 
        <value>32</value> 
        <value>48</value> 
        </configitem>
      - <configitem name="IOsTOut">
        <value>1</value> 
        <value>2</value> 
        <value>3</value> 
        <value>16</value> 
        <value>32</value> 
        <value>48</value> 
        </configitem>
      - <configitem name="IOsIActStt">
        <value>0</value> 
        <value>0</value> 
        <value>0</value> 
        <value>0</value> 
        <value>0</value> 
        <value>0</value> 
        </configitem>
      - <configitem name="IOsOActStt">
        <value>0</value> 
        <value>0</value> 
        <value>0</value> 
        <value>0</value> 
        <value>0</value> 
        <value>0</value> 
        </configitem>
      - <configitem name="IOsPorta1">
        <value name="VideoType">0</value> 
        <value name="AlarmeIType">0</value> 
        <value name="AlarmeOType">0</value> 
        <value name="DoorType">0</value> 
        <value name="TAbr">2</value> 
        <value name="TAuth">3</value> 
        </configitem>
      - <configitem name="IOsPorta2">
        <value name="VideoType">0</value> 
        <value name="AlarmeIType">0</value> 
        <value name="AlarmeOType">0</value> 
        <value name="DoorType">0</value> 
        <value name="TAbr">2</value> 
        <value name="TAuth">3</value> 
        </configitem>
      - <configitem name="IOsPorts">
        <value name="LocalPort">43711</value> 
        <value name="RemotePort">43711</value> 
        </configitem>
        </configgroup>
      --------------------------------------
      Nuno Leit?o
      Senior Field Applications Engineer

      Datelka (Portugal)

      http://www.datelka.pt

      Comment


      • #4
        XML API is for external communications only

        The XPort-AR uses a hidden file with a proprietary format to represent all of its configured settings. The XML is only used to communicate to or from the outside. The answer I gave you is what the product actually does.

        It is true, if you are willing to store your XML file as your device configuration in the local file system, then it is possible to use it as your persistent storage. To make that work, you would need to:
        1) Add a step to write your desired XML file to the local file system.
        2) Upon your SDK initialization, import that XML file to cause all of your registered XML configuration code to be called.

        However, this would make the process different for updating your XML configuration versus the base XPort-AR configuration, so I would not recommend it.

        Comment

        Working...
        X