|
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 TVendorDebugEvent. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #include <bluetooth/hci/vendordebugevent.h> |
|
24 #include <bluetooth/hci/hciframe.h> |
|
25 #include <bluetooth/hci/hciopcodes.h> |
|
26 |
|
27 #include "symbiancommandseventsutils.h" |
|
28 |
|
29 #ifdef __FLOG_ACTIVE |
|
30 _LIT8(KLogComponent, LOG_COMPONENT_COMMANDSEVENTS_SYMBIAN); |
|
31 #endif |
|
32 |
|
33 EXPORT_C TVendorDebugEvent::TVendorDebugEvent(const TDesC8& aEventData) |
|
34 : THCIEventBase(aEventData) |
|
35 { |
|
36 } |
|
37 |
|
38 EXPORT_C TVendorDebugEvent::TVendorDebugEvent(THCIEventCode aEventCode, |
|
39 const TDesC8& aEventPayload, TDes8& aEventData) |
|
40 : THCIEventBase(aEventCode, aEventPayload.Length(), aEventData) |
|
41 { |
|
42 PutString(aEventPayload, aEventData); // vendor-defined payload data |
|
43 iEventData.Set(aEventData); |
|
44 } |
|
45 |
|
46 EXPORT_C TVendorDebugEvent& TVendorDebugEvent::Cast(const THCIEventBase& aEvent) |
|
47 { |
|
48 __ASSERT_DEBUG(aEvent.EventCode() == EVendorDebugEvent, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode)); |
|
49 return *(reinterpret_cast<TVendorDebugEvent*>(&const_cast<THCIEventBase&>(aEvent))); |
|
50 } |
|
51 |
|
52 EXPORT_C TPtrC8 TVendorDebugEvent::VendorDebugData() const |
|
53 { |
|
54 return AsString(2); |
|
55 } |
|
56 |
|
57 EXPORT_C TPtrC8 TVendorDebugEvent::VendorDebugEvent() const |
|
58 { |
|
59 return AsString(0); |
|
60 } |