kernel/eka/include/d32comm.inl
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1995-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32\include\d32comm.inl
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedPartner
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef __KERNEL_MODE__
       
    25 _LIT(KRBusDevComm,"Comm");
       
    26 /**
       
    27 @capability CommDD
       
    28 */
       
    29 inline TInt RBusDevComm::Open(TInt aUnit)
       
    30 	{return(DoCreate(KRBusDevComm,VersionRequired(),aUnit,NULL,NULL));}
       
    31 inline TVersion RBusDevComm::VersionRequired() const
       
    32 	{return(TVersion(EMajorVersionNumber,EMinorVersionNumber,EBuildVersionNumber));}
       
    33 inline void RBusDevComm::Read(TRequestStatus &aStatus,TDes8 &aDes)
       
    34 	{TInt len=aDes.MaxLength();DoRequest(ERequestRead,aStatus,&aDes,&len);}
       
    35 inline void RBusDevComm::Read(TRequestStatus &aStatus,TDes8 &aDes,TInt aLength)
       
    36 	{DoRequest(ERequestRead,aStatus,&aDes,&aLength);}
       
    37 inline void RBusDevComm::ReadOneOrMore(TRequestStatus &aStatus,TDes8 &aDes)
       
    38 	{TInt len=(-aDes.MaxLength());DoRequest(ERequestRead,aStatus,&aDes,&len);}
       
    39 inline void RBusDevComm::ReadCancel()
       
    40 	{DoCancel(ERequestReadCancel);}
       
    41 inline void RBusDevComm::Write(TRequestStatus &aStatus,const TDesC8 &aDes)
       
    42 	{TInt len=aDes.Length();DoRequest(ERequestWrite,aStatus,(TAny *)&aDes,&len);}
       
    43 inline void RBusDevComm::Write(TRequestStatus &aStatus,const TDesC8 &aDes,TInt aLength)
       
    44 	{DoRequest(ERequestWrite,aStatus,(TAny *)&aDes,&aLength);}
       
    45 inline void RBusDevComm::WriteCancel()
       
    46 	{DoCancel(ERequestWriteCancel);}
       
    47 inline void RBusDevComm::Break(TRequestStatus &aStatus,TInt aTime)
       
    48 	{DoRequest(ERequestBreak,aStatus,&aTime);}
       
    49 inline void RBusDevComm::BreakCancel()
       
    50 	{DoCancel(ERequestBreakCancel);}
       
    51 inline void RBusDevComm::Config(TDes8 &aConfig)
       
    52 	{DoControl(EControlConfig,&aConfig);}
       
    53 inline TInt RBusDevComm::SetConfig(const TDesC8 &aConfig)
       
    54 	{return(DoControl(EControlSetConfig,(TAny *)&aConfig));}
       
    55 inline void RBusDevComm::Caps(TDes8 &aCaps)
       
    56 	{DoControl(EControlCaps,&aCaps);}
       
    57 inline TUint RBusDevComm::Signals()
       
    58 	{return(DoControl(EControlSignals));}
       
    59 inline void RBusDevComm::SetSignals(TUint aSetMask,TUint aClearMask)
       
    60 	{DoControl(EControlSetSignals,(TAny *)aSetMask,(TAny *)aClearMask);}
       
    61 inline TInt RBusDevComm::QueryReceiveBuffer()
       
    62 	{return(DoControl(EControlQueryReceiveBuffer));}
       
    63 inline void RBusDevComm::ResetBuffers()
       
    64 	{DoControl(EControlResetBuffers);}
       
    65 inline TInt RBusDevComm::ReceiveBufferLength()
       
    66 	{return(DoControl(EControlReceiveBufferLength));}
       
    67 inline TInt RBusDevComm::SetReceiveBufferLength(TInt aLength)
       
    68 	{return(DoControl(EControlSetReceiveBufferLength,(TAny *)aLength));}
       
    69 inline void RBusDevComm::NotifySignalChange(TRequestStatus& aStatus, TUint& aSignals, TUint aSignalMask)
       
    70 	{DoRequest(ERequestNotifySignalChange,aStatus,&aSignals,&aSignalMask);}
       
    71 inline void RBusDevComm::NotifySignalChangeCancel()
       
    72 	{DoCancel(ERequestNotifySignalChangeCancel);}
       
    73 inline void RBusDevComm::NotifyReceiveDataAvailable(TRequestStatus& aStatus)
       
    74 	{DoRequest(ERequestRead,aStatus,NULL,NULL);}
       
    75 inline void RBusDevComm::NotifyReceiveDataAvailableCancel()
       
    76 	{DoCancel(ERequestReadCancel);}
       
    77 inline TUint RBusDevComm::MinTurnaroundTime()
       
    78 	{return(DoControl(EControlMinTurnaroundTime));}
       
    79 inline TInt RBusDevComm::SetMinTurnaroundTime(TUint aMicroSeconds)
       
    80 	{return(DoControl(EControlSetMinTurnaroundTime,(TAny *)aMicroSeconds));}
       
    81 #ifdef _DEBUG_DEVCOMM
       
    82 inline void RBusDevComm::DebugInfo(TDes8 &aInfo)
       
    83 	{DoControl(EControlDebugInfo,&aInfo);}
       
    84 #endif
       
    85 //
       
    86 _LIT(KRBusDevCommDCE,"CommDCE");
       
    87 /**
       
    88 @capability CommDD
       
    89 */
       
    90 inline TInt RBusDevCommDCE::Open(TInt aUnit)
       
    91 	{return(DoCreate(KRBusDevCommDCE,VersionRequired(),aUnit,NULL,NULL));}
       
    92 inline TVersion RBusDevCommDCE::VersionRequired() const
       
    93 	{return(TVersion(EMajorVersionNumber,EMinorVersionNumber,EBuildVersionNumber));}
       
    94 inline void RBusDevCommDCE::Read(TRequestStatus &aStatus,TDes8 &aDes)
       
    95 	{TInt len=aDes.MaxLength();DoRequest(ERequestRead,aStatus,&aDes,&len);}
       
    96 inline void RBusDevCommDCE::Read(TRequestStatus &aStatus,TDes8 &aDes,TInt aLength)
       
    97 	{DoRequest(ERequestRead,aStatus,&aDes,&aLength);}
       
    98 inline void RBusDevCommDCE::ReadOneOrMore(TRequestStatus &aStatus,TDes8 &aDes)
       
    99 	{TInt len=(-aDes.MaxLength());DoRequest(ERequestRead,aStatus,&aDes,&len);}
       
   100 inline void RBusDevCommDCE::ReadCancel()
       
   101 	{DoCancel(ERequestReadCancel);}
       
   102 inline void RBusDevCommDCE::Write(TRequestStatus &aStatus,const TDesC8 &aDes)
       
   103 	{TInt len=aDes.Length();DoRequest(ERequestWrite,aStatus,(TAny *)&aDes,&len);}
       
   104 inline void RBusDevCommDCE::Write(TRequestStatus &aStatus,const TDesC8 &aDes,TInt aLength)
       
   105 	{DoRequest(ERequestWrite,aStatus,(TAny *)&aDes,&aLength);}
       
   106 inline void RBusDevCommDCE::WriteCancel()
       
   107 	{DoCancel(ERequestWriteCancel);}
       
   108 inline void RBusDevCommDCE::Break(TRequestStatus &aStatus,TInt aTime)
       
   109 	{DoRequest(ERequestBreak,aStatus,&aTime);}
       
   110 inline void RBusDevCommDCE::BreakCancel()
       
   111 	{DoCancel(ERequestBreakCancel);}
       
   112 inline void RBusDevCommDCE::Config(TDes8 &aConfig)
       
   113 	{DoControl(EControlConfig,&aConfig);}
       
   114 inline TInt RBusDevCommDCE::SetConfig(const TDesC8 &aConfig)
       
   115 	{return(DoControl(EControlSetConfig,(TAny *)&aConfig));}
       
   116 inline void RBusDevCommDCE::Caps(TDes8 &aCaps)
       
   117 	{DoControl(EControlCaps,&aCaps);}
       
   118 inline TUint RBusDevCommDCE::Signals()
       
   119 	{return(DoControl(EControlSignals));}
       
   120 inline void RBusDevCommDCE::SetSignals(TUint aSetMask,TUint aClearMask)
       
   121 	{DoControl(EControlSetSignals,(TAny *)aSetMask,(TAny *)aClearMask);}
       
   122 inline TInt RBusDevCommDCE::QueryReceiveBuffer()
       
   123 	{return(DoControl(EControlQueryReceiveBuffer));}
       
   124 inline void RBusDevCommDCE::ResetBuffers()
       
   125 	{DoControl(EControlResetBuffers);}
       
   126 inline TInt RBusDevCommDCE::ReceiveBufferLength()
       
   127 	{return(DoControl(EControlReceiveBufferLength));}
       
   128 inline TInt RBusDevCommDCE::SetReceiveBufferLength(TInt aLength)
       
   129 	{return(DoControl(EControlSetReceiveBufferLength,(TAny *)aLength));}
       
   130 inline void RBusDevCommDCE::NotifySignalChange(TRequestStatus& aStatus,TUint& aSignals,TUint aSignalMask)
       
   131 	{DoRequest(ERequestNotifySignalChange,aStatus,&aSignals,&aSignalMask);}
       
   132 inline void RBusDevCommDCE::NotifySignalChangeCancel()
       
   133 	{DoCancel(ERequestNotifySignalChangeCancel);}
       
   134 inline void RBusDevCommDCE::NotifyReceiveDataAvailable(TRequestStatus& aStatus)
       
   135 	{DoRequest(ERequestRead,aStatus,NULL,NULL);}
       
   136 inline void RBusDevCommDCE::NotifyReceiveDataAvailableCancel()
       
   137 	{DoCancel(ERequestReadCancel);}
       
   138 inline void RBusDevCommDCE::NotifyFlowControlChange(TRequestStatus& aStatus)
       
   139 	{DoRequest(ERequestNotifyFlowControlChange,aStatus);}
       
   140 inline void RBusDevCommDCE::NotifyFlowControlChangeCancel()
       
   141 	{DoCancel(ERequestNotifyFlowControlChangeCancel);}
       
   142 inline void RBusDevCommDCE::GetFlowControlStatus(TFlowControl& aFlowControl)
       
   143 	{DoControl(EControlFlowControlStatus,(TAny*)&aFlowControl);}
       
   144 inline void RBusDevCommDCE::NotifyConfigChange(TRequestStatus& aStatus, TDes8& aNewConfig)
       
   145 	{DoRequest(ERequestNotifyConfigChange,aStatus,(TAny*)&aNewConfig);}
       
   146 inline void RBusDevCommDCE::NotifyConfigChangeCancel()
       
   147 	{DoCancel(ERequestNotifyConfigChangeCancel);}
       
   148 #ifdef _DEBUG_DEVCOMM
       
   149 inline void RBusDevCommDCE::DebugInfo(TDes8 &aInfo)
       
   150 	{DoControl(EControlDebugInfo,&aInfo);}
       
   151 #endif
       
   152 #endif