ABOUT FEATURE INTERFACE DEFINITIONS

本文介绍AllJoyn框架中关于设备发现及元数据管理的核心接口定义,包括About和Icon接口的属性、方法及信号等细节,旨在帮助开发者理解如何在设备间进行有效的发现与交互。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文链接:https://allseenalliance.org/framework/documentation/learn/core/about-announcement/interface

 

ABOUT FEATURE INTERFACE DEFINITIONS

Release History

To access a previous version ofthis document, click the release version link below.

Release version

Date

What changed

14.02

2/28/2014

About interface version 1 was added.

14.06

6/30/2014

No updates.

14.06 Update 1

9/29/2014

·         Updated the document title and Overview chapter title (changed from Specification to Definition)

·         Added the release version number to the document title for version tracking.

·         Added a note in the Definition Overview chapter to address the AllSeen Alliance Compliance and Certification program.

·         Added a Mandatory column for method and signal parameters to support the AllSeen Alliance Compliance and Certification program.

14.12

12/17/2014

·         Changed DeviceName from required to not required

·         Additional clarification specifying the AppId must be 128-bit UUID as specified in RFC 4122

·         Cleanup to make requirements for methods and signals more clear

·         Icon interface was added. The icon interface has been part of AllJoyn™ and the About Feature since 14.02; however, the interface definition documentation was not added until 14.12.

Definition Overview

如下图所示,About接口由设备上的一个应用程序来实现。应用程序使用该接口广播自己,以便其他应用程序能够发现它。客户端应用程序和服务端应用程序之间的关系参见下图。


Figure: About feature architecture within the AllJoyn™ framework

注:所有方法和信号都是强制性的,以支持AllSeen联盟的合规和认证计划。

Discovery

应用程序使用无会话信号来发表声明,客户端通过声明来发现应用程序。声明中包括应用程序的基本信息,例如:应用名称,设备名称,制造商,和型号。声明中还包含对象路径和服务框架接口的列表,客户端可据此判断是否有自己感兴趣的功能。

除了无会话声明,About接口还提供了按需方法调用来检索应用程序未公布在声明中的所有可用元数据。

Discovery Call Flows

Typical discovery flow

客户端发现服务器应用的典型流程如下图所示。客户端依赖无会话公告来决定是否连接到服务应用程序,以使用其提供的服务框架。

Figure: Typical discovery flow (client discovers a service app)

Nontypical discovery flow

下图演示客户端搜索服务应用程序,并为获得更详细的信息而发起的请求呼叫流程。


Figure: Nontypical discovery call flow

 

Error Handling

About接口中的方法调用会使用AllJoyn错误信息处理功能(ER_BUS_REPLY_IS_ERROR_MESSAGE)来设置错误名称和错误信息。

Error name

Error message

org.alljoyn.Error.LanguageNotSupported

要求的语言不支持

 

About Interface

Interface name

Version

Secured

Object path

org.alljoyn.About

1

no

/About

Properties

Property name

Signature

List of values

Read/Write

Description

Version

q

正整数

只读

接口的版本号

Methods

BusObject对象提供如下方法来实现org.alljoyn.About 接口.

 

a{sv} GetAboutData('s')

Message arguments/消息参数

Argument

Parameter name

Signature

List of values

Description

0

languageTag

s

IETF RFC 5646标准中定义的语言

期望的语言.

Reply arguments/返回值

Argument

Parameter name

Return signature

Description

0

AboutData

a{sv}

返回可用的元数据域的路径;如果请求的语言不支持(i.e., ""),则返回的元数据域采用默认语言。

Error reply/错误处理

Error

Description

org.alljoyn.Error.LanguageNotSupported

Returned if a language tag is not supported

指定的语言不支持

Description/描述信息

根据指定的语言获得可用的AboutData域列表. see About data interface fields

About data接口域

下表列出了可用元数据域的名字. 其中Announced列为“yes”的域将通过Announce信号发出出来。 参考 Signals 获得更多信息.

Field name

Mandatory

Announced

Localized

Signature

Description

AppId

yes

yes

no

ay

128bit的全球唯一的应用程序标识符。AppId 应该是遵循RFC 4122标准的全局唯一标识符

DefaultLanguage

yes

yes

no

s

设备支持的默认语言. 语言标示遵循RFC 5646标准.

DeviceName

no

yes

yes

s

Name of the device set by platform-specific means (例如Linux 和 Android).

DeviceId

yes

yes

no

s

Device identifier set by platform-specific means.

AppName

yes

yes

yes

s

应用程序制造商(开发者或者OEM)设置的应用程序名称

Manufacturer

yes

yes

yes

s

应用程序制造商

ModelNumber

yes

yes

no

s

应用程序型号

SupportedLanguages

yes

no

no

as

支持的语言列表

Description

yes

no

yes

s

采用RFC 5646.中的语言表述的应用详细描述信息

DateOfManufacture

no

no

no

s

生产日期,格式: YYYY-MM-DD (XML DateTime 格式).

SoftwareVersion

yes

no

no

s

应用软件版本号.

AJSoftwareVersion

yes

no

no

s

应用使用的AllJoyn SDK版本

HardwareVersion

no

no

no

s

硬件设备版本

SupportUrl

no

no

no

s

支持的URL (由制造商指定).

 

a(oas) GetObjectDescription()

Message arguments

None.

Reply arguments

Argument

Parameter name

Return signature

Description

0

objectDescription

a(oas)

返回对象路径,和每个对象实现的所有接口列表

Description

使用该方法来检索获得对象路径,和每个对象实现的所有接口列表

 

Signals

下面的消息由实施org.alljoyn.About 接口的BusObject发出.

Announce('qqa(oas)a{sv}')

Announce信号是一个无会话信号

 

Message arguments/消息参数

Argument

Parameter name

Signature

List of values

Description

0

version

q

positive

About接口的版本号.

1

port

q

positive

应用程序处理传入会话的侦听端口

2

objectDescription

a(oas)

Populated based on announced interfaces

对象路径数组,以及每个对象支持的所有接口列表

3

aboutData

a{sv}

array of key/value pairs

键值对数组

在 About data interface fields 中Announced为“yes”的 所有域都在信号中的该部分给出。

 

AllJoyn Introspection XML

<nodename="/About"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.allseenalliance.org/schemas/introspect.xsd">
   <interfacename="org.alljoyn.About">
      <propertyname="Version"type="q"access="read"/>
      <methodname="GetAboutData">
         <argname="languageTag"type="s"direction="in"/>
         <argname="aboutData"type="a{sv}"direction="out"/>
      </method>
      <methodname="GetObjectDescription">
         <argname="objectDescription"type="a(oas)"direction="out"/>
      </method>
      <signalname="Announce">
         <argname="version"type="q"/>
         <argname="port"type="q"/>
         <argname="objectDescription"type="a(oas)"/>
         <argname="metaData"type="a{sv}"/>
      </signal>
   </interface>
</node>


 

Icon Interface

Interface name

Version

Secured

Object path

org.alljoyn.Icon

1

no

/About/DeviceIcon

Properties

Property name

Signature

List of values

Read/Write

Description

Version

q

正整数

只读

接口的版本号

MimeType

s

The Mime type corresponding to the icon's binary content

只读

图标的Mime类型

Size

u

图标二进制内容的大小(单位:bytes)

只读

图标的大小

Methods

BusObject对象提供下面的方法来实施 org.alljoyn.Icon 接口.

s GetUrl()

Message arguments/消息参数

None.

Reply arguments/返回的参数

Argument

Parameter name

Return signature

Description

0

url

s

如果图标文件处于云(互联网)中,给出它的URL

Description

如果图标文件处于云(互联网)中,通过该方法检索获得它的URL。

ay GetContent()

Argument

Parameter name

Return signature

Description

0

content

ay

图标文件的二进制内容

Signals

None.

AllJoyn Introspection XML

<nodename="/About/DeviceIcon"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.alljoyn.org/schemas/introspect.xsd">
    <interfacename="org.alljoyn.Icon">
        <propertyname="Version"type="q"access="read"/>
        <propertyname="MimeType"type="s"access="read"/>
        <propertyname="Size"type="u"access="read"/>
        <methodname="GetUrl">
            <argtype="s"direction="out"/>
        </method>
        <methodname="GetContent">
            <argtype="ay"direction="out"/>
        </method>
    </interface>
</node>


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值