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
(section)
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!
==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.
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)