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.
Public Member Functions | |
---|---|
~CHciExtensionConduit () | |
IMPORT_C void | CommandCompleteEventData ( TPtrC8 &) |
IMPORT_C TInt | IssueCommandExpectingCompleteEventL (const TUint16 , const TDesC8 &) |
IMPORT_C TInt | IssueCommandL (const TUint16 , const TDesC8 &) |
IMPORT_C CHciExtensionConduit * | NewL ( MVendorSpecificHciConduit &) |
IMPORT_C void | StopWaitingForEvent () |
IMPORT_C TInt | WaitForEvent () |
Protected Member Functions | |
---|---|
IMPORT_C void | ConstructL () |
Private Member Functions | |
---|---|
CHciExtensionConduit ( MVendorSpecificHciConduit &) | |
void | DoCancel () |
TInt | IssueCommandL (const TUint16 , const TDesC8 &, TUint ) |
void | RunL () |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Private Attributes | |
---|---|
TBuf8 < 255 > | iBuf |
MVendorSpecificHciConduit & | iConduit |
TUint | iCurrentIoctl |
TProtocolDesc | iL2CapProtoDesc |
RSocket | iSocket |
RSocketServ | iSocketServ |
THCIWriteVendorSpecificFrameBuf * | iVSIoctl |
TBool | iWaitForEvent |
Inherited Attributes | |
---|---|
CActive::iStatus |
CHciExtensionConduit | ( | MVendorSpecificHciConduit & | aConduit | ) | [private] |
MVendorSpecificHciConduit & aConduit |
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! ***
TPtrC8 & aOutPtrToData |
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() .
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.
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.
TInt | IssueCommandL | ( | const TUint16 | aOpcode, |
const TDesC8 & | aParameters, | |||
TUint | aName | |||
) | [private] |
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
MVendorSpecificHciConduit & aConduit | The instance of MVendorSpecificHciConduit to receive notifications of conduit events |
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
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.
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.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.