Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
To copy a file to the OBEX server, send a data object to the server by using the IObexDevice::Putmethod. 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:
-
IObex:IUnknown. Used for the OBEX services.
-
IHeaderCollection:IUnknown. Used to create header collections.
-
IObexDevice:IUnknown. Used to execute common operations.
-
IStream.
Used to manage data streams between devices.
Steps
Step | Topic | ||
---|---|---|---|
1. Enable the client to discover an OBEX device by using IConnectionPointContainerand IObexSink:IUnknowninterfaces. |
|||
2. Retrieve the IObexDevicereference. |
None. |
||
3. Call the appropriate method of the IHeaderCollectioninterface to add a header.
|
None. |
||
4. Call the IObexDevice::Connectmethod on the IObexDevicereference to connect to an OBEX server. |
|||
5. Call Putto send the data object to the server. This method returns destination pointer to the IStreaminterface, which is used to write the data. |
|
||
6. Call IStream::Writeto write into the stream.
|
|||
7. Close the connection to the OBEX server by calling the IObexDevice::Disconnecton the IObexDevicereference. |
|||
8. Release all interfaces and allocated resources.
|
None. |