CHciExtensionConduit Class Reference

class CHciExtensionConduit : public CActive

This class acts as a wrapper for a group of Ioctls which used together provide a means for licensees to pass proprietary commands direct to the hardware at the bottom of the stack, and to receive events elicited by these commands back from the hardware.

On construction, the CHciExtensionConduit registers itself with the Bluetooth stack, which ensures that there can be only one HCI Extension Conduit in existance on a machine at one time. This means that the first such conduit constructed after bootup has sole access to issue vendor specific commands and more importantly receive back vendor specific events.

It works in conjunction with the MVendorSpecificHciConduit class, which provides a mixin interface for reception of command completions for vendor specific commands and vendor specific events.

Inherits from

Constructor & Destructor Documentation

CHciExtensionConduit(MVendorSpecificHciConduit &)

CHciExtensionConduit ( MVendorSpecificHciConduit & aConduit ) [private]

Parameters

MVendorSpecificHciConduit & aConduit

~CHciExtensionConduit()

IMPORT_C ~CHciExtensionConduit ( )

destructor

Member Functions Documentation

CommandCompleteEventData(TPtrC8 &)

IMPORT_C void CommandCompleteEventData ( TPtrC8 & aOutPtrToData )

This method allows a client to obtain the command complete event data when being notified of a CommandComplete. That is it can be called as part of his implementation of "CommandCompleted" in his MVendorSpecificHciConduit derived class.

NOTE: If no event data is returned from the stack, as is the case if IssueCommandL was called, *** this will return the original command data! ***

MVendorSpecificHciConduit

Parameters

TPtrC8 & aOutPtrToData

ConstructL()

IMPORT_C void ConstructL ( ) [protected]

2nd phase construction

DoCancel()

void DoCancel ( ) [private, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel() .

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel() .

CActive::Cancel

IssueCommandExpectingCompleteEventL(const TUint16, const TDesC8 &)

IMPORT_C TInt IssueCommandExpectingCompleteEventL ( const TUint16 aOpcode,
const TDesC8 & aParameters
)

Issues a vendor specific command to the hardware. This command should have an associated command complete event.

The client need not be concerned with the exact formatting of the HCI frame as the HCI only requires the opcode and the correctly fomatted parameters in order to construct the appropriate the vendor debug frame. Note that the caller need NOT to be concerned with the HCTL framing at all. The HCI will only then copy this frame to the Host Controller after putting it in an HCTL frame. This command will not be completed until the hardware responds with the command complete event. Note: a command complete event is NOT a vendor debug event.

Warning: If this command is used after the command IssueRequestL has been called, the associated callback, MVendorSpecificHciConduit::CommandCompleted , could receive the wrong CommandCompleteEvent data.

MVendorSpecificHciConduit::CommandCompleted

Parameters

const TUint16 aOpcode
const TDesC8 & aParameters A descriptor containing the raw paramters for the command to be passed to hardware (maximum KHCIMaxCommandLength bytes)

IssueCommandL(const TUint16, const TDesC8 &)

IMPORT_C TInt IssueCommandL ( const TUint16 aOpcode,
const TDesC8 & aParameters
)

Issues a vendor specific command to the hardware.

The client need not be concerned with the exact formatting of the HCI frame as the HCI only requires the opcode and the correctly fomatted parameters in order to construct the appropriate the vendor debug frame. Note that the caller need NOT to be concerned with the HCTL framing at all. The HCI will only then copy this frame to the Host Controller after putting it in an HCTL frame. This command will be completed when the Bluetooth stack receives it. This API should not be used if the caller wants to receive any data from an associated command complete event.

Note: a command complete event is NOT a vendor debug event.

Parameters

const TUint16 aOpcode
const TDesC8 & aParameters A descriptor containing the raw paramters for the command to be passed to hardware (maximum KHCIMaxCommandLength bytes)

IssueCommandL(const TUint16, const TDesC8 &, TUint)

TInt IssueCommandL ( const TUint16 aOpcode,
const TDesC8 & aParameters,
TUint aName
) [private]

Parameters

const TUint16 aOpcode
const TDesC8 & aParameters
TUint aName

NewL(MVendorSpecificHciConduit &)

IMPORT_C CHciExtensionConduit * NewL ( MVendorSpecificHciConduit & aConduit ) [static]

two phase constructor to create an HCI Conduit. Note that access to an HCI Conduit from a thread other than that which creates the conduit is not supported

Parameters

MVendorSpecificHciConduit & aConduit The instance of MVendorSpecificHciConduit to receive notifications of conduit events

RunL()

void RunL ( ) [private, virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

StopWaitingForEvent()

IMPORT_C void StopWaitingForEvent ( )

Instructs the conduit that no more vendor debug events are expected back from the hardware. The conduit will issue no more upcalls on the MVendorSpecificHciConduit derived object passed into the CHciExtensionConduit factory function.

WaitForEvent()

IMPORT_C TInt WaitForEvent ( )

Instructs the conduit that vendor debug events are expected back from the hardware. The conduit will listen for events, and on reception of one will issue an upcall on the MVendorSpecificHciConduit derived object passed into the CHciExtensionConduit factory function.

Member Data Documentation

TBuf8< 255 > iBuf

TBuf8 < 255 > iBuf [private]

MVendorSpecificHciConduit & iConduit

MVendorSpecificHciConduit & iConduit [private]

TUint iCurrentIoctl

TUint iCurrentIoctl [private]

TProtocolDesc iL2CapProtoDesc

TProtocolDesc iL2CapProtoDesc [private]

RSocket iSocket

RSocket iSocket [private]

RSocketServ iSocketServ

RSocketServ iSocketServ [private]

THCIWriteVendorSpecificFrameBuf * iVSIoctl

THCIWriteVendorSpecificFrameBuf * iVSIoctl [private]

TBool iWaitForEvent

TBool iWaitForEvent [private]