Sending a Data Object to the OBEX Server
The Put method is used to copy a file to the server. The request contains the Name and Length headers, however, if the target device is so simple that it accepts only one object, the headers may be omitted. If the server is a desktop computer, personal digital assistant (PDA), or any other general-purpose device, headers are highly recommended.
The following illustration shows the logic associated with a Put command.
The following optional headers are included in the Put request packet:
- Name identifies the name of the object being returned, if applicable.
- Length defines length of the object being returned.
- Time includes the header timestamp information.
- Type defines the object type. Types are of the MIME format, such as text/html, x-obex/object-profile, text/x-vCard, and others.
- Body includes data.
- EndOfBody marks the end of the body.
The following header is always used:
- Connection Id identifies the connection identifier returned in the connect response. If a connect command was not issued, a default connection is assumed.
Headers are not included in the Put response packet. The response code can be one of the following:
- Error in the case of failure
- Continue for intermediate packets
- Success for the final packet
The response to any individual request packet must consist of one packet. Multipacket Put responses are not supported.
If the length field of the response code is greater than three, the response includes headers. Unknown response codes indicate failure.
See Also
Last updated on Friday, April 09, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.