systemswstubs/asyreference/inc/ASYmessagedefinitions.h
changeset 43 e71858845f73
parent 40 b7e5ed8c1342
child 46 e1758cbb96ac
equal deleted inserted replaced
40:b7e5ed8c1342 43:e71858845f73
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  Used as an reference implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ASYMESSAGEDEFINITIONS_H
       
    20 #define ASYMESSAGEDEFINITIONS_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <bldvariant.hrh>
       
    24 #include <AsyCmdTypes.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // DATA TYPES
       
    31 
       
    32 // FUNCTION PROTOTYPES
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 const TUint32 KASYMessageGroupAccessoryMessage  = 0x00010001; /* Message group for Accessory messages */
       
    39 const TUint32 KASYMessageGroupAccessoryEvent    = 0x00010002; /* Message group for Accessory events */
       
    40 
       
    41 
       
    42 typedef TBuf8< 15 > TASYAccessoryFeatureData;   // Data
       
    43 
       
    44 namespace AccessoryConnection
       
    45     {
       
    46     enum TConnectionState
       
    47         {
       
    48         EStateNotConnected = 1,
       
    49         EStateConnected
       
    50         };
       
    51 
       
    52     NONSHARABLE_STRUCT( TConnectionStateInfoStruct )
       
    53         {
       
    54         TInt32              iAccessoryId;       // specific accessory ID
       
    55         TConnectionState    iState;             // Accessory connection state
       
    56         };
       
    57         
       
    58     NONSHARABLE_STRUCT( TConnectionStateInfoRetStruct )
       
    59         {
       
    60         TConnectionStateInfoStruct  iStateInfo;
       
    61         TInt                        iErrorCode;
       
    62         };  
       
    63     }
       
    64 
       
    65 namespace AccessoryFeature
       
    66     {
       
    67     enum TAccessoryFeatureType
       
    68         {
       
    69         ETypeNotSupported = 0,
       
    70         ETypeBoolean,
       
    71         ETypeData
       
    72         };
       
    73 
       
    74     enum TAccessoryFeature
       
    75         {
       
    76         ENotSupported = 0,
       
    77         EHeadphonesConnected,
       
    78         EExternalPowerSourceConnected,
       
    79         };
       
    80 
       
    81     // Data type for getter (boolean and data)
       
    82     NONSHARABLE_STRUCT( TFeatureStateGetStruct )
       
    83         {
       
    84         TInt32                              iAccessoryId;       // specific accessory ID
       
    85         TAccessoryFeature                   iFeature;           // Feature
       
    86         };
       
    87     
       
    88     // Data type for boolean feature
       
    89     NONSHARABLE_STRUCT( TFeatureStateBooleanStruct )
       
    90         {
       
    91         TInt32                              iAccessoryId;       // specific accessory ID
       
    92         TAccessoryFeature                   iFeature;           // Feature
       
    93         TBool                               iState;             // Feature state (boolean)
       
    94         };   
       
    95 
       
    96     NONSHARABLE_STRUCT( TFeatureStateBooleanRetStruct )
       
    97         {
       
    98         TFeatureStateBooleanStruct iFeatureState;
       
    99         TInt                                iErrorCode;
       
   100         };
       
   101 
       
   102     }
       
   103 
       
   104 // Example messages
       
   105 // -----------------------------------------------------------------------------
       
   106     const TUint32 KASYMsgAccessoryConnectionHandlerInitCmd         = 0x00000001;
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111     const TUint32 KASYMsgAccessoryConnectionHandlerInitRet         = 0x00000002;
       
   112     typedef TPckgBuf< AccessoryConnection::TConnectionStateInfoRetStruct > TASYMsgAccessoryConnectionHandlerInitRetBuf;
       
   113 // -----------------------------------------------------------------------------
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116     const TUint32 KASYMsgAccessoryGetValueBooleanCmd               = 0x00000003;
       
   117 
       
   118     typedef TPckgBuf< AccessoryFeature::TFeatureStateGetStruct > TASYMsgAccessoryGetValueBooleanCmdBuf;
       
   119 // -----------------------------------------------------------------------------
       
   120 
       
   121 // -----------------------------------------------------------------------------
       
   122     const TUint32 KASYMsgAccessoryGetValueBooleanRet               = 0x00000004;
       
   123 
       
   124     typedef TPckgBuf< AccessoryFeature::TFeatureStateBooleanRetStruct > TASYMsgAccessoryGetValueBooleanRetBuf;
       
   125 // -----------------------------------------------------------------------------
       
   126 
       
   127 // -----------------------------------------------------------------------------
       
   128     const TUint32 KASYMsgAccessorySetValueBooleanCmd               = 0x00000005;
       
   129 
       
   130     typedef TPckgBuf< AccessoryFeature::TFeatureStateBooleanStruct > TASYMsgAccessorySetValueBooleanCmdBuf;
       
   131 // -----------------------------------------------------------------------------
       
   132 
       
   133 // -----------------------------------------------------------------------------
       
   134     const TUint32 KASYMsgAccessorySetValueBooleanRet               = 0x00000006;
       
   135 
       
   136     typedef TPckgBuf< AccessoryFeature::TFeatureStateBooleanRetStruct > TASYMsgAccessorySetValueBooleanRetBuf;
       
   137 // -----------------------------------------------------------------------------
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140     const TUint32 KASYMsgAccessoryConnectionStateChangedEvent      = 0x00000007;
       
   141 
       
   142     typedef TPckgBuf< AccessoryConnection::TConnectionStateInfoStruct > TASYMsgAccessoryConnectionStateChangedEventBuf;
       
   143 // -----------------------------------------------------------------------------
       
   144 
       
   145 // -----------------------------------------------------------------------------
       
   146     const TUint32 KASYMsgAccessoryFeatureStateChangedEvent         = 0x00000008;
       
   147 
       
   148     typedef TPckgBuf< AccessoryFeature::TFeatureStateBooleanStruct > TASYMsgAccessoryFeatureStateChangedEventBuf;
       
   149 // -----------------------------------------------------------------------------
       
   150 
       
   151 #endif      // ASYMESSAGEDEFINITIONS_H
       
   152             
       
   153 // End of File