bthci/bthci2/CommandsEvents/generator/commandteststepsource.tmpl
changeset 0 29b1cd4cb562
child 4 28479eeba3fb
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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // $FILENAME.cpp
       
    15 // This file was generated automatically from the template commandteststepsource.tmpl
       
    16 // on $GENERATE_TIME_STAMP
       
    17 // Implementation of test step $CLASSNAME.
       
    18 // 
       
    19 //
       
    20 
       
    21 /**
       
    22  @file 
       
    23  @internalComponent
       
    24 */
       
    25 
       
    26 #include "$FILENAME.h"
       
    27 
       
    28 #include <bluetooth\hci\hciframe.h>
       
    29 #include <bluetooth\hci\VendorDebugCompleteEvent.h>
       
    30 #include <bluetooth\hci\VendorDebugEvent.h>
       
    31 #include <bluetooth\hci\$CMDFILENAME.h>
       
    32 
       
    33 //HCI Framing constants for command frames - use 0 values since we are not going to use
       
    34 static const TInt KHCTLCommandHeaderSize = 0;
       
    35 static const TInt KHCTLCommandTrailerSize = 0;
       
    36 
       
    37 $CLASSNAME::$CLASSNAME()
       
    38 	{
       
    39 	SetTestStepName(K${TESTSTEPNAME});
       
    40 	}
       
    41 
       
    42 $CLASSNAME::~$CLASSNAME()
       
    43 	{
       
    44 	}
       
    45 
       
    46 TVerdict $CLASSNAME::doTestStepL()
       
    47 	{
       
    48 	if(TestStepResult() != EPass)
       
    49 		{
       
    50 		return TestStepResult();
       
    51 		}
       
    52 
       
    53 	SetTestStepResult(EFail);
       
    54 
       
    55 	CHctlCommandFrame* frame = CHctlCommandFrame::NewL(KHCTLCommandHeaderSize,KHCTLCommandTrailerSize);
       
    56 	CleanupStack::PushL(frame);
       
    57 
       
    58 $CMDINITMAXPARAMS
       
    59 	$CMDNAME* cmd = $CMDNAME::NewL($MAXPARAMETERS);
       
    60 	CleanupStack::PushL(cmd);
       
    61 
       
    62 	if(cmd->Opcode() != $CMDOPCODE)
       
    63 		{
       
    64 		return TestStepResult();
       
    65 		}
       
    66 
       
    67 $CHECK_MAX_ACCESSORS
       
    68 	cmd->FormatCommand(*frame);
       
    69 	TBuf8<CHctlCommandFrame::KHCIMaxCommandLength> verificationData = _L8("$FRAMEDATA");
       
    70 	
       
    71 	if(frame->HCTLPayload().Right(frame->HCTLPayload().Length()-CHctlCommandFrame::KHCICommandPacketHeaderLength) != verificationData)
       
    72 		{
       
    73 		return TestStepResult();
       
    74 		}
       
    75 
       
    76 	CleanupStack::PopAndDestroy(cmd);
       
    77 
       
    78 	cmd = $CMDNAME::NewL();
       
    79 	CleanupStack::PushL(cmd);
       
    80 $CMDINITMINPARAMS
       
    81 	cmd->Reset($MINPARAMETERS);
       
    82 
       
    83 $CHECK_MIN_ACCESSORS
       
    84 $MATCH_COMPLETE_EVENT
       
    85 $MATCH_STATUS_EVENT
       
    86 $MATCH_PROPRIETARY_EVENT
       
    87 $MATCH_EMPTY_EVENT
       
    88 
       
    89 	CleanupStack::PopAndDestroy(2);
       
    90 	SetTestStepResult(EPass);
       
    91 	return TestStepResult();
       
    92 	}