bthci/hci2implementations/CommandsEvents/symbian/src/VendorDebugCompleteEvent.cpp
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2005-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 // Implementation of TVendorDebugCompleteEvent.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include <bluetooth/hci/vendordebugcompleteevent.h>
       
    24 #include "symbiancommandseventsutils.h"
       
    25 
       
    26 #include <bluetooth/hci/hciframe.h>
       
    27 #include <bluetooth/hci/hciopcodes.h>
       
    28 
       
    29 #ifdef __FLOG_ACTIVE
       
    30 _LIT8(KLogComponent, LOG_COMPONENT_COMMANDSEVENTS_SYMBIAN);
       
    31 #endif
       
    32 
       
    33 EXPORT_C TVendorDebugCompleteEvent::TVendorDebugCompleteEvent(const TDesC8& aEventData)
       
    34 	:
       
    35 	THCICommandCompleteEvent(aEventData)
       
    36 	{
       
    37 	}
       
    38 
       
    39 EXPORT_C TVendorDebugCompleteEvent::TVendorDebugCompleteEvent(TUint8 aNumHCICommandPackets,
       
    40 		THCIOpcode aCommandOpcode, const TDesC8& aEventPayload, TDes8& aEventData)
       
    41 	:
       
    42 	THCICommandCompleteEvent(aEventPayload.Length() + KCommandCompleteCommonFieldsLength,
       
    43 			aNumHCICommandPackets, aCommandOpcode, aEventData)
       
    44 	{
       
    45 	PutString(aEventPayload, aEventData);
       
    46 	iEventData.Set(aEventData);
       
    47 	}
       
    48 
       
    49 EXPORT_C TVendorDebugCompleteEvent& TVendorDebugCompleteEvent::Cast(const THCIEventBase& aEvent)
       
    50 	{
       
    51 	__ASSERT_ALWAYS(aEvent.EventCode()==ECommandCompleteEvent,
       
    52 					PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode));
       
    53 
       
    54 	__ASSERT_ALWAYS(((THCICommandCompleteEvent::Cast(aEvent).CommandOpcode() & KOGFMask) == KVendorDebugOGF),
       
    55 					PANIC(KSymbianCommandsEventsPanicCat, EInvalidVendorDebugCommandOpcode));
       
    56 	return *(reinterpret_cast<TVendorDebugCompleteEvent*>(&const_cast<THCIEventBase&>(aEvent)));
       
    57 	}
       
    58 
       
    59 EXPORT_C TPtrC8 TVendorDebugCompleteEvent::VendorDebugData() const
       
    60 	{
       
    61 	return AsString(5);
       
    62 	}
       
    63 
       
    64 EXPORT_C TPtrC8 TVendorDebugCompleteEvent::VendorDebugEvent() const
       
    65 	{
       
    66 	return AsString(0);
       
    67 	}
       
    68