How to Request a Data Object from the OBEX Server
A version of this page is also available for
4/8/2010
The IObexDevice::Get method is used to obtain a file from the server. In a typical multi-step Get operation, the client sends a Get request that may include a Name header. The server responds with a continue 0x90 code and headers describing the name and size of the pending object. After receiving this code, the client sends another Get request with a final bit set. The server responds with a response packet containing more headers along with another continue response code. The client continues to issue Get requests until the final body of information arrives in an EndOfBody header and the response code is 0xA0, meaning success.
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 IConnectionPointContainer and IObexSink:IUnknown interfaces. |
|
2. Retrieve the IObexDevice reference. |
None. |
3. Call the appropriate method of the IHeaderCollection interface to add a header.
|
None. |
4. Call the IObexDevice::Connect method on the IObexDevice reference to connect to an OBEX server. |
|
5. Call Get on the IObexDevice reference to return a header. This method returns a pointer to IStream. |
|
6. Call IStream::Read to retrieve the header information. |
|
7. Close the connection to the OBEX server by calling the IObexDevice::Disconnect on the IObexDevice reference. |
|
8. Release all interfaces and allocated resources.
|
None. |
See Also
Tasks
How to Send a Data Object to the OBEX Server