bthci/bthci2/CommandsEvents/interface/commandcompleteevent.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef THCICOMMANDCOMPLETEEVENT_H
       
    24 #define THCICOMMANDCOMPLETEEVENT_H
       
    25 
       
    26 #include <bluetooth/hci/event.h>
       
    27 
       
    28 NONSHARABLE_CLASS(THCICommandCompleteEvent) : public THCIEventBase
       
    29 	{
       
    30 public:
       
    31 	IMPORT_C TUint8 NumHCICommandPackets() const;
       
    32 
       
    33 	IMPORT_C THCIOpcode CommandOpcode() const;
       
    34 
       
    35 	/**
       
    36 	Casts a base event type to this specific class type
       
    37 
       
    38 	@param aEvent An instance of the HCI event data base class to be cast.
       
    39 	@return The event instance (passsed as the function parameter) as a this specific class type.
       
    40 	*/
       
    41 	IMPORT_C static THCICommandCompleteEvent& Cast(const THCIEventBase& aEvent);
       
    42 
       
    43 public:
       
    44 	// Command Complete Event layout constants - lengths of fields that occur at the start
       
    45 	// of all Command Complete events (after the fields common to all events)
       
    46 	const static TUint KNumHCICommandPacketsLength = 1;
       
    47 	const static TUint KCommandOpcodeLength = 2;
       
    48 	const static TUint KCommandCompleteCommonFieldsLength =
       
    49 				KNumHCICommandPacketsLength + KCommandOpcodeLength;
       
    50 
       
    51 protected:
       
    52 	/**
       
    53 	This is used for creating a faked event. An emtpy event data buffer is supplied which must be populated.
       
    54 	@internalComponent This is publishedPartner really.
       
    55 	*/
       
    56 	THCICommandCompleteEvent(TUint8 aParameterTotalLength,
       
    57 			TUint8 aNumHCICommandPackets, THCIOpcode aCommandOpcode, TDes8& aEventData);
       
    58 
       
    59 	/**
       
    60 	This is used for creating an event object to wrap an existing event data buffer
       
    61 	@internalComponent This is publishedPartner really.
       
    62 	*/
       
    63 	THCICommandCompleteEvent(const TDesC8& aEventData);
       
    64 	};
       
    65 
       
    66 #endif // THCICOMMANDCOMPLETEEVENT_H
       
    67