bluetoothengine/headsetsimulator/remotecontroller/inc/remotecontrol/hsrccommand.h
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 
       
    16 #ifndef HSRCCOMMAND_H
       
    17 #define HSRCCOMMAND_H
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <hsremoterequest.h>
       
    21 
       
    22 /** Length of package */
       
    23 const TInt KHsRemoteControlPackageLength = 128;
       
    24 
       
    25 /** Length of package's header */
       
    26 const TInt KHsRemoteControlPackageTypeMaxLength = 2;
       
    27 
       
    28 /** Headset Simulator's remote control command */
       
    29 typedef TBuf8 <KHsRemoteControlPackageLength> THsRCCommandData;
       
    30 
       
    31 /**
       
    32  * @brief Represents command for remote control of Headset Simulator
       
    33  */
       
    34 class THsRCCommand
       
    35 {
       
    36 public:
       
    37         
       
    38     /**
       
    39      * Constructor
       
    40      * 
       
    41      * @param aData command's data
       
    42      * @param aCommandType type of command
       
    43      */
       
    44     THsRCCommand( THsRCCommandData& aData, 
       
    45             THsRemoteControlCommandType aCommandType );
       
    46 
       
    47     /**
       
    48      * Represents THsRCCommand as 8-bit descriptor
       
    49      * 
       
    50      * @param aCommandDesc parameter containing response
       
    51      */
       
    52     void ToDes8( TDes8& aCommandDesc );
       
    53 
       
    54     /**
       
    55      * Clones THsRCCommand object
       
    56      * 
       
    57      * @param aCmdFrom source
       
    58      * @param aCmdTo destination 
       
    59      */
       
    60     static void Copy( const THsRCCommand& aCmdFrom, THsRCCommand& aCmdTo );
       
    61 
       
    62     /**
       
    63      * Getter for type of command
       
    64      * 
       
    65      * @return command type
       
    66      */
       
    67     THsRemoteControlCommandType Type() const;
       
    68 
       
    69 private:
       
    70     /** Command data */
       
    71     THsRCCommandData& iData;
       
    72     
       
    73     /** Command type */
       
    74     THsRemoteControlCommandType iType;
       
    75 };
       
    76 #endif // HSRCOMMAND_H