bluetoothengine/headsetsimulator/remotecontroller/src/remotecontrol/hsrccommand.cpp
branchheadsetsimulator
changeset 60 90dbfc0435e3
equal deleted inserted replaced
59:02103bf20ee5 60:90dbfc0435e3
       
     1 /*
       
     2  * Component Name: Headset Simulator
       
     3  * Author: Comarch S.A.
       
     4  * Version: 1.0
       
     5  * Copyright (c) 2010 Comarch S.A.
       
     6  *  
       
     7  * This Software is submitted by Comarch S.A. to Symbian Foundation Limited on 
       
     8  * the basis of the Member Contribution Agreement entered between Comarch S.A. 
       
     9  * and Symbian Foundation Limited on 5th June 2009 (“Agreement”) and may be 
       
    10  * used only in accordance with the terms and conditions of the Agreement. 
       
    11  * Any other usage, duplication or redistribution of this Software is not 
       
    12  * allowed without written permission of Comarch S.A.
       
    13  * 
       
    14  */
       
    15 #include "hsrccommand.h"
       
    16 
       
    17 _LIT8(KHsRemoteCommandDelimiter,":");
       
    18 
       
    19 THsRCCommand::THsRCCommand( THsRCCommandData& aData,
       
    20         THsRemoteControlCommandType aCommandType ) :
       
    21     iData( aData ), iType( aCommandType )
       
    22     {
       
    23     }
       
    24 
       
    25 void THsRCCommand::ToDes8( TDes8& aCommandDesc )
       
    26     {
       
    27     aCommandDesc.Copy( KNullDesC8 );
       
    28     aCommandDesc.AppendNum( iType );
       
    29     aCommandDesc.Append( KHsRemoteCommandDelimiter );
       
    30     aCommandDesc.Append( iData );
       
    31     }
       
    32 
       
    33 void THsRCCommand::Copy( const THsRCCommand& aCmdFrom, THsRCCommand& aCmdTo )
       
    34     {
       
    35     aCmdTo.iData.Copy( aCmdFrom.iData );
       
    36     aCmdTo.iType = aCmdFrom.iType;
       
    37     }
       
    38 
       
    39 THsRemoteControlCommandType THsRCCommand::Type() const
       
    40     {
       
    41     return iType;
       
    42     }
       
    43