accessoryservices/accessoryserver/src/Server/AccSrvSettingsHandler.cpp
branchRCL_3
changeset 15 21e939dd208a
parent 0 4e1aa6a622a0
child 56 1ddbe54d0645
equal deleted inserted replaced
11:8d1d8440b626 15:21e939dd208a
   252     HBufC8* buf = HBufC8::NewL( KHWDevicesFileMaxSize );
   252     HBufC8* buf = HBufC8::NewL( KHWDevicesFileMaxSize );
   253     CleanupStack::PushL( buf );
   253     CleanupStack::PushL( buf );
   254 
   254 
   255     TPtr8 ptrBuf( buf->Des() );
   255     TPtr8 ptrBuf( buf->Des() );
   256     User::LeaveIfError( session.Connect() );
   256     User::LeaveIfError( session.Connect() );
       
   257 	CleanupClosePushL ( session );
   257     User::LeaveIfError( file.Open( session, KHWDevicesFile, EFileRead ) );
   258     User::LeaveIfError( file.Open( session, KHWDevicesFile, EFileRead ) );
   258     file.Read( ptrBuf );
   259     file.Read( ptrBuf );
   259     file.Close();
   260     file.Close();
   260     session.Close();
       
   261 
   261 
   262     TLex8 l( ptrBuf );
   262     TLex8 l( ptrBuf );
   263     TInt32 temp;
   263     TInt32 temp;
   264     l.Val( temp );
   264     l.Val( temp );
   265     settings = static_cast< TUint32 >( temp );
   265     settings = static_cast< TUint32 >( temp );
   266 
   266 
   267     CleanupStack::Pop( buf );
   267 	CleanupStack::PopAndDestroy ( &session );
       
   268     CleanupStack::PopAndDestroy ( buf );
   268 
   269 
   269     COM_TRACE_1( "[AccFW:AccServer] CAccSrvSettingsHandler::GetSupportedHWDevicesL() - return %d", settings );
   270     COM_TRACE_1( "[AccFW:AccServer] CAccSrvSettingsHandler::GetSupportedHWDevicesL() - return %d", settings );
   270 
   271 
   271     return settings;
   272     return settings;
   272     }
   273     }