Share via


How to Send a Data Object to the OBEX Server (Windows CE 5.0)

Send Feedback

To copy a file to the OBEX server, send a data object to the server by using the IObexDevice::Put method. The request can contain 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.

Hardware and Software Assumptions

You have declared pointers to the following interfaces:

To track your progress in the following table, select the check box next to each step.

  Step Topic
1. Enable the client to discover an OBEX device by using IConnectionPointContainer and IObexSink interfaces. Discovering OBEX Devices
2. Retrieve the IObexDevice reference. None.
3. Call the appropriate method of the IHeaderCollection interface to add a header. None.
4. Call the Connect method on the IObexDevice reference to connect to an OBEX server. Connecting to an OBEX Server
5. Call Put to send the data object to the server. This method returns destination pointer to the IStream interface, which is used to write the data. Implementing the Put Operation

Headers to Use with Put Operations

6. Call IStream::Write to write into the stream.
Note   To verify that the Put operation has completed, call IStream::Commit before you close the operation.
Use of Streams
7. Close the connection to the OBEX server by calling the Disconnect on the IObexDevice reference. Disconnecting from an OBEX Server
8. Release all interfaces and allocated resources.
  • Call the IObex::Shutdown method to release IObex.
  • Call the standard COM Release method to release all other interfaces.
None.

See Also

Client Support | How to Request a Data Object from the OBEX Server

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.