Bluetooth ServiceDiscovery

Jan 9, 2009 at 11:01 AM
It seems that nobody is answering here but I will shoot it anyway.

By going this way I can find what services are my Bluetooth device providing:

1) Open the Bluetooth Devices dialog box
Control Panel -> Network and Internet -> Bluetooth Devices
2) At Devices tab select the device and click on properties button
3) At the Device Properties dialog box, click on Services tab

Windows does list the device's services

But when I try it with SerialPortProfileApplication sample application, no service is listed. By debugging it I was able to find out that at method DiscoverAllServices of Device inf the following block, the result is variable is 10110 instead of 0:

                    if (0 == result)
                    {
                        Marshal.PtrToStructure(pBuffer, qsResult);
                        RemoteService remoteService = new RemoteService(qsResult,
                                                                        this.address);
                        //Add the remote service to list    
                        remoteServices.Add(remoteService);
                    }
                    else
                    {
                        //Get the winsock error
                        BluetoothHelper.GetError();

                        //Free unmanaged resources
                        Marshal.FreeHGlobal(ptrServiceClassId);
                    }

Does anyone know how to solve this?

Thanks