Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 10:42, 16 November 2007.

How to get bluetooth HCI scan enable parameter

From Forum Nokia Wiki


Overview

According to the Bluetooth core specification (v. 2.1) there are several HCI configuration parameters (Host Controller Interface Functional Specification). One of them is the "scan_enable"-parameter. It controls whether or not the Bluetooth device will periodically scan for page attempts and/or inquiry requests from other Bluetooth devices. The according values are shown below:

Value Parameter description
0x00: No Scans enabled
0x01: Inquiry Scan enabled / Page Scan always disabled
0x02: Inquiry Scan disabled / Page Scan enabled
0x03: Inquiry Scan enabled / Page Scan enabled
0x04-0xFF Reserved

Prerequisites

Header files:

#include <bttypes.h>
#include <bt_subscribe.h>

Library:

bluetooth.lib

Capabilities:

LocalServices

Description

The following Uint value is provided in bt_subscribe.h:

const TUint KPropertyKeyBluetoothGetScanningStatus = 
(KUidBluetoothPubSubKeyBase + 3);

The following Int32 & Uid values are provided in e32_property.h (included in bt_subscribe.h):

static const TInt32 KUidSystemCategoryValue=0x101f75b6;
static const TUid KUidSystemCategory={KUidSystemCategoryValue};

The following HCI values are provided in hcitypes.h:

enum THCIScanEnable 
    {
     ENoScansEnabled=0x00,
     EInquiryScanOnly=0x01,
     EPageScanOnly=0x02,
     EInquiryAndPageScan=0x03
    };

Example code

The following code retrieves the HCI configuration parameter:

TBuf<50> aScanningStatus;
TInt value;
TInt ret = RProperty::Get(KUidSystemCategory, 
KPropertyKeyBluetoothGetScanningStatus, value);
if(KErrNone==ret)
{
	switch(value)
	{
	case ENoScansEnabled:
		{
		aScanningStatus.Append(_L("No HCI scans enabled"));
		break;
		}
	case EInquiryScanOnly:
		{
		aScanningStatus.Append(_L("HCI inquiry scan enabled"));
		break;
		}
	case EPageScanOnly:
		{
		aScanningStatus.Append(_L("HCI page scan enabled"));
		break;
		}
	case EInquiryAndPageScan:
		{
		aScanningStatus.Append(_L("HCI inquiry and page scan enabled"));
		break;
		}
	default:
		{
		aScanningStatus.Append(_L("No scanning status available"));
		break;
		}
	}
}
Related Discussions
Thread Thread Starter Forum Replies Last Post
bluetooth application by symbian milton_bd Bluetooth Technology 1 2004-07-21 01:10
Nokia Connectivity Card DTL-4 nuwan14d Bluetooth Technology 2 2004-01-05 00:58
possible bluetooth voice communication? thres General Symbian C++ 0 2004-07-30 08:40
bluetooth nokia 3650 ambicom tclopine Bluetooth Technology 5 2003-05-14 05:09
Pairing with Nokia E50 (Symbian S60) amiske Bluetooth Technology 0 2007-03-07 10:17
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZbluetoothQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX