You Are Here:

Community: Wiki

This page was last modified on 17 January 2008, at 11:17.

A simple way of discovering and selecting a single Bluetooth device

From Forum Nokia Wiki

An easy way of discovering and selecting a single Bluetooth device from a GUI component, is that of reusing a Notifier.

Following, is an example of how to achieve this simply, using synchronous operations. In your application you should probably make use of this technique using active objects.

The example below initiates a discovery for devices that support the Serial Port Profile.

void GetDeviceAddressL()
{
RNotifier btNotifier;
User::LeaveIfError(btNotifier.Connect());
 
TBTDeviceSelectionParamsPckg selectionFilter;
TBTDeviceResponseParamsPckg selectionResponse;
 
selectionFilter().SetUUID(KSerialPortUUID);
 
TRequestStatus status;
btNotifier.StartNotifierAndGetResponse( status, KDeviceSelectionNotifierUid,
selectionFilter, selectionResponse);
User::WaitForRequest(status);
 
btNotifier.Close();
 
User::LeaveIfError(status.Int());
 
// use the response data ....
TBTDeviceName dname = selectionResponse().DeviceName();
TBTDeviceClass dclass = selectionResponse().DeviceClass();
// ... etc...
 
return;
}

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia