Discovering OBEX Devices
A version of this page is also available for
4/8/2010
Device discovery enables clients to discover other OBEX devices that are in range, regardless of their protocol. To obtain a list of available devices, clients call the IObex::EnumDevices method.
Another and probably preferred method for device discovery is using IConnectionPointContainer and IObexSink:IUnknown interfaces.
Procedures
To make device discovery notifications by using IConnectionPointContainer and IObexSink:
Create an IObex:IUnknown object by calling the CoCreateInstance method.
Call IUnknown::QueryInterface on the IObex object to retrieve an IConnectionPointContainer reference.
Call the IConnectionPointContainer::FindConnectionPoint method on the IConnectionPointContainer reference. This method receives a pointer to the IConnectionPoint interface of a connection point.
Implement IObexSink and create an object of this class.
Call the IConnectionPoint::Advise method on the IConnectionPoint reference retrieved by FindConnectionPoint and pass the IObexSink object as a parameter.
Call the IObex::StartDeviceEnum method on the IObex object.