connectivitylayer/isce/iscapi_dll/src/isaapi.cpp
changeset 9 8486d82aef45
parent 8 6295dc2169f3
equal deleted inserted replaced
8:6295dc2169f3 9:8486d82aef45
   239         )
   239         )
   240     {
   240     {
   241 
   241 
   242     C_TRACE( ( _T( "RIscApi::Loan 0x%x ->" ), iChannelNumber ) );
   242     C_TRACE( ( _T( "RIscApi::Loan 0x%x ->" ), iChannelNumber ) );
   243     OstTraceExt1( TRACE_NORMAL, RISCAPI_LOAN_ENTRY, ">RIscApi::Loan;iChannelNumber=%hx", iChannelNumber );
   243     OstTraceExt1( TRACE_NORMAL, RISCAPI_LOAN_ENTRY, ">RIscApi::Loan;iChannelNumber=%hx", iChannelNumber );
   244     // TODO: panic if open?
   244     //  panic if open?
   245     //    PanicIfNotOpen();
   245     //    PanicIfNotOpen();
   246     // Driver is tried to load everytime.
   246     // Driver is tried to load everytime.
   247     TInt loadStatus( User::LoadLogicalDevice( KNameOfIsaAccessDriverLdd ) );
   247     TInt loadStatus( User::LoadLogicalDevice( KNameOfIsaAccessDriverLdd ) );
   248     C_TRACE( ( _T( "RIscApi::Open devicedriver loaded %d" ), loadStatus ) );
   248     C_TRACE( ( _T( "RIscApi::Open devicedriver loaded %d" ), loadStatus ) );
   249     OstTrace1( TRACE_NORMAL, DUY1_RISCAPI_LOAN, "RIscApi::Loan;loaded=%d", loadStatus );
   249     OstTrace1( TRACE_NORMAL, DUY1_RISCAPI_LOAN, "RIscApi::Loan;loaded=%d", loadStatus );
   353         }
   353         }
   354     else
   354     else
   355         {
   355         {
   356         C_TRACE((_T("RIscApi::Close error: channel number out of range")));
   356         C_TRACE((_T("RIscApi::Close error: channel number out of range")));
   357         OstTrace0( TRACE_NORMAL, DUP1_RISCAPI_CLOSE, "RIscApi::Close channelnumber out of range" );
   357         OstTrace0( TRACE_NORMAL, DUP1_RISCAPI_CLOSE, "RIscApi::Close channelnumber out of range" );
   358 //        TRACE_ASSERT_ALWAYS;        TODO: Trace assert?
   358 //        TRACE_ASSERT_ALWAYS;         Trace assert?
   359         }
   359         }
   360     C_TRACE( ( _T( "RIscApi::Close 0x%x <-" ), iChannelNumber ) );
   360     C_TRACE( ( _T( "RIscApi::Close 0x%x <-" ), iChannelNumber ) );
   361 
   361 
   362     OstTrace0( TRACE_NORMAL, RISCAPI_CLOSE_EXIT, "<RIscApi::Close" );
   362     OstTrace0( TRACE_NORMAL, RISCAPI_CLOSE_EXIT, "<RIscApi::Close" );
   363     }
   363     }
   944 
   944 
   945     C_TRACE( ( _T( "RIscApi::MaximumDataSize 0x%x ->" ), iChannelNumber ) );
   945     C_TRACE( ( _T( "RIscApi::MaximumDataSize 0x%x ->" ), iChannelNumber ) );
   946     PanicIfNotOpen();
   946     PanicIfNotOpen();
   947     TInt returnCode( DoControl( EIADGetMaxDataSize ) );
   947     TInt returnCode( DoControl( EIADGetMaxDataSize ) );
   948     // If positive the maximum amount of data in ISI or data message to be send
   948     // If positive the maximum amount of data in ISI or data message to be send
   949     // If negative, one of the error codes. TODO: add to documentation, check possible error codes.
   949     // If negative, one of the error codes.  add to documentation, check possible error codes.
   950     C_TRACE( ( _T( "RIscApi::MaximumDataSize 0x%x %d <-" ), iChannelNumber, returnCode ) );
   950     C_TRACE( ( _T( "RIscApi::MaximumDataSize 0x%x %d <-" ), iChannelNumber, returnCode ) );
   951 
   951 
   952     OstTrace1( TRACE_NORMAL, RISCAPI_MAXIMUMDATASIZE_EXIT, "<RIscApi::MaximumDataSize;return=%d", returnCode );
   952     OstTrace1( TRACE_NORMAL, RISCAPI_MAXIMUMDATASIZE_EXIT, "<RIscApi::MaximumDataSize;return=%d", returnCode );
   953     return returnCode;
   953     return returnCode;
   954     }
   954     }
   968 
   968 
   969     C_TRACE( ( _T( "RIscApi::GetChannelInfo 0x%x 0x%x ->" ), aChannel, &aInfo ) );
   969     C_TRACE( ( _T( "RIscApi::GetChannelInfo 0x%x 0x%x ->" ), aChannel, &aInfo ) );
   970     PanicIfNotOpen();
   970     PanicIfNotOpen();
   971     const TInt KChannelInfoMax( 2 );
   971     const TInt KChannelInfoMax( 2 );
   972     TInt error( aInfo.MaxLength() >= KChannelInfoMax ? KErrNone : KErrArgument );
   972     TInt error( aInfo.MaxLength() >= KChannelInfoMax ? KErrNone : KErrArgument );
   973     // TODO: Returns information of user channels only, not possible to get information
   973     //  Returns information of user channels only, not possible to get information
   974     // about kernel channels at the moment.
   974     // about kernel channels at the moment.
   975     // TODO: error if channel is out of range?
   975     //  error if channel is out of range?
   976     if( KErrArgument != error )
   976     if( KErrArgument != error )
   977         {
   977         {
   978         aInfo.SetLength( KChannelInfoMax );
   978         aInfo.SetLength( KChannelInfoMax );
   979         aInfo[ KFirstParam ] = static_cast<TUint8>( aChannel >> 8 );
   979         aInfo[ KFirstParam ] = static_cast<TUint8>( aChannel >> 8 );
   980         aInfo[ KSecondParam ] = static_cast<TUint8>( aChannel );
   980         aInfo[ KSecondParam ] = static_cast<TUint8>( aChannel );