OBEX Protocol
   HOME

TheInfoList



OR:

OBEX (abbreviation of OBject EXchange, also termed IrOBEX) is a
communication protocol A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any variation of a physical quantity. The protocol defines the rules, syntax, semantics (computer science), sem ...
that facilitates the exchange of binary objects between devices. It is maintained by the
Infrared Data Association IrDA is a wireless standard designed for exchanging data using infrared (IR). Infrared ports for this purpose have been implemented in portable electronic devices such as mobile telephones, laptops, cameras, printers, and medical devices. The mai ...
but has also been adopted by the
Bluetooth Special Interest Group The Bluetooth Special Interest Group (Bluetooth SIG) is the standards organization that oversees the development of Bluetooth standardization, standards and the licensing of the Bluetooth technologies and trademarks to manufacturers. The SIG i ...
and the
SyncML SyncML, or Synchronization Markup Language, was originally developed as a platform-independent standard for information synchronization. Established by the SyncML Initiative, this project has evolved to become a key component in data synchroniza ...
wing of the
Open Mobile Alliance OMA SpecWorks, previously the Open Mobile Alliance (OMA), is a standards organization which develops open, international technical standards for the mobile phone industry. It is a nonprofit Non-governmental organization (NGO), not a formal govern ...
(OMA). One of OBEX's earliest popular applications was in the Palm III. This PDA and its many successors use OBEX to exchange business cards, data, even applications. Although OBEX was initially designed for infrared, it has now been adopted by
Bluetooth Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks (PANs). In the most widely used mode, transmission power is li ...
, and is also used over
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such as a compu ...
,
USB Universal Serial Bus (USB) is an industry standard, developed by USB Implementers Forum (USB-IF), for digital data transmission and power delivery between many types of electronics. It specifies the architecture, in particular the physical ...
, WAP and in devices such as Livescribe smartpens.


Comparison to HTTP

OBEX is similar in design and function to
HTTP HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
in providing the client with a reliable transport for connecting to a server and may then request or provide objects. But OBEX differs in many important respects: *HTTP is normally layered above a
TCP/IP The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are ...
link. OBEX can also be, but is commonly implemented on an IrLAP/ IrLMP/ Tiny TP stack on an
IrDA IrDA is a wireless standard designed for exchanging data using infrared (IR). Infrared ports for this purpose have been implemented in portable electronic devices such as mobile telephones, laptops, cameras, printers, and medical devices. The mai ...
device. In
Bluetooth Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks (PANs). In the most widely used mode, transmission power is li ...
, OBEX is implemented on a
Baseband In telecommunications and signal processing, baseband is the range of frequencies occupied by a signal that has not been modulated to higher frequencies. Baseband signals typically originate from transducers, converting some other variable into ...
/ ACL/ L2CAP (and, for legacy uses, RFCOMM) stack. Other such "bindings" of OBEX are possible, such as over
USB Universal Serial Bus (USB) is an industry standard, developed by USB Implementers Forum (USB-IF), for digital data transmission and power delivery between many types of electronics. It specifies the architecture, in particular the physical ...
. *HTTP uses human-readable text, but OBEX uses binary-formatted
type–length–value Within communication protocols, TLV (type-length-value or tag-length-value) is an encoding scheme used for informational elements. A TLV-encoded data stream contains code related to the record type, the record value's length, and finally the valu ...
triplets named "Headers" to exchange information about a request or an object. These are much easier to parse by resource-limited devices. *HTTP transactions are inherently stateless; generally an HTTP client opens a connection, makes a single request, receives its response, and either closes the connection or makes other unrelated requests. In OBEX, a single transport connection may bear many related operations. In fact, recent additions to the OBEX specification allow an abruptly closed transaction to be resumed with all state information intact.


Objects

OBEX works by exchanging ''objects'', which are used for a variety of purposes: establishing the parameters of a connection, sending and requesting data, changing the current path or the attributes of a file. Objects are ''fields'' and ''headers''. As an example, the following may be the object used for requesting the phonebook from a mobile: This object contains two fields (command and length) and two headers. The first field (command) specifies that it is a request for data (GET). The second field is the total size of the object, including the two fields. This object also contains two headers, specifically a "Connection ID" and a "Name". The first byte of each header is the header's name and its content type. In this case: * 0xCB means that this header is a "Connection ID", a number obtained previously; the two highest-order bits of 0xCB are 11, and this pair specifies that this as a 4-byte quantity; * the first byte of the second header is 0x01; this byte identifies this header as a "Name" one; the first two bits of 0x01 are 00, meaning that the content of this header is a null-terminated unicode string (in
UCS-2 UTF-16 (16-bit Unicode Transformation Format) is a character encoding that supports all 1,112,064 valid code points of Unicode. The encoding is variable-length as code points are encoded with one or two ''code units''. UTF-16 arose from an earli ...
form), prefixed by the number of bytes it is made of (0x00 0x1e). A possible response, containing the requested data, could be: In this example, the phonebook is assumed short enough to be contained in a single response object. The only header has 0x49 as its identifier, meaning that it is an "End of Body", the last chunk of information (also the only one, in this case). The first two bits of 0x49 are 01, meaning that the content of this header is length-prefixed data: the two next bytes 0x00 0x2F tells the length of this data (in decimal, 47), the succeeding ones are the data, in this case a phonebook comprising only an empty
vCard vCard, also known as VCF ("Virtual Contact File"), is a file format standard for electronic business cards. vCards can be attached to e-mail messages, sent via Multimedia Messaging Service (MMS), on the World Wide Web, instant messaging, N ...
of 47 bytes. This example shows a single GET command and its response, the only headers involved being connection id, name and end-of-body. Before issuing it, a CONNECT command should have been sent for establishing some parameters of the connection, including the connection id. Other commands are: put, setpath, action, abort, disconnect. Some other notable headers include: type, time, description, target.


Session

After the client (e.g., computer) connects to the server (e.g., mobile), a typical session consists in the client sending a number of objects and getting their responses from the server. As an example: * CONNECT: one of the fields specifies the largest size of packets the client can receive; a TARGET header specifies the kind of service the client is expecting (file-browsing, sync-ml, phonebook access); the server answer with its maximal packet length, the connection id, and other data * GET: the client requests a file, specifying the connection id, the file name and/or its type; the server answer with the file content, or just a part of it; in the latter case, the client has to send other GET objects to obtain the rest of the file * SETPATH: the client tells the server to switch to a different file folder, specifying the connection id and the folder name in two headers * GET: the client requests a listing of the folder content by sending an object with the connection id and an appropriate TYPE header (e.g., "x-obex/folder-listing" for file transfer, "x-bt/vcard-listing" for phonebook access) * PUT: the client sends a file to the server; if it is too large to fit into a single packet, the server will request the next part with a CONTINUE response * DISCONNECT: the client informs the server that it is closing the session The exchange may differ significantly depending on the service. For example,
SyncML SyncML, or Synchronization Markup Language, was originally developed as a platform-independent standard for information synchronization. Established by the SyncML Initiative, this project has evolved to become a key component in data synchroniza ...
does not use SETPATH, while an OBEX push is made of just CONNECT (without a TARGET header), PUT and an optional DISCONNECT.


Protocols

The following protocols runs over OBEX, or have bindings to do so: ; OBEX Push : Transfers a file from the originator of the request to the recipient; a CONNECTION object containing no target is sent, then PUT is used to transfer the file ; OBEX File Transfer Protocol : Stores and retrieves files, similar to
FTP The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client–server model architecture using separate control and dat ...
. The target header of the CONNECTION object is ; the response contains the connection id to use in subsequent GET, PUT, SETPATH and ACTION object. ; Phonebook Access : Similar to file transfer, but uses a target ; phonebook entries can be listed (with various possible orderings and filters) and retrieved from certain directories under telecom/ using GET and SETPATH ; IrMC : IrMC was designed for the exchange of phonebook entries, calendar entries, digital business cards, and
to-do list Time management is the process of planning and exercising conscious control of time spent on specific activities—especially to increase effectiveness, efficiency and productivity. Time management involves demands relating to Employment, work, I ...
s. In its connectionless form, a single PUT is used to transfer data; otherwise, various files and folders within telecom/ can be retrieved or pushed; a target header may be used in GET requests to differentiate the kind of indexing used ; SyncML :
SyncML SyncML, or Synchronization Markup Language, was originally developed as a platform-independent standard for information synchronization. Established by the SyncML Initiative, this project has evolved to become a key component in data synchroniza ...
can synchronize phonebooks, calendars, notes, and other data. In its OBEX binding, the target of the CONNECT object is ; a session then consists in a sequence of PUT-GET pairs where nameless
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
or WBXML files are sent and received, in turn.


Implementations


javax.obex

Optional package javax.obex in Java APIs for Bluetooth provides an implementation of OBEX in
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
.


OpenObex

OpenObex is an open-source implementation of OBEX in C. It provides functions for connecting over
IrDA IrDA is a wireless standard designed for exchanging data using infrared (IR). Infrared ports for this purpose have been implemented in portable electronic devices such as mobile telephones, laptops, cameras, printers, and medical devices. The mai ...
,
Bluetooth Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks (PANs). In the most widely used mode, transmission power is li ...
,
USB Universal Serial Bus (USB) is an industry standard, developed by USB Implementers Forum (USB-IF), for digital data transmission and power delivery between many types of electronics. It specifies the architecture, in particular the physical ...
and
TCP/IP The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are ...
, building objects and handling received data. An example schema of a client application is: void callback_function(...) int main() Objects are sent by OBEX_Request. After calling OBEX_HandleInput, received data is processed in the callback function (which was specified when calling OBEX_Init). The callback function can determine whether the response has been completely received, and therefore whether the main program can exit from the while loop it is executing.


PyOBEX and nOBEX

PyOBEX provides partial support for OBEX in Python. nOBEX is a fork of PyOBEX with more complete OBEX support, and support for the Bluetooth Hands Free Profile to facilitate OBEX testing on automotive infotainment systems.nOBEX
/ref>


Profiles

OBEX is the foundation for many higher-layer "profiles":


Supported devices

*Android devices in version 2.1 “Eclair” and above *All
Palm Palm most commonly refers to: * Palm of the hand, the central region of the front of the hand * Palm plants, of family Arecaceae ** List of Arecaceae genera **Palm oil * Several other plants known as "palm" Palm or Palms may also refer to: Music ...
s since Palm III, except webOS devices: the Palm Pre, Palm Pre Plus, Palm Pixi and Palm Pixi Plus. *Most non-Android Sharp,
Motorola Motorola, Inc. () was an American multinational telecommunications company based in Schaumburg, Illinois. It was founded by brothers Paul and Joseph Galvin in 1928 and had been named Motorola since 1947. Many of Motorola's products had been ...
,
Samsung Samsung Group (; stylised as SΛMSUNG) is a South Korean Multinational corporation, multinational manufacturing Conglomerate (company), conglomerate headquartered in the Samsung Town office complex in Seoul. The group consists of numerous a ...
,
Sony Ericsson Sony Mobile Communications Inc., originally Sony Ericsson Mobile Communications AB, was a Multinational corporation, multinational consumer electronics and telecommunications company, best known for its Mobile phones, mobile phone products. The ...
,
HTC HTC Corporation ( zh, t=宏達國際電子股份有限公司, p=Hóngdá Guójì Diànzǐ Gǔfèn Yǒuxiàn Gōngsī, first=t), or High Tech Computer Corporation (abbreviated and trading as HTC), is a Taiwanese consumer electronics corporatio ...
and
Nokia Nokia Corporation is a Finnish multinational corporation, multinational telecommunications industry, telecommunications, technology company, information technology, and consumer electronics corporation, originally established as a pulp mill in 1 ...
phones with
infrared Infrared (IR; sometimes called infrared light) is electromagnetic radiation (EMR) with wavelengths longer than that of visible light but shorter than microwaves. The infrared spectral band begins with the waves that are just longer than those ...
or
Bluetooth Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks (PANs). In the most widely used mode, transmission power is li ...
port. Android devices are supported but this is supposed to be saying that they are supported as well. *LG EnV Touch (VX11000) *Many other PDAs since 2003, until their decline due to being replaced by smartphones *Many other phones with
infrared Infrared (IR; sometimes called infrared light) is electromagnetic radiation (EMR) with wavelengths longer than that of visible light but shorter than microwaves. The infrared spectral band begins with the waves that are just longer than those ...
or
Bluetooth Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks (PANs). In the most widely used mode, transmission power is li ...
port *Windows Phone 7.8 and 8 devices (limited to the transferring of pictures, music and videos via a 'Bluetooth Share' app).


See also

*
Shared file access In computing, a shared resource, or network share, is a computer resource made available from one host to other hosts on a computer network. It is a device or piece of information on a computer that can be remotely accessed from another comput ...
*
List of Bluetooth profiles In order to use Bluetooth, a device must be compatible with the subset of Bluetooth ''profiles'' (often called services or functions) necessary to use the desired services. A Bluetooth profile is a specification regarding an aspect of Bluetooth-b ...


References

{{Reflist


External links


OBEX specification at IrDA.orgBluetooth profiles
including specifications for OBEX and OBEX-based protocols (GOEP, FTP, OBEX push, SYNC)
OpenOBEX
an open source implementation of the OBEX protocol Infrared Data Association Bluetooth