Searching...

Matching results

    Samples

    Initializing Table Of Contents...

    Introduction

    This section describes several applications type for Open AT or Mihini.

    You can find a description about the data and command the previous section.

    3rd Party devices using MQTT library

    This section explains how to create a model for any 3rd party device using MQTT to communicate with AirVantage. As the device management for these devices are not supported, no application manager is defined.

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <app:application 
            xmlns:app="http://www.sierrawireless.com/airvantage/application/1.0" 
            type="com.test.airvantage.app" 
            name="AirVantage Greenhouse"
            revision="0.0.1">
     <capabilities>
    
      <communication>
       <protocol comm-id="SERIAL" type="MQTT" />
      </communication>
    
      <data>
       <encoding type="MQTT">
        <asset default-label="Greenhouse" id="machine">
          <variable default-label="Temperature" path="temperature" 
                                          type="double"/>
          <variable default-label="Luminosity" path="luminosity" 
                                          type="double"/>
          <setting default-label="Threshold" path="threshold" 
                                          type="int"/>
         </asset>
       </encoding>
      </data>
      </capabilities>
    </app:application>
    

    Open AT application using the AirVantage Connector

    This section explains how to create a model of your Open AT application.

         <app:application xmlns:app="http://www.sierrawireless.com/airvantage/application/1.0" 
             type="MyApp" 
             name="My application" 
             revision="1.0.0">
    
             <capabilities>
                 <communication>
                     <protocol comm-id="IMEI" type="M3DA">
                         <parameter name="authentication" value="none" />
                         <parameter name="cipher" value="none" />
                     </protocol>
                 </communication>
    
                 <include>
                     <!-- The business application data and commands. -->
                     <file name="application.cp" />
                 </include>
    
             </capabilities>
    
             <application-manager use="SOFT_IDS" />
    
             <binaries>
                 <binary file="AVSampleDemo.dwl" />
             </binaries>
    
         </app:application>
    

    The application.cp describes the business data and command. These data and commands must be managed by the business application. For example, for the AVSampleDemo sample, the application.cp file looks like:

         <?xml version="1.0" encoding="ISO-8859-1" ?>
         <app:capabilities
             xmlns:app="http://www.sierrawireless.com/airvantage/application/1.0">
             <data>
                 <encoding type="M3DA">
                     <asset default-label="AVSampleDemo" id="MyAsset">
                         <variable path="message" type="string" default-label="Test message"/>  
                         <setting path="setting" type="int" default-label="Test setting" />                  
        
                         <node path="0" default-label="events">
                             <event path="100" default-label="MESSAGE_SET" />
                         </node>
                
                         <command path="setMessage" default-label="Set message">
                             <parameter id="message" default-label="Message" type="string" />
                         </command>
                     </asset>
                 </encoding>
             </data>
         </app:capabilities>
    

    Mihini: AirVantage Agent

    This section explains how to create an application model for an application using the AirVantage Agent.

    In the sample, the serial number is defined. So you need to define it when creating a system on AirVantage.

         <?xml version="1.0" encoding="ISO-8859-1"?>
         <app:application xmlns:app="http://www.sierrawireless.com/airvantage/application/1.0" type="asset01" name="Agent_R8.0_asset01" revision="1.0">
    
             <capabilities>
                 <communication>
                     <protocol comm-id="SERIAL" type="M3DA" >
                         <parameter name="authentication" value="none" />
                         <parameter name="cipher" value="none" />
                     </protocol>
                 </communication>
    
                 <!-- external variables definition -->
                 <include>
                     <file name="readyagent_datamodel.cp" />            
                 </include>
            
                 <!-- Device management commands provided by ReadyAgent-->
                 <dm>
                     <action impl="MIHINI_DM_REBOOT" />
                     <action impl="MIHINI_CONFIGURE_HEARTBEAT" />
                     <action impl="MIHINI_DM_SYNCHRONIZE" />
                     <action impl="MIHINI_DM_RESET" />  <!-- Reset To Factory Default -->          
                     <action impl="MIHINI_APPCON_INSTALL" />
                     <action impl="MIHINI_APPCON_UNINSTALL" />
                     <action impl="MIHINI_APPCON_START" />
                     <action impl="MIHINI_APPCON_STOP" />            
                     <action impl="MIHINI_APPCON_STATUS" /> 
                     <action impl="MIHINI_ASSET_INSTALL" /> 
                 </dm>
    
             </capabilities>
    
             <application-manager use="MIHINI_APPCON" />
        
             <binaries>
                 <binary file="install.tar"/>
             </binaries>
    
         </app:application>
    

    If you wish to use the security feature, please have a look to the Mihini page about security.

    Application model for ALEOS/AAF

    The application model can be edited by the Model editor included in the Developer Studio for ALEOS:

    1. In the project explorer, do a right click and select New > Data model
    2. In the editor, you can add Asset, node, variables, …
    3. Once the model is written, you can generate it by using the Export item in the contextual menu in the project explorer view. Then you must select AirVantage package.
    4. Finally, you select your project, define the version number and the location where to generate the package.

    The application model looks like:

         <?xml version="1.0" encoding="ISO-8859-1"?>
         <app:application type="AVSampleGX400" name="AVSampleDemo for GX400" revision="1.0">
         
             <capabilities>
               <communication use="aleos"/>
               <data>
                 <encoding type="M3DA">
                     <asset default-label="AVSampleDemo" id="MyAsset">
                         <variable path="message" type="string" default-label="Test message"/>  
                         <setting path="setting" type="int" default-label="Test setting" />                  
               
                         <command path="setMessage" default-label="Set message">
                             <parameter id="message" default-label="Message" type="string" />
                         </command>
                     </asset>
                 </encoding>
               </data>
             </capabilities>
         
             <application-manager use="MIHINI_APPCON" />
             
             <binaries>
                 <binary file="bin.tar"/>
             </binaries>
         
         </app:application>
    

    How to create an application model for a Mihini application?

    The design of your application model can be done in 5 steps:

    1. Define the communication protocol supported by AirVantage you want to use. See section Communication section protocols.
    2. Define the data model for your application in cp file(s). See section Application Data: Tree Elements.
    3. Define the device management commands supported by your device. See section Capabilities.
    4. Define the application manager. See section Application Manager.
    5. Define the binary files (full, delta and reverse delta if needed). See section Binaries.
    TOP