bluetoothapitest/bluetoothsvs/T_BTUserAPI/src/T_AvdtpServiceCapabilityData.cpp
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "T_AvdtpServiceCapabilityData.h"
       
    20 #include "T_BTUtil.h"
       
    21 
       
    22 /*@{*/
       
    23 //Parameters
       
    24 _LIT(KExpected,									"expected");
       
    25 
       
    26 //Commands
       
    27 _LIT(KCmdCategory,								"Category");
       
    28 _LIT(KCmdAsProtocol,							"AsProtocol");
       
    29 _LIT(KCmdParse,									"Parse");
       
    30 _LIT(KCmdAllocFromPDUL,							"AllocFromPDUL");
       
    31 _LIT(KCmdAllocFromPckgL,						"AllocFromPckgL");
       
    32 
       
    33 ///	Logging
       
    34 _LIT(KLogMissingParameter,						"Missing parameter '%S'");
       
    35 _LIT(KLogNotExpectedValue,						"Not expected value");
       
    36 /*@}*/
       
    37 
       
    38 //////////////////////////////////////////////////////////////////////
       
    39 // Construction/Destruction
       
    40 //////////////////////////////////////////////////////////////////////
       
    41 
       
    42 CT_AvdtpServiceCapabilityData::CT_AvdtpServiceCapabilityData()
       
    43 	{
       
    44 	}
       
    45 
       
    46 
       
    47 TBool CT_AvdtpServiceCapabilityData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
       
    48 	{
       
    49 	TBool	ret = ETrue;
       
    50 
       
    51 	if ( aCommand==KCmdCategory )
       
    52 		{
       
    53 		DoCmdCategory(aSection);
       
    54 		}
       
    55 	else if(aCommand == KCmdAsProtocol)
       
    56 		{
       
    57 		DoCmdAsProtocol(aSection);
       
    58 		}
       
    59 	else if(aCommand == KCmdParse)
       
    60 		{
       
    61 		DoCmdParse(aSection);
       
    62 		}
       
    63 	else if(aCommand == KCmdAllocFromPDUL)
       
    64 		{
       
    65 		DoCmdAllocFromPDUL(aSection);
       
    66 		}
       
    67 	else if(aCommand == KCmdAllocFromPckgL)
       
    68 		{
       
    69 		DoCmdAllocFromPDUL(aSection);
       
    70 		}
       
    71 	else
       
    72 		{
       
    73 		ret=EFalse;
       
    74 		}
       
    75 
       
    76 	return ret;
       
    77 	}
       
    78 
       
    79 
       
    80 /**
       
    81 Test Category()
       
    82 */
       
    83 void CT_AvdtpServiceCapabilityData::DoCmdCategory(const TDesC& aSection)
       
    84 	{
       
    85 	INFO_PRINTF1(_L("TAvdtpServiceCapability Category Call"));
       
    86 	
       
    87 	TAvdtpServiceCategory avdtpServiceCategory = GetAvdtpServiceCapability()->Category();
       
    88 	INFO_PRINTF2(_L("TAvdtpServiceCapability Category result: actual = %d"), avdtpServiceCategory);
       
    89 	
       
    90 	TAvdtpServiceCategory	expected;
       
    91 	if ( CT_BTUtil::ReadAvdtpServiceCategory(*this, aSection, KExpected(), expected) )
       
    92 		{
       
    93 		if ( avdtpServiceCategory!=expected )
       
    94 			{
       
    95 			ERR_PRINTF1(KLogNotExpectedValue);
       
    96 			SetBlockResult(EFail);
       
    97 			}
       
    98 		}
       
    99 	else
       
   100 		{
       
   101 		ERR_PRINTF2(KLogMissingParameter, KExpected);
       
   102 		SetBlockResult(EFail);		
       
   103 		}
       
   104 	}
       
   105 
       
   106 /**
       
   107 Test AsProtocol()
       
   108 */ 
       
   109 void CT_AvdtpServiceCapabilityData::DoCmdAsProtocol(const TDesC& /*aSection*/)
       
   110 	{
       
   111 	
       
   112 	}
       
   113 
       
   114 /**
       
   115 Test Parse()
       
   116 */ 
       
   117 void CT_AvdtpServiceCapabilityData::DoCmdParse(const TDesC& /*aSection*/)
       
   118 	{
       
   119 	
       
   120 	}
       
   121 
       
   122 /**
       
   123 Test AllocFromPDUL()
       
   124 */ 
       
   125 void CT_AvdtpServiceCapabilityData::DoCmdAllocFromPDUL(const TDesC& /*aSection*/)
       
   126 	{
       
   127 	
       
   128 	}
       
   129 
       
   130 /**
       
   131 Test AllocFromPckgL()
       
   132 */ 
       
   133 void CT_AvdtpServiceCapabilityData::DoCmdAllocFromPckgL(const TDesC& /*aSection*/)
       
   134 	{
       
   135 	
       
   136 	}