OBEX 5-6

下面是用翻译软件翻译的

5. Using OBEX over IrDA Ultra-Lite (Connectionless use)

OBEX is constructed to take advantage of(利用。。。的优点) the benefits of a connection-oriented transport, for instance by exchanging capabilities and version information just once in the CONNECT packet. However, some devices support only connectionless operations, suer, it does use IrLAP framing, which has a CRC, so it is possible to tell if an individual packet arrived intact(完整的). It also uses a segmentation-reassembly(分段重组) (SAR) counter in each packet header, and a maximum time constraint(限制) between consecutive(连续不断的) packets using SAR.
The count allows up to 15 packets to be reassembled(重新组装). The CRC and SAR acting together put a maximum upper bound on the size of an Ultra OBEX packet of 15 times the max packet size permitted by the link
speed of either 2400 or 9600 bps. Connectionless IrLAP packets are limited to 64 bytes, of which 2 bytes
are used by IrLMP and 2 bytes are used by the PID and SAR fields. Thus leaving 15 packets of 60 bytes
(900 bytes total) for use by Ultra OBEX. In practice, transfers of 15 packets will take too long, and Ultra
OBEX is best suited for very small objects that will fit in one (or a few) packets. A typical well-suited
operation would be beaming a single name and phone number between two devices.

OBEX的构造是为了利用面向连接的传输的优点,例如通过在CONNECT包中只交换一次功能和版本信息。然而,有些设备只支持无连接操作,但是,它确实使用IrLAP帧,它有一个CRC,所以可以判断单个包是否完整到达。它还使用分段重组计数器在每个packet的header里,和packet和packet间的最大时间限制。

CRC和SAR共同作用,为超OBEX包的大小设置了一个最大上限,该上限是2400或9600bps链路速度所允许的最大包大小的15倍。无连接的IrLAP数据包被限制为64个字节,其中2个字节由IrLMP使用,2个字节由PID和SAR字段使用。这样就留下了15个60字节(总共900字节)的数据包供Ultra OBEX使用。实际上,传输15个数据包需要太长时间,而Ultra OBEX最适合只容纳一个(或几个)数据包的非常小的对象。一个典型的非常适合的操作是在两个设备之间传送一个名字和电话号码

Ultra OBEX uses only the OBEX PUT command and all object data and headers must be sent in one
OBEX packet. The packet must have the final-bit set and all object data is contained in a single End-of-
Body header. Minimum implementations of Ultra OBEX need only support the default OBEX packet size
of 255 bytes. Legal implementations can however, support up to the maximum Ultra OBEX packet size of
900 bytes. For compatibility, it is recommended that devices do not send more than 255 bytes over Ultra.
To guarantee a successful transfer of data over Ultra, the exchange should be kept to 255 bytes or less .
This includes all headers. The data should be contained in one OBEX packet. Meaning the first and only
frame contains the PUT+FINAL opcode.

Ultra OBEX只使用OBEX PUT命令,所有对象数据和头都必须在一个OBEX包中发送。数据包必须有最后的位集,所有的对象数据都包含在一个单端的正文头中。Ultra OBEX的最小实现只需要支持默认的OBEX数据包大小255字节。但是,法律实现可以支持最大为900字节的Ultra OBEX数据包大小。为了兼容性,建议设备通过Ultra发送的字节数不要超过255个。为保证在Ultra上成功传输数据,交换应保持在255字节或更少。这包括所有标题。数据应该包含在一个OBEX包中。这意味着第一个也是唯一一个帧包含PUT+FINAL操作码。

NOTE: Implementations are not required to receive OBEX packets larger than 255 bytes. Possible ways
that implementations can deal with Ultra OBEX packets larger than 255 bytes is as follows:

注意:实现不需要接收大于255字节的OBEX数据包。实现可以处理大于255字节的Ultra OBEX数据包的可能方法如下:

  • Ignore the packet completely
  • Only accept the first 255 bytes
  • Accept the whole packet.

The OBEX CONNECT, DISCONNECT, ABORT and SETPATH operations are not used in Ultra OBEX,
because Ultra OBEX does not have any notion of a session with multiple operations. Each operation is
completely distinct from every other, and each operation must fit within the SAR constraint described
above. Therefore, any version or capability information must be included as headers in the operation
being performed.
Ultra OBEX does not use any response packets. All feedback as to the success or failure of the operation
is performed by some out-of-band means such as a beep or visual indication to the user that the
operation was successful. For this reason, the OBEX GET operation is also not used in Ultra OBEX.

在Ultra OBEX中不使用OBEX CONNECT、DISCONNECT、ABORT和SETPATH操作,因为Ultra OBEX没有任何包含多个操作的会话的概念。每个操作彼此完全不同,并且每个操作必须符合上面描述的SAR约束。因此,任何版本或功能信息都必须作为标头包含在正在执行的操作中。Ultra OBEX不使用任何响应包。所有关于操作成功或失败的反馈都是通过一些带外方式来执行的,例如哔声或向用户显示操作成功的视觉指示。因此,OBEX GET操作也不用于Ultra OBEX。

6. IrDA OBEX IAS entries, service hint bit and TCP Port number

6.1 IAS entry

The default IrDA OBEX server application must have an IAS entry with the following attribute.

默认的IrDA OBEX服务器应用程序必须具有具有以下属性的IAS属性。

Class OBEX {
Integer IrDA:TinyTP:LsapSel IrLMP LSAP selector, legal values from Ox00 to 0x6F
}
There should be only one such entry on a system, or it may be impossible for an incoming connection to
decide who to connect to except by flipping a coin.

一个系统上应该只有一个这样的条目,否则传入的连接可能不可能决定连接到谁,除非掷硬币。

The OBEX class name should be used only by implementations that are intended as default OBEX
servers, and in particular have some provision for dealing with multiple object types and services. Special
purpose programs (custom applications) that use this protocol should define unique IAS class names that
they alone will use. Alternatively, special purpose applications can be accessed via the default OBEX
server by utilizing a directed connection as discussed in this specification. There is one very common
subset of object exchange application - applications that are strictly for file exchange. They should use a
class name of OBEX:IrXfer.

OBEX类名应该只由打算作为默认OBEX服务器的实现使用,特别是对于处理多个对象类型和服务有一些规定。使用此协议的特殊用途程序(自定义应用程序)应定义单独使用的唯一IAS类名。或者,通过使用本规范中讨论的定向连接,可以通过默认的OBEX服务器访问特殊用途的应用程序。对象交换应用程序有一个非常常见的子集,即严格用于文件交换的应用程序。它们应该使用类名OBEX:IrXfer。

A general purpose OBEX implementation should look first for an OBEX IAS object, and if not found then
look for an OBEX:IrXfer entry if the object can reasonably be represented as a file. Similarly, a special
purpose program using OBEX should look first for a strict peer using whatever class name the peer
normally uses, and if not found should look for the default OBEX server to accept the transfer.

一般用途的OBEX实现应该首先查找obex ias对象,如果找不到,则查找OBEX:IrXfer条目如果对象可以合理地表示为一个文件。类似地,使用OBEX的特殊用途程序应该首先查找使用该对等机通常使用的类名的严格对等机,如果找不到,则应该查找默认的OBEX服务器来接受传输。

6.1.1 IrDA:TinyTP:LsapSel

This attribute contains the TinyTP/IrLMP MUX channel number for the service. This attribute must be
present for connection oriented use, whatever the class name is.

此属性包含服务的TinyTP/IrLMP MUX通道号。无论类名是什么,这个属性必须是面向连接的。

6.2 Service Hint bits

The OBEX IrLMP service hint bit has a value of 0x20 in the second hint byte. See section 3.4.1.1 in
[IRDALMP] specification for the definition of service hint bits and [IRDAIAS] for the complete listing of
service hint bits. Setting the OBEX hint bit is required. Many OBEX clients will not even attempt a
connection unless the OBEX hint bit is set.

OBEX IrLMP服务提示位在第二个提示字节中的值为0x20。有关服务提示位的定义,请参阅[IrDAMP]规范中的3.4.1.1节;有关服务提示位的完整列表,请参阅[IRDAIAS]。需要设置OBEX提示位。许多OBEX客户端甚至不会尝试连接,除非设置了OBEX提示位。

6.3 TCP port number

IANA has assigned the port number 650 to the OBEX protocol. This port number should be used when
transporting OBEX protocol data over a TCP network. More specifically, it represents the location of the
default OBEX server in the TCP network. As with TinyTP, there is no requirement on the alignment of
OBEX packets with TCP PDUs. Except that all OBEX data shall be carried in data packets, not in TCP
Connect or Disconnect packets.

IANA已将端口号650分配给OBEX协议。在TCP网络上传输OBEX协议数据时,应使用此端口号。更具体地说,它表示TCP网络中默认OBEX服务器的位置。与TinyTP一样,对OBEX包与TCP pdu的对齐没有要求。但所有OBEX数据应以数据包的形式传输,而不是以TCP连接或断开数据包的形式传输。

c/c++ 学习互助QQ群:877684253

本人微信:xiaoshitou5854

posted @ 2020-07-07 18:33  小石王  阅读(228)  评论(0编辑  收藏  举报