原文链接: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 |
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 |
| 1 | no |
|
Properties
Property name | Signature | List of values | Read/Write | Description |
Version |
| 正整数 | 只读 | 接口的版本号 |
Methods
BusObject对象提供如下方法来实现org.alljoyn.About
接口.
a{sv} GetAboutData('s')
Message arguments/消息参数
Argument | Parameter name | Signature | List of values | Description |
0 |
|
| IETF RFC 5646标准中定义的语言 | 期望的语言. |
Reply arguments/返回值
Argument | Parameter name | Return signature | Description |
0 |
|
| 返回可用的元数据域的路径;如果请求的语言不支持(i.e., ""),则返回的元数据域采用默认语言。 |
Error reply/错误处理
Error | Description |
| 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 |
| yes | yes | no |
| 128bit的全球唯一的应用程序标识符。AppId 应该是遵循RFC 4122标准的全局唯一标识符 |
| yes | yes | no |
| 设备支持的默认语言. 语言标示遵循RFC 5646标准. |
| no | yes | yes |
| Name of the device set by platform-specific means (例如Linux 和 Android). |
| yes | yes | no |
| Device identifier set by platform-specific means. |
| yes | yes | yes |
| 应用程序制造商(开发者或者OEM)设置的应用程序名称 |
| yes | yes | yes |
| 应用程序制造商 |
| yes | yes | no |
| 应用程序型号 |
| yes | no | no |
| 支持的语言列表 |
| yes | no | yes |
| 采用RFC 5646.中的语言表述的应用详细描述信息 |
| no | no | no |
| 生产日期,格式: YYYY-MM-DD (XML DateTime 格式). |
| yes | no | no |
| 应用软件版本号. |
| yes | no | no |
| 应用使用的AllJoyn SDK版本 |
| no | no | no |
| 硬件设备版本 |
| no | no | no |
| 支持的URL (由制造商指定). |
a(oas) GetObjectDescription()
Message arguments
None.
Reply arguments
Argument | Parameter name | Return signature | Description |
0 |
|
| 返回对象路径,和每个对象实现的所有接口列表 |
Description
使用该方法来检索获得对象路径,和每个对象实现的所有接口列表
Signals
下面的消息由实施org.alljoyn.About
接口的BusObject发出.
Announce('qqa(oas)a{sv}')
Announce信号是一个无会话信号
Message arguments/消息参数
Argument | Parameter name | Signature | List of values | Description |
0 |
|
| positive | About接口的版本号. |
1 |
|
| positive | 应用程序处理传入会话的侦听端口 |
2 |
|
| Populated based on announced interfaces | 对象路径数组,以及每个对象支持的所有接口列表 |
3 |
|
| 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 |
| 1 | no |
|
Properties
Property name | Signature | List of values | Read/Write | Description |
|
| 正整数 | 只读 | 接口的版本号 |
|
| The Mime type corresponding to the icon's binary content | 只读 | 图标的Mime类型 |
|
| 图标二进制内容的大小(单位:bytes) | 只读 | 图标的大小 |
Methods
BusObject对象提供下面的方法来实施 org.alljoyn.Icon
接口.
s GetUrl()
Message arguments/消息参数
None.
Reply arguments/返回的参数
Argument | Parameter name | Return signature | Description |
0 |
|
| 如果图标文件处于云(互联网)中,给出它的URL |
Description
如果图标文件处于云(互联网)中,通过该方法检索获得它的URL。
ay GetContent()
Argument | Parameter name | Return signature | Description |
0 |
|
| 图标文件的二进制内容 |
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>