userlibandfileserver/fileserver/sfile/sf_drv.cpp
changeset 10 36bfc973b146
parent 9 96e5fb8b040d
child 8 538db54a451d
equal deleted inserted replaced
9:96e5fb8b040d 10:36bfc973b146
    15 // 
    15 // 
    16 //
    16 //
    17 
    17 
    18 #include "sf_std.h"
    18 #include "sf_std.h"
    19 #include "sf_file_cache.h"
    19 #include "sf_file_cache.h"
    20 #include <hal.h>
       
    21 
       
    22 
    20 
    23 
    21 
    24 //const TInt KMaxNotifierAttempts=4; // not used anywhere
    22 //const TInt KMaxNotifierAttempts=4; // not used anywhere
    25 
    23 
    26 static TPtrC StripBackSlash(const TDesC& aName)
    24 static TPtrC StripBackSlash(const TDesC& aName)
   883 // Get the drive info.
   881 // Get the drive info.
   884 //
   882 //
   885 	{
   883 	{
   886 	anInfo.iType=EMediaNotPresent;
   884 	anInfo.iType=EMediaNotPresent;
   887 	anInfo.iMediaAtt=0;
   885 	anInfo.iMediaAtt=0;
   888 
   886 	anInfo.iBattery=EBatNotSupported;
   889 	TInt batStatus=HAL::EPowerBatteryStatus_Zero;
   887     anInfo.iConnectionBusType=EConnectionBusInternal;
   890 	TInt r=HAL::Get(HAL::EPowerBatteryStatus, batStatus);
       
   891 	if (r==KErrNone)
       
   892 		{
       
   893 		switch(batStatus)
       
   894 			{
       
   895 		case HAL::EPowerBatteryStatus_Zero:
       
   896 			anInfo.iBattery=EBatLow;
       
   897 			break;
       
   898 		case HAL::EPowerBatteryStatus_Replace:
       
   899 			anInfo.iBattery=EBatLow;
       
   900 			break;
       
   901 		case HAL::EPowerBatteryStatus_Low:
       
   902 			anInfo.iBattery=EBatLow;
       
   903 			break;
       
   904 		case HAL::EPowerBatteryStatus_Good:
       
   905 			anInfo.iBattery=EBatGood;
       
   906 			break;
       
   907 			}		
       
   908 		}
       
   909 	else
       
   910 		anInfo.iBattery=EBatNotSupported;
       
   911 
   888 
   912 	if(iFSys)
   889 	if(iFSys)
   913 		{
   890 		{
   914 		TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemDriveInfo, EF32TraceUidFileSys, &FSys(), DriveNumber());
   891 		TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemDriveInfo, EF32TraceUidFileSys, &FSys(), DriveNumber());
   915 		FSys().DriveInfo(anInfo,DriveNumber());
   892 		FSys().DriveInfo(anInfo,DriveNumber());