I have a problem with my Bt service discovery running in a console application.
I want to check in a list of Bt devices, if a device offers a PanU, PanGn or PanNap service.
- My way:
i have a methode. In this methode i first do a reset on theCode:DiscoverServiceOnDeviceL(TBtDeviceData)and cancel theCode:CSdpSearchPatternif their were in use and delete both objects. Afterwards i create a new instance of both initialise theCode:CSdpAgentand start my service discovery by callingCode:CSdpSearchPattern.Code:CSdpAgent::NextRecordRequestL()
- i check first if the record is done with. In case true, i call myCode:(aError == KErrEof)again to proceed with the next device, if there is any left. If all devices done i reset myCode:TRAP(aError, DiscoverServiceOnDeviceL(iBtDeviceData)and call myCode:CSdpSearchPatternagain, if there are any more services to check. IfCode:TRAP(aError, DiscoverServiceOnDeviceL(iBtDeviceData)equals false i do nothing.Code:(aError == KErrEof)
- second i catch other errors with. In case true i do a return after reporting the error.Code:(aError != KErrNone)
- Last i request the attributes ifis greater then zero.Code:aTotalRecordsCount
- My problem:
i don't return to the callee when i recall my.That means my application works fine if i only have one device and one service to check. Otherwise i get my report promt but the application is blocked.Code:TRAP(aError, DiscoverServiceOnDeviceL(iBtDeviceData)
- My assumption:
is that i don't deal correctly with the active schedular or cleanupstack. Unfortunately i'm not very familiar with both. And all my trials to solve the problem were ineffective.