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.
A version of this page is also available for

The OBEX protocol enables asynchronous device discovery.

To implement asynchronous device discovery
  1. Instantiate an IObex:IUnknownobject.

  2. Instantiate and implement an IObexSink:IUnknownobject.

  3. Provide a pointer to the IObexSinkobject to inform the IObexobject, as follows:

    1. Query for the Windows Embedded CE IConnectionPointContainerinterface.

    2. Call the IConnectionPointContainer::FindConnectionPointmethod.

    3. Use the returned IConnectionvalue to create the pointer.

  4. Use the IObex::StartDeviceEnummethod to begin device enumeration. The IObexSink:IUnknownobject receives a notification for each device arrival, departure, and update.

    When a remote device that supports OBEXenters the range of the local device, the IObexSink::Notifymethod is called. The method notifies the local device (local IObex:IUnknownobject) of the arrival of the new device.

    The IObexSink::Notifymethod specifies one of the following values for the Eventparameter.

    Value Description


    A new remote device has arrived within range of the local device.


    A previously listed remote device has left the range of the local device.

    The local device should release its pointer to the remote device and notify the user through the user interface that the remote device is no longer available.


    A remote device was initially located but did not provide complete information about itself.

  5. Do one of the following based on the value specified for the Eventparameter:

    1. OE_DEVICE_ARRIVAL   Query for the remote device IPropertyBagto retrieve information about the device, such as the class ID of the transport and the name of the remote device. IPropertyBagis provided by the pUnk1parameter for the IObexSink::Notifymethod.

      To bind the local device to the remote device, call the IObex::BindToDevicemethod and pass the property bag of the remote device to this method. IObex::BindToDevicereturns a pointer, in the form of an IObexDevice:IUnknowninterface, to the remote device. Call the IObexDevice::Connectmethod to connect to the remote device.

    2. OE_DEVICE_UPDATE   To retrieve information about the device, query for the remote device IPropertyBag.

  6. Call the IObex::StopDeviceEnummethod to stop the device enumeration process at any point.

  7. Release the IObexSink::Notifyobject when the enumeration process is finished so that this object is unadvised to the IObex:IUnknownobject.

See Also