OBEX 1.Introduction
1.Introduction
1.1 Tasks, Platforms, and Goals
One of the most basic and desirable(向往的,可取的) uses of the IrDA infrared(红外) communication protocols is simply to send an arbitrary(任意) “thing”, or data object, from one device to another, and to make it easy for both application developers and users to do so. We refer to(参考) this as object exchange (un-capitalized), and it is the subject(主题) of the protocol described in this document.
IrDA红外通信协议最基本的用途,就是在设备之间传递任意数据,并且让开发者和使用者方便使用。我们参考红外通信协议,做成OBEX协议。在这个文档里就要介绍OBEX协议。
This document describes the current status of the protocol OBEX (for IrDA Object Exchange, OBEX for
short). OBEX is a compact(紧凑的), efficient(高效的), binary protocol that enables a wide range of devices to exchange(交换) data in a simple and spontaneous(自然的) manner. OBEX is being defined by members of the Infrared Data Association to interconnect(互联) the full range of devices that support IrDA protocols. It is not, however, limited to use in an IrDA environment。
这个文档介绍OBEX协议的当前状态。OBEX是紧凑的,高效的二进制协议,可以使很多设备用简单和自然的方式交换数据。OBEX就由IrDA成员定义的,只要支持IrDA协议的设备,都可以使用OBEX协议的设备都可以互联,但并不只限于IrDA环境。
OBEX performs a function similar to HTTP, a major protocol underlying the World Wide Web. However,
OBEX works for the many very useful devices that cannot afford(负担的起) the substantial(大量的) resources required for an HTTP server, and it also targets devices with different usage models from the Web. OBEX is enough like HTTP to serve as a compact final hop to a device “not quite” on the Web.
OBEX的行为有点像HTTP协议。然而,很多不能提供HTTP服务的设备也可以使用OBEX 。
A major use of OBEX is a “Push” or “Pull” application, allowing rapid and ubiquitous(无处不在的)communications among portable(便携式) devices or in dynamic environments. For instance, a laptop user pushes a file to another laptop or PDA; an industrial computer pulls status and diagnostic(诊断) information from a piece of factory floor machinery(机械); a digital camera pushes its pictures into a film development kiosk(报刊亭), or if lost can be queried (pulled) for the electronic business card(电子名片) of its owner. However, OBEX is not limited to quick connecttransfer(连接传输)-disconnect scenarios(场景) - it also allows sessions in which transfers take place over a period of time,maintaining the connection even when it is idle.
OBEX的工作方式,类似在各种便携设备之间执行快速的,无处不在的“推”,“拉”操作。比如,
- 一个笔记本用户“推”一个文件给另一个笔记本用户,或者PDA;
- 一台工厂电脑从一台机器设备获取机器的状态和诊断信息;
- 把数码相机里的照片,导入到能够打印照片的机器上;
- 如果丢失电子名片,还可以再次获取
然而,OBEX并不局限于快速连接,然后传输断开的使用场景,它还允许在一段时间内进行传输,即使在空闲时也保持连接。
PCs, pagers(传呼机), PDAs, phones, printers, cameras, auto-tellers(自动取款机), information kiosks, calculators(计算器), data collection devices, watches, home electronics, industrial machinery, medical instruments, automobiles(汽车), and office equipment are all candidates(候选人) for using OBEX. To support this wide variety of platforms, OBEX is designed to transfer flexibly defined “objects”; for example, files, diagnostic information, electronic business cards, bank account balances, electrocardiogram(心电图) strips(条状物), or itemized receipts(收据) at the grocery(杂货店) store. “Object” has no lofty(高大上的) technical meaning here; it is intended(打算) to convey(传递) flexibility in what information
can be transferred. OBEX can also be used for Command and Control functions - directives to TVs,
VCRs(录像机), overhead projectors(投影仪), computers, and machinery. Finally, OBEX can be used to perform complex tasks such as database transactions and synchronization(同步).
个人电脑、寻呼机、掌上电脑、电话、打印机、照相机、自动取款机、信息亭、计算器、数据采集设备、手表、家用电器、工业机械、医疗器械、汽车和办公设备都是使用OBEX的候选设备。
为了支持这种广泛的平台,OBEX被设计成灵活地传输定义的“对象”;例如,文件、诊断信息、电子名片、银行账户余额、心电图条或杂货店的明细收据。这里的Object并没有什么高大上的意义,只是向传达出,可以使用它来灵活地传递任何信息。
OBEX还可以用于使用命令,控制电视、录像机、投影仪、计算机和机械。最后,OBEX可以用来执行复杂的任务,如数据库事务和同步。
OBEX is designed to fulfill(实现) the following major goals:
- Application friendly - provide the key tools for rapid development of applications.
- Compact - minimum strain(重负) on resources of small devices.
- Cross platform.
- Flexible data handling, including data typing and support for standardized types - this will allow
devices to be simpler to use via more intelligent(智能) handling of data inside. - Maps easily into Internet data transfer protocols.
- Extensible( 可扩展的)- provide growth path to future needs like security, compression(压缩), and other extended features without burdening(负担) more constrained(约束) implementations.
- Testable and Debuggable.
OBEX旨在实现以下主要目标:
1,对开发者友好,提供工具,以达到快速开发。
2,尽量减少使用小型设备的资源
3,跨平台
4,灵活的数据处理,包括数据类型和对标准化类型的支持-这将允许设备通过更智能的内部数据处理变得更简单
5,可以容易地和互联网进行数据互换。
6,可扩展的。提供一个途径,来满足未来的需求,比如,安全,可压缩,和一些别的扩展需求,而不必负担过多实现上的约束。
7,可测试,可调试。
1.2 OBEX components
The OBEX specification(规范) consists of two major parts: a protocol and an application framework. The OBEX protocol is a session level protocol that specifies(指定) the structure for the conversation(对话) between devices. It also contains a model for representing(描述) objects. The OBEX application framework is built on top of the OBEX protocol. Its main purpose(目的) is to facilitate(促进) interoperability(互操作性) between devices using the OBEX protocol.Both of these are discussed in more detail below.
OBEX包括2个部分,一个是协议,一个是开发框架。OBEX协议是会话级别的,设备间的通信信息,是结构体形式的。OBEX的开发框架是建立在OBEX协议上的。它的最主要目的是促进设备间的互操作性。
1.2.1 OBEX Session Protocol
The OBEX protocol consists of two major elements: a model for representing objects (and information
that describes the objects), and a session protocol to provide a structure for the “conversation” between
devices. OBEX is a protocol for sending or exchanging objects and control information. In its simplest
form, it is quite compact and requires a small amount of code to implement. It can reside(位于) on top of any reliable(可靠的) transport, such as that provided by IrDA Tiny TP [IRDATTP] (including IrDA Lite
implementations), or TCP/IP stream sockets. OBEX consists of the following pieces:
- An object model that carries(携带) information about the objects being sent, as well as containing the objects themselves. The object model is built entirely(完全地) with parsable headers, similar in concept to the headers in HTTP.
- A session protocol, which structures the dialogue between two devices. The session protocol uses a
binary packet-based client/server request-response model. - An IAS definition and hint bits for the service.
OBEX协议包括2个部分,一个是标识对象的模型,一个是session协议。session协议提供一个结构体,用户设备间通信。OBEX是发送和交换Object或者控制信息的协议。如果使用它的最简单格式,则是非常紧凑且需要尽可能小的代码就可以实现。OBEX可以位于任何可靠传输层协议之上使用,比如IRDATTP,或者TCP/IP。OBEX由以下要素构成:
- 一个object model,既携带被发送的object本身的信息,也包括object自己。object里headers,非常类似http的header
- 使用session协议,来构成设备间通信的窗口。session协议使用二进制数据包,以client/server的方式,接收和相应请求。
1.2.2 OBEX Application Framework
The OBEX application framework is necessary to ensure(确保) interoperability(互操作性) between devices using OBEX. It puts a structure on top of the OBEX protocol. The application framework is the foundation(基础) for a set of standard(标准) OBEX services that satisfy(满足) many object exchange requirements. OBEX implementations are not required to follow the conventions(习俗) specified by the application framework but doing so will ensure(确保)interoperability with other devices. The table below outlines the elements of the OBEX application framework.
为了确保使用OBEX协议的设备间的互操作性,OBEX的application framework是必要的。application framework是满足很多对象交换需求的标准OBEX服务的基础。application framework在OBEX协议上放置structure(结构体)。OBEX的代码实现虽然可以不遵循application framework提出的要求,但是如果遵循了application framework的要求,则可以确保设备间的互操作性。下表列出了OBEX application framework的要素。
Element | Description |
---|---|
OBEX Client | An OBEX Client is the entity that initiates(发起) the underlying(底层) transport connection to an OBEX server and initiates OBEX operations. 由OBEX client发起对OBEX server连接,并启动各种操作。 |
OBEX Server | An OBEX Server is the entity that responds to OBEX operations. The OBEX server waits for the OBEX client to initiate(发起) the underlying transport connection.OBEX server等待client的请求,并负责响应client的请求。 |
Default OBEX Server | The Default OBEX server is the server that resides at the LSAP-Selspecified in the OBEX IAS definition. Other OBEX servers can exist but the Default OBEX server is the “well known” server. This is analogous(类似于) to the HTTP server located at TCP port number 80.默认OBEX server位于LSAP-Selspecified。别的OBEX server也可以存在,但是默认OBEX server是被熟知的,类似于HTTP server使用的就是默认的80端口。 |
OBEX Transport Connection | The OBEX transport connection is the underlying transport connection which carries the OBEX protocol. |
OBEX Connection | An OBEX Connection is a virtual(虚拟) binding between two applications or services. An OBEX connection is initiated(被发起) by sending an OBEX CONNECT packet. Once a connection is established(建立) all operations sent over the connection(在此连接上的操作) are interpreted(被解析) in a continuous(连续的) context |
Directed(定向)Connection | A directed connection is one where the OBEX CONNECT packet contains targeting information which the OBEX protocol uses to connect the client to its intended service or application。定向连接是一个OBEX CONNECT packet ,它包含了client要连接哪个server或application。 |
The Inbox Connection | The inbox(收件箱) connection is the OBEX connection made to the default OBEX server, where the OBEX CONNECT packet does not contain targeting information. A number of services can be accessed via the inbox connection. These services are described later.收件箱连接用户默认OBEX server,收件箱连接的packet里不存在,要连接哪个server的信息。某些服务可以用inbox connection来访问。这些特定的服务后面会介绍。 |
Inbox | The inbox is the intended(预期的) recipient(收件人) of a client push operation over the Inbox Connection. 收件箱里放的是预期的client,通过Inbox Connection发送给收件人的操作。The inbox does not have to be an actual storage location.它不需要实际的存储位置。 It is really a method for encapsulating the concept that the client pushes an object to a recipient without the need to understand the details of how the recipient stores the object.它实际封装了client发送给收件人的object,而且不需要知道收件人如何存储这些object。 |
Application | An OBEX application communicates using a proprietary(专用的) method known only by the manufacturer(制造商). OBEX application之间的通信,是由制造商提供的专用方法,这种方法只要制造商才知道。Such applications can only expect to be understood by exact peers. 所以这些application只能够被同样规格的application解释。Alternatively, an application may be a service with proprietary extensions. 或者让application变成一个专用的service。In this case the application must know if it is communicating with a service or application peer.如果application变成了专用的service,则必须知道通信的对方是一个service还是一个同样规格的application。 |
Service | An OBEX service communicates using procedures specified in a publicly(公共) available standard. Such as in IrMC or this specification(规范).OBEX service使用公共标准指定的程序,来进行通信。比如IrMC和这里的规范。 |
Capability Service | The capability(能力) service is used to find information about the OBEX server including device information, types of objects supported(支持的object类型), object profiles and supported applications. |
1.3 Relation to other IrDA protocols
The following figure illustrates(说明) where OBEX fits(适合) into the overall(总体的) scheme(方案) of IrDA software
The above figure places(放) OBEX within the IrDA protocol hierarchy, but it could just as well appear above some other transport layer that provides reliable(可靠的) flow-controlled(流量控制) connections. Connection oriented(面向)operation over IrDA protocols uses Tiny TP flow control to allow for multiple logical connections, including simultaneous(同时) OBEX client/server sessions in both directions.
上图把OBEX放在了IrDA协议等级里,但它也可以出现在别的可靠的传输层之上。在IrDA协议上面向操作的连接使用Tiny TP的流量控制,以达到多个逻辑连接的效果,在client和server上实现双向全双工通信。
1.4 Specification versus Implementation(规范与实现)
This description does not specify any implementation of the protocol; only the requirements that the
implementation must embody(必须要被实现的). In particular(特别地), this specification does not specify APIs at either the top or bottom boundaries(顶部和底部边界). The primary OBEX context assumes (假设)a lower protocol layer that supports reliable data interchange(交换) with other devices (as provided by [IRDATTP]).
规范不包括协议的具体实现方法,只包括必须要被实现的部分。特别地,规范不指定顶部或底部的API。OBEX上下文,假设它下面的协议层必须支持可靠的数据交换功能(比如IRDATTP提供的)。
1.4.1 Mapping OBEX packets to TinyTP/IrLMP packets
There is no requirement on the alignment(对齐要求) of OBEX packets within TinyTP or IrLMP PDUs (packets).Except(除了) that all OBEX data shall be carried in data packets, not in TinyTP/IrLMP Connect or Disconnect packets. OBEX specifically does not use Tiny TP segmentation(分割) and reassembly(重新组装). There is no relationship between OBEX packets and TTP-SDUs. Therefore, the TinyTP Connect packet should not use the MaxSduSize parameter.
包装在TinyTP or IrLMP PDU数据包里的OBEX数据包,没有字节对齐的要求。除了OBEX的数据包外,其他的东西不要放在TinyTP/IrLMP的连接和断开连接的数据包里。OBEX特别的不需要使用TinyTP的数据分割和重新组装功能。OBEX packets 和TTP-SDUs没有任何关联。因此TinyTP 连接packet里不应该使用MaxSduSize 参数。
1.5 References
- IRDALAP:Serial Infrared Link Access Protocol, IrLAP, Version 1.1, Infrared Data Association
- IRDALMP:Link Management Protocol, IrLMP, Version 1.1, Infrared Data Association
- IRDACOM:Serial and parallel port emulation, IrCOMM, Version 1.0, Infrared Data Association
- IRDATTP: Tiny Transport Protocol, TinyTP, Version 1.1, Infrared Data Association
- IRDAIAS:IrLMP Hint Bit Assignments and Known IAS Definitions, Ver 1.0, IrDA
- HTTP1.1: HTTP v1.1, HTTP 1.1 working group
- IANAREG :IANA media type registry
- MIME :Multipurpose Internet Mail Extensions
- IRMC: Infrared Data Association Specifications for Ir Mobile Communications (IrMC) Version 1.1
- DATES: ISO 8601:1988, Data elements and interchange formats - Information interchange -Representation of dates and times
- LANG:ISO 639:1988 (E/F), Code for the representation of names of languages