bthci/hci2implementations/CommandsEvents/symbian/src/inquiryresultevent.cpp
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 // This file was generated automatically from the template eventsource.tmpl
       
    15 // on Wed, 25 Jul 2007 17:00:41 (time stamp)
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #include <bluetooth/hci/inquiryresultevent.h>
       
    25 #include <bluetooth/hci/hcierrors.h>
       
    26 #include <bluetooth/hci/hciopcodes.h>
       
    27 #include "symbiancommandseventsutils.h"
       
    28 
       
    29 #ifdef __FLOG_ACTIVE
       
    30 _LIT8(KLogComponent, LOG_COMPONENT_COMMANDSEVENTS_SYMBIAN);
       
    31 #endif
       
    32 
       
    33 // Construct an event object to wrap existing event data received from the Controller
       
    34 EXPORT_C TInquiryResultEvent::TInquiryResultEvent(const TDesC8& aEventData)
       
    35 	: THCIEventBase(aEventData)
       
    36 	{
       
    37 	
       
    38 	}
       
    39 
       
    40 // Construct a faked event, storing the supplied event parameters into the supplied empty event data buffer.
       
    41 EXPORT_C TInquiryResultEvent::TInquiryResultEvent(TUint8 aNumResponses, const TArray< TBTDevAddr >& aBDADDR, const TArray< THCIPageScanRepetitionMode >& aPageScanRepetitionMode, const TArray< THCIReservedOctet >& aReserved1, const TArray< THCIReservedOctet >& aReserved2, const TArray< TUint32 >& aClassOfDevice, const TArray< THCIClockOffset >& aClockOffset, TDes8& aEventData)
       
    42 	: THCIEventBase(EInquiryResultEvent, aNumResponses * 14 + 1, aEventData)
       
    43 	{
       
    44 	
       
    45 	PutTUint8(aNumResponses, aEventData);
       
    46 	for(int i=0;i<aNumResponses;++i)
       
    47 		{
       
    48 		PutDevAddr(aBDADDR[i], aEventData);
       
    49 		PutTUint8(aPageScanRepetitionMode[i], aEventData);
       
    50 		PutTUint8(aReserved1[i], aEventData);
       
    51 		PutTUint8(aReserved2[i], aEventData);
       
    52 		PutTUint32(aClassOfDevice[i], 3, aEventData);
       
    53 		PutTUint16(aClockOffset[i], aEventData);
       
    54 		}
       
    55 	iEventData.Set(aEventData);
       
    56 	}
       
    57 
       
    58 // Destructor
       
    59 EXPORT_C TInquiryResultEvent::~TInquiryResultEvent()
       
    60 	{
       
    61 	}
       
    62 
       
    63 // The static Cast method is used to obtain a pointer to the derived class object
       
    64 EXPORT_C TInquiryResultEvent& TInquiryResultEvent::Cast(const THCIEventBase& aEvent)
       
    65 	{
       
    66 	__ASSERT_DEBUG(aEvent.EventCode() == EInquiryResultEvent, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode));
       
    67 	return *(reinterpret_cast<TInquiryResultEvent*>(&const_cast<THCIEventBase&>(aEvent)));
       
    68 	}
       
    69 
       
    70 // Accessor methods for the parameters of the event
       
    71 
       
    72 EXPORT_C TUint8 TInquiryResultEvent::NumResponses() const
       
    73 	{
       
    74 	return AsTUint8(2);
       
    75 	}
       
    76 
       
    77 EXPORT_C TBTDevAddr TInquiryResultEvent::BDADDR(TInt aIndex) const
       
    78 	{
       
    79 	return AsDevAddr(3, 14, aIndex);
       
    80 	}
       
    81 
       
    82 EXPORT_C THCIPageScanRepetitionMode TInquiryResultEvent::PageScanRepetitionMode(TInt aIndex) const
       
    83 	{
       
    84 	return AsTUint8(9, 14, aIndex);
       
    85 	}
       
    86 
       
    87 EXPORT_C THCIReservedOctet TInquiryResultEvent::Reserved1(TInt aIndex) const
       
    88 	{
       
    89 	return AsTUint8(10, 14, aIndex);
       
    90 	}
       
    91 
       
    92 EXPORT_C THCIReservedOctet TInquiryResultEvent::Reserved2(TInt aIndex) const
       
    93 	{
       
    94 	return AsTUint8(11, 14, aIndex);
       
    95 	}
       
    96 
       
    97 EXPORT_C TUint32 TInquiryResultEvent::ClassOfDevice(TInt aIndex) const
       
    98 	{
       
    99 	return AsTUint32(12, 14, aIndex, 3);
       
   100 	}
       
   101 
       
   102 EXPORT_C THCIClockOffset TInquiryResultEvent::ClockOffset(TInt aIndex) const
       
   103 	{
       
   104 	return AsTUint16(15, 14, aIndex);
       
   105 	}
       
   106 
       
   107