Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



How to perform low-level configuration

The Bluetooth specification defines commands and options that can be used with the various layers of the protocol. The Bluetooth Sockets API makes some of these available as follows:

Example

The following example shows the HCI command Read_Class_of_Device being issued on an L2CAP socket. The ioctl for this is KHCIReadDeviceClassIoctl, which returns a THCIDeviceClassIoctl object packaged in a THCIDeviceClassBuf package buffer. The example extracts the device class into a variable majorClass.

THCIDeviceClassBuf codbuf;
TRequestStatus status;
socket.Ioctl(KHCIReadDeviceClassIoctl, status, &codbuf, KSolBtHCI);
User::WaitForRequest(status);
TUint16 majorClass = codbuf().iMajorDeviceClass;