Samsung Electronics logo

Accessory Service Profile



The accessory service profile information is provided in an XML file, such as /res/xml/<profile_name>.xml. You must declare the profile XML file path in the config.xml file of your Web application project:

 <webapis:metadata key="AccessoryServicesLocation" value="res/xml/serviceprofile.xml"/>

The following example illustrates the content of the profile XML file, which specifies the accessory service profile details. For more information, see SAAgent API Reference.

<resources>
   <application name = "my application"> 
      <serviceProfile role = "provider" 
                      name = "smartview"  
                      id = "/system/gallery" 
                      version = "2.0"
                      serviceLimit = "ONE_PEERAGENT"
                      serviceTimeout = "30">
         <supportedTransports>
            <transport type = "TRANSPORT_BT"/>
            <transport type = "TRANSPORT_WIFI"/>
         </supportedTransports>
         <serviceChannel id = "100"   
                         dataRate = "high"
                         priority = "low"
                         reliability = "enable"/>
      </serviceProfile>
      <serviceProfile role = "provider" 
                      name = "message_service_provider"  
                      id = "/system/messages" 
                      version = "2.0"
                      autoLaunchAppId = "VcGvmQlo1i.HelloAccessory"
                      serviceLimit = "ANY">
         <supportedTransports>
            <transport type = "TRANSPORT_BT"/>
            <transport type = "TRANSPORT_WIFI"/>
         </supportedTransports>
         <serviceChannel id = "902"   
                         dataRate = "low"
                         priority = "low"
                         reliability = "disable"/>
      </serviceProfile>
   </application>
</resources>

The following attributes and elements are used in the profile XML file:

The following example illustrates the document type definition for the profile XML file.

<!DOCTYPE resources 
[
   <!ELEMENT resources (application)>
   <!ELEMENT application (serviceProfile)+>
   <!ELEMENT serviceProfile (supportedTransports, serviceChannel+) >
   <!ELEMENT supportedTransports (transport)+>
   <!ELEMENT transport EMPTY> 
   <!ELEMENT serviceChannel EMPTY> 
   <!ATTLIST application name CDATA #REQUIRED>
   <!ATTLIST serviceProfile role (PROVIDER | CONSUMER | provider | consumer) #REQUIRED>
   <!ATTLIST serviceProfile name CDATA #REQUIRED>
   <!ATTLIST serviceProfile id CDATA #REQUIRED>
   <!ATTLIST serviceProfile version CDATA #REQUIRED>
   <!ATTLIST serviceProfile autoLaunchAppId CDATA #IMPLIED>
   <!ATTLIST serviceProfile serviceLimit (ANY | ONE_ACCESSORY | ONE_PEERAGENT | 
                                          any | one_accessory | one_peeragent) #IMPLIED>
   <!ATTLIST serviceProfile serviceTimeout CDATA #IMPLIED>
   <!ATTLIST transport type (TRANSPORT_WIFI | TRANSPORT_BT | TRANSPORT_BLE |  
                             TRANSPORT_USB | transport_wifi | transport_bt | transport_ble | 
                             transport_usb) #REQUIRED>
   <!ATTLIST serviceChannel id CDATA #REQUIRED>
   <!ATTLIST serviceChannel dataRate (LOW | HIGH | low | high) #REQUIRED>
   <!ATTLIST serviceChannel priority (LOW | MEDIUM | HIGH | low | medium | high) #REQUIRED>
   <!ATTLIST serviceChannel reliability (ENABLE | DISABLE | enable | disable) #REQUIRED>
]>