Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
OBject EXchange
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Communication protocol}} {{About|the communications protocol|the portion of the brain|Obex}} {{More citations needed|date=September 2014}} '''OBEX''' (abbreviation of '''OBject EXchange''', also termed '''IrOBEX''') is a [[communication protocol]] that facilitates the exchange of binary objects between devices. It is maintained by the [[Infrared Data Association]] but has also been adopted by the [[Bluetooth Special Interest Group]] and the [[SyncML]] wing of the [[Open Mobile Alliance]] (OMA). One of OBEX's earliest popular applications was in the [[Palm Pilot|Palm III]]. This [[personal digital assistant|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]], and is also used over [[RS-232]], [[USB]], [[Wireless Application Protocol|WAP]] and in devices such as [[Livescribe]] smartpens. ==Comparison to HTTP== OBEX is similar in design and function to [[HTTP]] 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]] link. OBEX can also be, but is commonly implemented on an [[IrLAP]]/[[IrLMP]]/[[Tiny TP]] stack on an [[IrDA]] device. In [[Bluetooth]], OBEX is implemented on a [[Baseband]]/[[Bluetooth protocols#ACL .28Asynchronous Connection Less.29 link|ACL]]/[[Bluetooth protocols#L2CAP .28Logical Link Control and Adaptation Protocol.29|L2CAP]] (and, for legacy uses, [[Bluetooth protocols#RFCOMM .28Radio Frequency Communication.29|RFCOMM]]) stack. Other such "bindings" of OBEX are possible, such as over [[USB]]. *HTTP uses human-readable text, but OBEX uses binary-formatted [[type–length–value]] 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 [[HTTP persistent connection|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: {| class="wikitable" |- ! rowspan=4|Object ! rowspan=2|Fields |Command |GET, Final |0x83 |- |Length |total length of object |{{mono|0x00 0x29}} |- ! rowspan=2|Headers |Connection ID |1 |{{mono|'''0xCB''' 0x00 0x00 0x00 0x01}} |- |Name |"telecom/pb.vcf" |{{mono|'''0x01''' ''0x00 0x1e'' 0x00 0x74 0x00 0x65 0x00 0x6c 0x00 0x65 0x00 0x63 0x00 0x6f 0x00 0x6d 0x00 0x2f 0x00 0x70 0x00 0x62 0x00 0x2e 0x00 0x76 0x00 0x63 0x00 0x66 0x00 0x00}} |} 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]] form), prefixed by the number of bytes it is made of (0x00 0x1e). A possible response, containing the requested data, could be: {| class="wikitable" |- ! rowspan=3|Response ! rowspan=2|Fields |Response code |OK, Final |{{mono|0xA0}} |- |Length |total length of object |{{mono|0x00 0x35}} |- ! rowspan=1|Headers |End-of-Body |{{mono|"BEGIN:VCARD..."}} |{{mono|'''0x49''' ''0x00 0x2F'' 0x42 0x45 0x47 0x49 0x4e 0x3a 0x56 0x43 0x41 0x52 0x44}} |} 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]] 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]] 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 target header of the CONNECTION object is {0xF9, 0xEC, 0x7B, 0xC4, 0x95, 0x3C, 0x11, 0xD2, 0x98, 0x4E, 0x52, 0x54, 0x00, 0xDC, 0x9E, 0x09}; 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 {0x79, 0x61, 0x35, 0xF0, 0xF0, 0xC5, 0x11, 0xD8, 0x09, 0x66, 0x08, 0x00, 0x20, 0x0C, 0x9A, 0x66}; 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]]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 {'I', 'R', 'M', 'C', '-', 'S', 'Y', 'N', 'C'} may be used in GET requests to differentiate the kind of indexing used ; SyncML : [[SyncML]] can synchronize phonebooks, calendars, notes, and other data. In its OBEX binding, the target of the CONNECT object is {'S', 'Y', 'N', 'C', 'M', 'L', '-', 'S', 'Y', 'N', 'C'}; a session then consists in a sequence of PUT-GET pairs where nameless [[XML]] 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 programming language|Java]].<ref>[http://docs.oracle.com/javame/config/cldc/opt-pkgs/api/bluetooth/jsr082/index.html javax.obex API]</ref> ===OpenObex=== OpenObex is an open-source implementation of OBEX in [[C programming language|C]]. It provides functions for connecting over [[IrDA]], [[Bluetooth]], [[USB]] and [[TCP/IP]], building objects and handling received data. An example schema of a client application is: <syntaxhighlight lang="cpp"> void callback_function(...) { /* process received data */ } int main() { OBEX_Init(..., callback_function); OBEX_TransportConnect(...); object = OBEX_ObjectNew(...); OBEX_ObjectAddHeader(object, ...); OBEX_ObjectAddHeader(object, ...); OBEX_Request(..., object); while (...) OBEX_HandleInput(...) object = OBEX_ObjectNew(...); OBEX_ObjectAddHeader(object, ...); OBEX_Request(..., object); while (...) OBEX_HandleInput(...) /* ... */ OBEX_TransportDisconnect(handle); OBEX_Cleanup(handle); } </syntaxhighlight> Objects are sent by <code>OBEX_Request</code>. After calling <code>OBEX_HandleInput</code>, received data is processed in the callback function (which was specified when calling <code>OBEX_Init</code>). The callback function can determine whether the response has been completely received, and therefore whether the main program can exit from the <code>while</code> loop it is executing. ===PyOBEX and nOBEX=== PyOBEX provides partial support for OBEX in [[Python programming language|Python]].<ref>[https://pypi.python.org/pypi/PyOBEX PyOBEX]</ref> nOBEX is a fork of PyOBEX with more complete OBEX support, and support for the Bluetooth [[List of Bluetooth profiles#Hands-Free Profile (HFP)|Hands Free Profile]] to facilitate OBEX testing on automotive infotainment systems.<ref>[https://github.com/nccgroup/nOBEX nOBEX]</ref> ==Profiles== OBEX is the foundation for many higher-layer "profiles": {| class="wikitable" |+Profiles !Classification !Profile |- |rowspan=2|IrDA |Point and Shoot profile |- |[[IrFM|Infrared Financial Messaging (IrFM)]] profile |- |rowspan=6|Bluetooth SIG |[[Bluetooth profiles#Generic Object Exchange Profile .28GOEP.29|Generic Object Exchange Profile]] |- |[[Bluetooth profiles#Object Push Profile .28OPP.29|Object Push Profile]] (phone to phone transfers) |- |[[Bluetooth profiles#File Transfer Profile .28FTP.29|File Transfer Profile]] (phone to PC transfers) |- |[[Bluetooth profiles#Synchronisation Profile .28SYNCH.29|Synchronization Profile]] |- |[[Bluetooth profiles#Basic Imaging Profile .28BIP.29|Basic Imaging Profile]] |- |[[Bluetooth profiles#Basic Printing Profile .28BPP.29|Basic Printing Profile]] |- |OMA |[[SyncML]] binding |} ==Supported devices== *Android devices in version [[Android Eclair|2.1 “Eclair”]] and above *All [[Palm (PDA)|Palm]]s since [[Palm III]], except webOS devices: the Palm Pre, Palm Pre Plus, Palm Pixi and Palm Pixi Plus. *Most non-Android [[Sharp Corporation|Sharp]], [[Motorola]], [[Samsung]], [[Sony Ericsson]], [[HTC Corporation|HTC]] and [[Nokia]] phones with [[infrared]] or [[Bluetooth]] 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]] or [[Bluetooth]] 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]] *[[List of Bluetooth profiles]] ==References== {{Reflist}} ==External links== *[http://www.irda.org/ OBEX specification at IrDA.org] *[https://developer.bluetooth.org/TechnologyOverview/Pages/Profiles.aspx Bluetooth profiles], including specifications for OBEX and OBEX-based protocols (GOEP, FTP, OBEX push, SYNC) *[https://web.archive.org/web/20061209175248/http://www.openobex.org/ OpenOBEX] an open source implementation of the OBEX protocol [[Category:Infrared Data Association]] [[Category:Bluetooth]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:About
(
edit
)
Template:Mono
(
edit
)
Template:More citations needed
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)