THCIEventBase Class Reference
Represents the common data for a HCI event.
All of the event classes have been design to be used in a synchronous manner. All data is used by reference and hence any other object that requires persistence of the event parameters should make their own copy of them.
Protected Member Functions
|
|
THCIEventBase
(
THCIEventCode
,
TUint8
,
TDes8
&)
|
|
THCIEventBase
(const
TDesC8
&)
|
IMPORT_C
TPtrC8
|
AsBluetoothDeviceName
(
TInt
)
|
IMPORT_C
THCIConnectionHandle
|
AsConnectionHandle
(
TInt
)
|
IMPORT_C
THCIConnectionHandle
|
AsConnectionHandle
(
TInt
,
TInt
,
TInt
)
|
IMPORT_C
TBTDevAddr
|
AsDevAddr
(
TInt
)
|
IMPORT_C
TBTDevAddr
|
AsDevAddr
(
TInt
,
TInt
,
TInt
)
|
IMPORT_C
TBTLinkKey
|
AsLinkKey
(
TInt
)
|
IMPORT_C
TBTLinkKey
|
AsLinkKey
(
TInt
,
TInt
,
TInt
)
|
IMPORT_C
TPtrC8
|
AsNullTerminatedString
(
TInt
)
|
IMPORT_C
TBluetoothSimplePairingHash
|
AsSimplePairingHash
(
TInt
)
|
IMPORT_C
TBluetoothSimplePairingRandomizer
|
AsSimplePairingRandomizer
(
TInt
)
|
IMPORT_C
TPtrC8
|
AsString
(
TInt
)
|
IMPORT_C
TInt8
|
AsTInt8
(
TInt
)
|
IMPORT_C
TInt8
|
AsTInt8
(
TInt
,
TInt
,
TInt
)
|
IMPORT_C
TUint16
|
AsTUint16
(
TInt
)
|
IMPORT_C
TUint16
|
AsTUint16
(
TInt
,
TInt
,
TInt
)
|
IMPORT_C
TUint32
|
AsTUint32
(
TInt
,
TUint8
)
|
IMPORT_C
TUint32
|
AsTUint32
(
TInt
,
TInt
,
TInt
,
TUint8
)
|
IMPORT_C
TUint64
|
AsTUint64
(
TInt
)
|
IMPORT_C
TUint64
|
AsTUint64
(
TInt
,
TInt
,
TInt
)
|
IMPORT_C
TUint8
|
AsTUint8
(
TInt
)
|
IMPORT_C
TUint8
|
AsTUint8
(
TInt
,
TInt
,
TInt
)
|
void
|
PutConnectionHandle
(
THCIConnectionHandle
,
TDes8
&)
|
void
|
PutDevAddr
(const
TBTDevAddr
&,
TDes8
&)
|
void
|
PutEventCode
(
THCIEventCode
,
TDes8
&)
|
void
|
PutLinkKey
(const
TBTLinkKey
,
TDes8
&)
|
void
|
PutPaddedString
(const
TDesC8
&,
TInt
,
TDes8
&)
|
void
|
PutSimplePairingHash
(const
TBluetoothSimplePairingHash
&,
TDes8
&)
|
void
|
PutSimplePairingRandomizer
(const
TBluetoothSimplePairingRandomizer
&,
TDes8
&)
|
void
|
PutString
(const
TDesC8
&,
TDes8
&)
|
void
|
PutTInt8
(
TInt8
,
TDes8
&)
|
void
|
PutTUint16
(
TUint16
,
TDes8
&)
|
void
|
PutTUint32
(
TUint32
,
TUint8
,
TDes8
&)
|
void
|
PutTUint64
(
TUint64
,
TDes8
&)
|
void
|
PutTUint8
(
TUint8
,
TDes8
&)
|
Constructor & Destructor Documentation
THCIEventBase(THCIEventCode, TUint8, TDes8 &)
THCIEventBase
|
(
|
THCIEventCode
|
aEventCode,
|
|
TUint8
|
aParameterTotalLength,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Constructor used for creating a faked event
Parameters
THCIEventCode
aEventCode
|
The event code for the event
|
TUint8
aParameterTotalLength
|
The total length of the event parameters
|
TDes8
& aEventData
|
Empty buffer where the faked event data will be built. Every event starts with a one-byte event code and one-byte parameter total length field, so these are managed in this base class. The data after this is event specific and has length equal to Parameter Total Length. It is the responsibility of the derived class faking constructor to populate the rest of the aEventData buffer and then to set the member variable iEventData to reference this buffer when it is complete. Note that the aEventData buffer must persist as long as the object itself. It must be empty intially, and must be big enough to hold all the data for the given event type.
|
THCIEventBase(const TDesC8 &)
IMPORT_C
|
THCIEventBase
|
(
|
const
TDesC8
&
|
aEventData
|
)
|
[protected]
|
Normal constructor. This is used to create an event object to wrap event data received from the Controller
Parameters
const
TDesC8
& aEventData
|
Buffer holding event data received from the Controller
|
THCIEventBase(const THCIEventBase &)
Member Functions Documentation
AsBluetoothDeviceName(TInt)
IMPORT_C
TPtrC8
|
AsBluetoothDeviceName
|
(
|
TInt
|
aOffset
|
)
|
const [protected]
|
Retrieves a Null terminated Bluetooth Device Name from a specified event data descriptor.
AsConnectionHandle(TInt)
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsConnectionHandle(TInt, TInt, TInt)
Retrieves a
THCIConnectionHandle
from specified offset and index within the event data descriptor. Is intended to be used with events returning variable number of parameters.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TInt
aArrayBlockSize
|
size of one array entry, i.e. all parameters for an array entry.
|
TInt
aIndex
|
index into the array of THCIConnectionHandle of this event.
|
AsDevAddr(TInt)
Retrieves a
TBTDevAddr
from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsDevAddr(TInt, TInt, TInt)
Retrieves a
TBTDevAddr
from specified offset and index within the event data descriptor. Is intended to be used with events returning variable number of parameters.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TInt
aArrayBlockSize
|
size of one array entry, i.e. all parameters for an array entry.
|
TInt
aIndex
|
index into the array of TBTDevAddrs of this event.
|
AsLinkKey(TInt)
Retrieves a TBTLinkKey from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsLinkKey(TInt, TInt, TInt)
Retrieves a TBTLinkKey from specified offset and index within the event data descriptor. Is intended to be used with events returning variable number of parameters.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TInt
aArrayBlockSize
|
size of one array entry, i.e. all parameters for an array entry.
|
TInt
aIndex
|
index into the array of TBTLinkKeys of this event.
|
AsNullTerminatedString(TInt)
IMPORT_C
TPtrC8
|
AsNullTerminatedString
|
(
|
TInt
|
aOffset
|
)
|
const [protected]
|
Retrieves a Null terminated
TDesC8
& from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsSimplePairingHash(TInt)
Retrieves a
TBTDevAddr
from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsSimplePairingRandomizer(TInt)
Retrieves a
TBTDevAddr
from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsString(TInt)
IMPORT_C
TPtrC8
|
AsString
|
(
|
TInt
|
aOffset
|
)
|
const [protected]
|
Retrieves a
TDesC8
& from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsTInt8(TInt)
IMPORT_C
TInt8
|
AsTInt8
|
(
|
TInt
|
aOffset
|
)
|
const [protected]
|
Retrieves a TInt8 from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsTInt8(TInt, TInt, TInt)
IMPORT_C
TInt8
|
AsTInt8
|
(
|
TInt
|
aOffset,
|
|
TInt
|
aArrayBlockSize,
|
|
TInt
|
aIndex
|
|
)
|
const [protected]
|
Retrieves a TInt8 from specified offset and index within the event data descriptor. Is intended to be used with events returning variable number of parameters.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TInt
aArrayBlockSize
|
size of one array entry, i.e. all parameters for an array entry.
|
TInt
aIndex
|
index into the array of TUint8s of this event.
|
AsTUint16(TInt)
IMPORT_C
TUint16
|
AsTUint16
|
(
|
TInt
|
aOffset
|
)
|
const [protected]
|
Retrieves a TUint16 from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsTUint16(TInt, TInt, TInt)
IMPORT_C
TUint16
|
AsTUint16
|
(
|
TInt
|
aOffset,
|
|
TInt
|
aArrayBlockSize,
|
|
TInt
|
aIndex
|
|
)
|
const [protected]
|
Retrieves a TUint16 from specified offset and index within the event data descriptor. Is intended to be used with events returning variable number of parameters.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TInt
aArrayBlockSize
|
size of one array entry, i.e. all parameters for an array entry.
|
TInt
aIndex
|
index into the array of TUint16s of this event.
|
AsTUint32(TInt, TUint8)
Retrieves a TUint32 from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TUint8
aSize
|
how many bytes to get.
|
AsTUint32(TInt, TInt, TInt, TUint8)
Retrieves a TUint32 from specified offset and index within the event data descriptor. Is intended to be used with events returning variable number of parameters.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TInt
aArrayBlockSize
|
size of one array entry, i.e. all parameters for an array entry.
|
TInt
aIndex
|
index into the array of TUint32s of this event.
|
TUint8
aSize
|
how many bytes to get.
|
AsTUint64(TInt)
IMPORT_C
TUint64
|
AsTUint64
|
(
|
TInt
|
aOffset
|
)
|
const [protected]
|
Retrieves a TUint64 from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsTUint64(TInt, TInt, TInt)
IMPORT_C
TUint64
|
AsTUint64
|
(
|
TInt
|
aOffset,
|
|
TInt
|
aArrayBlockSize,
|
|
TInt
|
aIndex
|
|
)
|
const [protected]
|
Retrieves a TUint64 from specified offset and index within the event data descriptor. Is intended to be used with events returning variable number of parameters.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TInt
aArrayBlockSize
|
size of one array entry, i.e. all parameters for an array entry.
|
TInt
aIndex
|
index into the array of TUint64s of this event.
|
AsTUint8(TInt)
IMPORT_C
TUint8
|
AsTUint8
|
(
|
TInt
|
aOffset
|
)
|
const [protected]
|
Retrieves a TUint8 from specified offset within the event data descriptor.
Parameters
TInt
aOffset
|
offset of value in event data.
|
AsTUint8(TInt, TInt, TInt)
IMPORT_C
TUint8
|
AsTUint8
|
(
|
TInt
|
aOffset,
|
|
TInt
|
aArrayBlockSize,
|
|
TInt
|
aIndex
|
|
)
|
const [protected]
|
Retrieves a TUint8 from specified offset and index within the event data descriptor. Is intended to be used with events returning variable number of parameters.
Parameters
TInt
aOffset
|
offset of value in event data.
|
TInt
aArrayBlockSize
|
size of one array entry, i.e. all parameters for an array entry.
|
TInt
aIndex
|
index into the array of TUint8s of this event.
|
CreateAndSendCommandCompleteEvent(const TDesC8 &, MHCICommandEventObserver &)
CreateAndSendEvent(const TDesC8 &, MHCICommandEventObserver &, MHCIDataEventObserver &, TAny *)
Static factory and despatcher method.
This method creates an object of the appropriate derived type according to the event code in the event data supplied. Depending upon the type of event, it is then passed to the supplied Command Event observer or Data Event observer as appropriate. The event object is created on the stack and is therefore destroyed before CreateAndSendEvent returns.
Parameters
const
TDesC8
& aEventData
|
The data packet containing the event
|
MHCICommandEventObserver
& aEventObserver
|
The observer for handling command-related events
|
MHCIDataEventObserver
& aDataEventObserver
|
The observer for handling data-related events
|
TAny
* aObserver = NULL
|
Additional observer parameter to allow the licensee extra future flexibility
|
ErrorCode()
IMPORT_C
THCIErrorCode
|
ErrorCode
|
(
|
)
|
const
|
Getter for the error code.
Although this error code is not defined for all events in the HCI specification, the error code is in the base class so that the command queue can use the event error in its decisions without casting to a derived class. Those events that do not contain an error code in the specification should return with
THCIErrorCode::EOK
.
EventCode()
IMPORT_C
THCIEventCode
|
EventCode
|
(
|
)
|
const
|
Getter for the event code.
PutConnectionHandle(THCIConnectionHandle, TDes8 &)
Parameters
THCIConnectionHandle
aConnectionHandle
|
the value to write
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutDevAddr(const TBTDevAddr &, TDes8 &)
void
|
PutDevAddr
|
(
|
const
TBTDevAddr
&
|
aBdaddr,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Parameters
const
TBTDevAddr
& aBdaddr
|
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutEventCode(THCIEventCode, TDes8 &)
void
|
PutEventCode
|
(
|
THCIEventCode
|
aValue,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Writes an Event code to the event data descriptor. ALL the write functions are intended to be used ONE AFTER ANOTHER in the order the objects need to be written to the event data. Thus: PutEventCode(n); PutTUint8(int1); PutTUint16(int2); will product an event string n int1 int2 It is NOT possible to write these into the string in the order n, int2, int1 and get them to produce the event string shown. This is very similar to the way you construct commands.
Parameters
THCIEventCode
aValue
|
the event code to write
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutLinkKey(const TBTLinkKey, TDes8 &)
void
|
PutLinkKey
|
(
|
const
TBTLinkKey
|
aValue,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Writes a TBTLinkKey to the event data descriptor.
Parameters
const
TBTLinkKey
aValue
|
the value to write
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutPaddedString(const TDesC8 &, TInt, TDes8 &)
void
|
PutPaddedString
|
(
|
const
TDesC8
&
|
aString,
|
|
TInt
|
aRequiredLength,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Writes a
TDesC8
& to the event data descriptor padding with '' up to the required length.
Parameters
const
TDesC8
& aString
|
the string to write
|
TInt
aRequiredLength
|
the required length the writen string is to be
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutSimplePairingHash(const TBluetoothSimplePairingHash &, TDes8 &)
Writes a TBTSimplePairingHashC to the event data descriptor.
PutSimplePairingRandomizer(const TBluetoothSimplePairingRandomizer &, TDes8 &)
Writes a TBTSimplePairingRandomizerR to the event data descriptor.
PutString(const TDesC8 &, TDes8 &)
void
|
PutString
|
(
|
const
TDesC8
&
|
aString,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Writes a
TDesC8
& to the event data descriptor.
Parameters
const
TDesC8
& aString
|
the string to write
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutTInt8(TInt8, TDes8 &)
void
|
PutTInt8
|
(
|
TInt8
|
aValue,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Writes a TInt8 to the event data descriptor.
Parameters
TInt8
aValue
|
the value to write
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutTUint16(TUint16, TDes8 &)
void
|
PutTUint16
|
(
|
TUint16
|
aValue,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Writes a TUint16 to the event data descriptor.
Parameters
TUint16
aValue
|
the value to write
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutTUint32(TUint32, TUint8, TDes8 &)
Writes a TUint32 to the event data descriptor.
Parameters
TUint32
aValue
|
the value to write
|
TUint8
aSize
|
how many bytes to write.
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutTUint64(TUint64, TDes8 &)
void
|
PutTUint64
|
(
|
TUint64
|
aValue,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Writes a TUint64 to the event data descriptor.
Parameters
TUint64
aValue
|
the value to write
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
PutTUint8(TUint8, TDes8 &)
void
|
PutTUint8
|
(
|
TUint8
|
aValue,
|
|
TDes8
&
|
aEventData
|
|
)
|
[protected]
|
Writes a TUint8 to the event data descriptor.
Parameters
TUint8
aValue
|
the value to write
|
TDes8
& aEventData
|
modifiable descriptor buffer where the faked event is being created
|
Member Data Documentation
const TUint KEventCodeLength
const
TUint
|
KEventCodeLength
|
[static]
|
const TUint KEventCodeOffset
const
TUint
|
KEventCodeOffset
|
[static]
|
const TUint KEventCommonFieldsLength
const
TUint
|
KEventCommonFieldsLength
|
[static]
|
const TUint KTotalParameterLengthLength
const
TUint
|
KTotalParameterLengthLength
|
[static]
|
const TUint KTotalParameterLengthOffset
const
TUint
|
KTotalParameterLengthOffset
|
[static]
|
THCIErrorCode
iErrorCode
THCIErrorCode
|
iErrorCode
|
[protected]
|
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.