Read-only archive of the All About Symbian forum (2001–2013) · About this archive

facing problem to find bluetooth device!!!

0 replies · 1,539 views · Started 14 April 2005

hello..
the code which i m using...

TBool CBTDiscoverer::SelectDeviceL( TBTDeviceResponseParamsPckg* aResponse )
{
iHasPrintedRecordNumber = EFalse;
TBool success(EFalse);

RNotifier notifier;
User::LeaveIfError( notifier.Connect() );

TBTDeviceSelectionParamsPckg selectionFilter;

TRequestStatus status;
notifier.StartNotifierAndGetResponse(
status,
KDeviceSelectionNotifierUid,
selectionFilter,
*aResponse
);

User::WaitForRequest( status );
TBuf<10>k;
k.Format(_L("%d"😉,status.Int());
iReporter.PrintLine( k );

if ( status.Int() == KErrNone )
{
if ( (*aResponse)().IsValidDeviceName() )
{
success = ETrue;
}
else
{
HBufC* failedToConnect = StringLoader
::LoadLC ( R_BTDI_FAILED_TO_CONNECT );

iReporter.Error( *failedToConnect );

CleanupStack::PopAndDestroy( failedToConnect );
}
}
else
{
HBufC* noDeviceSelected = StringLoader
::LoadLC ( R_BTDI_NO_DEVICE_SELECTED );

iReporter.Error( *noDeviceSelected );

CleanupStack::PopAndDestroy( noDeviceSelected );
}

notifier.CancelNotifier( KDeviceSelectionNotifierUid );
notifier.Close();

return success;
}
if i m checking status its giving -9 error.this means overflow...
showing the discovered bluetooth devices....
but when i'm selecting then giving system error.
plz help me..
as soon as possible...
thanx
krishna