diff --git a/.metadata/.lock b/.metadata/.lock new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.log b/.metadata/.log new file mode 100644 index 0000000..cd6695d --- /dev/null +++ b/.metadata/.log @@ -0,0 +1,86 @@ +!SESSION 2020-12-10 23:11:06.339 ----------------------------------------------- +eclipse.buildId=unknown +java.version=1.6.0_18 +java.vendor=Sun Microsystems Inc. +BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US +Command-line arguments: -os win32 -ws win32 -arch x86 + +!ENTRY org.eclipse.equinox.p2.metadata.repository 4 1000 2020-12-10 23:12:05.044 +!MESSAGE No repository found at http://tools.ext.nokia.com/carbide/updates/3.0. + +!ENTRY com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.PCCSConnection 4 0 2020-12-10 23:12:06.205 +!MESSAGE Carbide could not find a PC Suite installation. To install PC Suite, go to: https://tools.ext.nokia.com/PCsuite +!STACK 1 +org.eclipse.core.runtime.CoreException: Carbide could not find a PC Suite installation. To install PC Suite, go to: https://tools.ext.nokia.com/PCsuite + at com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.PCCSConnection.open(PCCSConnection.java:143) + at com.nokia.carbide.remoteconnections.discovery.pccs.agent.PCCSDiscoveryAgent.start(PCCSDiscoveryAgent.java:186) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$3.select(RemoteConnectionsActivator.java:276) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.loadExtensions(RemoteConnectionsActivator.java:320) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.loadAndStartDeviceDiscoveryAgents(RemoteConnectionsActivator.java:270) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.access$3(RemoteConnectionsActivator.java:267) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$1.run(RemoteConnectionsActivator.java:136) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$WhenWorkbenchIsVisibleThread.run(RemoteConnectionsActivator.java:90) +Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.IConnAPILibrary + at com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.PCCSConnection.open(PCCSConnection.java:127) + ... 7 more +!SUBENTRY 1 com.nokia.carbide.remoteConnections.discovery.pccs 4 1 2020-12-10 23:12:06.206 +!MESSAGE Carbide could not find a PC Suite installation. To install PC Suite, go to: https://tools.ext.nokia.com/PCsuite +!STACK 0 +java.lang.NoClassDefFoundError: Could not initialize class com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.IConnAPILibrary + at com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.PCCSConnection.open(PCCSConnection.java:127) + at com.nokia.carbide.remoteconnections.discovery.pccs.agent.PCCSDiscoveryAgent.start(PCCSDiscoveryAgent.java:186) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$3.select(RemoteConnectionsActivator.java:276) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.loadExtensions(RemoteConnectionsActivator.java:320) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.loadAndStartDeviceDiscoveryAgents(RemoteConnectionsActivator.java:270) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.access$3(RemoteConnectionsActivator.java:267) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$1.run(RemoteConnectionsActivator.java:136) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$WhenWorkbenchIsVisibleThread.run(RemoteConnectionsActivator.java:90) + +!ENTRY com.nokia.carbide.cpp.project.core 1 0 2020-12-10 23:15:02.921 +!MESSAGE Created 'mmcdump' (13 resources, 1 mmp files) in 1.29 sec. + +!ENTRY org.eclipse.cdt.core 1 0 2020-12-10 23:15:04.943 +!MESSAGE Indexed 'mmcdump' (1 sources, 17 headers) in 1.83 sec: 10,226 declarations; 10,541 references; 0 unresolved inclusions; 2,546 syntax errors; 328 unresolved names (1.55%) +!SESSION 2020-12-11 00:28:57.921 ----------------------------------------------- +eclipse.buildId=unknown +java.version=1.6.0_18 +java.vendor=Sun Microsystems Inc. +BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US +Command-line arguments: -os win32 -ws win32 -arch x86 + +!ENTRY com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.PCCSConnection 4 0 2020-12-11 00:29:05.938 +!MESSAGE Carbide could not find a PC Suite installation. To install PC Suite, go to: https://tools.ext.nokia.com/PCsuite +!STACK 1 +org.eclipse.core.runtime.CoreException: Carbide could not find a PC Suite installation. To install PC Suite, go to: https://tools.ext.nokia.com/PCsuite + at com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.PCCSConnection.open(PCCSConnection.java:143) + at com.nokia.carbide.remoteconnections.discovery.pccs.agent.PCCSDiscoveryAgent.start(PCCSDiscoveryAgent.java:186) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$3.select(RemoteConnectionsActivator.java:276) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.loadExtensions(RemoteConnectionsActivator.java:320) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.loadAndStartDeviceDiscoveryAgents(RemoteConnectionsActivator.java:270) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.access$3(RemoteConnectionsActivator.java:267) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$1.run(RemoteConnectionsActivator.java:136) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$WhenWorkbenchIsVisibleThread.run(RemoteConnectionsActivator.java:90) +Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.IConnAPILibrary + at com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.PCCSConnection.open(PCCSConnection.java:127) + ... 7 more +!SUBENTRY 1 com.nokia.carbide.remoteConnections.discovery.pccs 4 1 2020-12-11 00:29:05.938 +!MESSAGE Carbide could not find a PC Suite installation. To install PC Suite, go to: https://tools.ext.nokia.com/PCsuite +!STACK 0 +java.lang.NoClassDefFoundError: Could not initialize class com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.IConnAPILibrary + at com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative.PCCSConnection.open(PCCSConnection.java:127) + at com.nokia.carbide.remoteconnections.discovery.pccs.agent.PCCSDiscoveryAgent.start(PCCSDiscoveryAgent.java:186) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$3.select(RemoteConnectionsActivator.java:276) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.loadExtensions(RemoteConnectionsActivator.java:320) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.loadAndStartDeviceDiscoveryAgents(RemoteConnectionsActivator.java:270) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator.access$3(RemoteConnectionsActivator.java:267) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$1.run(RemoteConnectionsActivator.java:136) + at com.nokia.carbide.remoteconnections.RemoteConnectionsActivator$WhenWorkbenchIsVisibleThread.run(RemoteConnectionsActivator.java:90) + +!ENTRY org.eclipse.equinox.p2.metadata.repository 4 1000 2020-12-11 00:29:09.849 +!MESSAGE No repository found at http://tools.ext.nokia.com/carbide/updates/3.0. + +!ENTRY com.nokia.carbide.cpp.project.core 1 0 2020-12-11 00:32:53.453 +!MESSAGE Created 'accuracy' (13 resources, 1 mmp files) in 0.42 sec. + +!ENTRY org.eclipse.cdt.core 1 0 2020-12-11 00:32:54.726 +!MESSAGE Indexed 'accuracy' (1 sources, 17 headers) in 1.23 sec: 10,226 declarations; 10,541 references; 0 unresolved inclusions; 2,546 syntax errors; 328 unresolved names (1.55%) diff --git a/.metadata/.plugins/com.nokia.carbide.cpp.sdk.core/GCCE_UDEB_E__Dev_Symbian_8_0a_.dat b/.metadata/.plugins/com.nokia.carbide.cpp.sdk.core/GCCE_UDEB_E__Dev_Symbian_8_0a_.dat new file mode 100644 index 0000000..cd7963f Binary files /dev/null and b/.metadata/.plugins/com.nokia.carbide.cpp.sdk.core/GCCE_UDEB_E__Dev_Symbian_8_0a_.dat differ diff --git a/.metadata/.plugins/com.nokia.carbide.cpp.sdk.core/GCCE_UREL_E__Dev_Symbian_8_0a_.dat b/.metadata/.plugins/com.nokia.carbide.cpp.sdk.core/GCCE_UREL_E__Dev_Symbian_8_0a_.dat new file mode 100644 index 0000000..1e75e43 Binary files /dev/null and b/.metadata/.plugins/com.nokia.carbide.cpp.sdk.core/GCCE_UREL_E__Dev_Symbian_8_0a_.dat differ diff --git a/.metadata/.plugins/com.nokia.carbide.remoteConnections/connectionData.xml b/.metadata/.plugins/com.nokia.carbide.remoteConnections/connectionData.xml new file mode 100644 index 0000000..4971805 --- /dev/null +++ b/.metadata/.plugins/com.nokia.carbide.remoteConnections/connectionData.xml @@ -0,0 +1,4 @@ + + + + diff --git a/.metadata/.plugins/com.nokia.carbide.templatewizard/dialog_settings.xml b/.metadata/.plugins/com.nokia.carbide.templatewizard/dialog_settings.xml new file mode 100644 index 0000000..7ae1deb --- /dev/null +++ b/.metadata/.plugins/com.nokia.carbide.templatewizard/dialog_settings.xml @@ -0,0 +1,11 @@ + +
+ + + + + + + + +
diff --git a/.metadata/.plugins/org.eclipse.cdt.core/.log b/.metadata/.plugins/org.eclipse.cdt.core/.log new file mode 100644 index 0000000..4d236a7 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.cdt.core/.log @@ -0,0 +1,2 @@ +*** SESSION Dec 10, 2020 23:11:51.89 ------------------------------------------- +*** SESSION Dec 11, 2020 00:29:03.42 ------------------------------------------- diff --git a/.metadata/.plugins/org.eclipse.cdt.core/accuracy.1607621573479.pdom b/.metadata/.plugins/org.eclipse.cdt.core/accuracy.1607621573479.pdom new file mode 100644 index 0000000..d624ef5 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.cdt.core/accuracy.1607621573479.pdom differ diff --git a/.metadata/.plugins/org.eclipse.cdt.core/mmcdump.1607616903017.pdom b/.metadata/.plugins/org.eclipse.cdt.core/mmcdump.1607616903017.pdom new file mode 100644 index 0000000..7ddac0d Binary files /dev/null and b/.metadata/.plugins/org.eclipse.cdt.core/mmcdump.1607616903017.pdom differ diff --git a/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c b/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c @@ -0,0 +1 @@ + diff --git a/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp b/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp @@ -0,0 +1 @@ + diff --git a/.metadata/.plugins/org.eclipse.cdt.ui/dialog_settings.xml b/.metadata/.plugins/org.eclipse.cdt.ui/dialog_settings.xml new file mode 100644 index 0000000..8e47957 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.cdt.ui/dialog_settings.xml @@ -0,0 +1,7 @@ + +
+
+
+
+
+
diff --git a/.metadata/.plugins/org.eclipse.cdt.ui/mmcdump.build.log b/.metadata/.plugins/org.eclipse.cdt.ui/mmcdump.build.log new file mode 100644 index 0000000..4d5e79b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.cdt.ui/mmcdump.build.log @@ -0,0 +1,39 @@ + +***Building project "mmcdump" for configuration "Phone Debug (GCCE) [S60_2nd_FP2]" + +***Printing environment variables modified from default: +PATH=E:\Dev\Symbian\8.0a\epoc32\tools;E:\Dev\Symbian\8.0a\epoc32\gcc\bin;E:/Dev/Symbian/Carbide/jre/bin/client;E:/Dev/Symbian/Carbide/jre/bin;E:/Dev/Symbian/Carbide/jre/lib/i386;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Perl\bin\;E:\Dev\Symbian\Common\Tools;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files (x86)\CSL Arm Toolchain\bin;C:\Program Files\Graphviz 2.44.1\bin;E:\Dev\Python\Scripts\;E:\Dev\Python\;C:\Users\zhong\AppData\Local\Programs\Python\Launcher\;C:\Users\zhong\AppData\Local\Microsoft\WindowsApps;C:\Users\zhong\.dotnet\tools;E:\Dev\heroku\bin;C:\Users\zhong\AppData\Local\Programs\Microsoft VS Code\bin +=::=::\ +EPOCROOT=\Dev\Symbian\8.0a\ +NO_DEPENDENCIES=-nd +MAKE=make -j 4 + +Working Directory: E:/Dev/projects/akudama/mmcdump/group + + +***Invoking bldmake command +perl.exe -S bldmake.pl bldfiles + +Total Time: 1 sec + +***Invoking abld command +perl.exe -S ABLD.PL \Dev\projects\akudama\mmcdump\group\ export + make -r -f "\Dev\Symbian\8.0a\EPOC32\BUILD\Dev\projects\akudama\mmcdump\group\EXPORT.make" EXPORT VERBOSE=-s +Nothing to do + +Total Time: 2 sec + +***Generating abld makefile. + +***Invoking abld command +perl.exe -S ABLD.PL \Dev\projects\akudama\mmcdump\group\ makefile gcce mmcdump +This project does not support platform or program "GCCE" + +Total Time: 2 sec + +***Abld returned with exit value = 255 +***Stopping. + +***Errors were detected in build. See the Problems or Console view for details. + +Total Time: 2 sec diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/12/30ecf8de063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/12/30ecf8de063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..c35e6e5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/12/30ecf8de063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,71 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +class CMmcBusChannel: public RBusLogicalChannel { + +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/14/702f2eea063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/14/702f2eea063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..404fb56 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/14/702f2eea063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,76 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +class CMmcBusChannel: public RBusLogicalChannel { + CMmcBusChannel(); +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/15/6035e9c2093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/15/6035e9c2093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..829cd29 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/15/6035e9c2093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOther; + } +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/17/d056e6e4083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/17/d056e6e4083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..f91fcd2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/17/d056e6e4083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess)); +} + +TInt CMmcBusChannel::SelectCard(TInt aIndex) { + return DoControl(EMmcControlOpSelectCard, (TAny*)aIndex); +} + +TInt CMmcBusChannel::GetCardInfo(TMmcIfInfo *aInfo) { + return DoControl(EMmcControlOpCardInfo, aInfo); +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f0c98604103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f0c98604103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..a37b497 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f0c98604103b001b1ea0d1ee13b4299c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1d/5000aed00d3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/1d/5000aed00d3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..00eb1df --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1d/5000aed00d3b001b1ea0d1ee13b4299c @@ -0,0 +1,20 @@ +/* +============================================================================ + Name : accuracy.mmp + Author : + Copyright : Your copyright notice + Description : This is the project specification file for accuracy. +============================================================================ +*/ + +TARGET accuracy.exe +TARGETTYPE exe +UID 0 0xe2405073 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE accuracy.cpp + +LIBRARY euser.lib \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1d/50ad8a99103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/1d/50ad8a99103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..984930e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1d/50ad8a99103b001b1ea0d1ee13b4299c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x\n"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + + aFile.Write(outLine); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i]()); + + if (nerr != KErrNone) { + TBuf8<128> errLine; + errLine.Format(KTestFailFmtStr, i, nerr); + + infoFile.Write(errLine); + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1e/10f47d81063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/1e/10f47d81063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..50152a1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1e/10f47d81063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,68 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + RLogicalBusChannel mmcdev; + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/1e/704ca75e103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/1e/704ca75e103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..bd61ffb --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/1e/704ca75e103b001b1ea0d1ee13b4299c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i]()); + + if (nerr != KErrNone) { + TBuf + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/20/707b8ae80f3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/20/707b8ae80f3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..39e0978 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/20/707b8ae80f3b001b1ea0d1ee13b4299c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +void DoLocalCodeCheck(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(_L8()) + testChunk.Base(); + +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/24/2057704c083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/24/2057704c083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..9e8189d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/24/2057704c083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), 0, 0, 0, 0, EFalse)); +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/24/a08bfe04083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/24/a08bfe04083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..00a544e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/24/a08bfe04083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,11 @@ +#include "mmcbus.h" + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + + void ConstructL(); + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); +}; diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/28/a0af11f2063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/28/a0af11f2063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..7faab88 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/28/a0af11f2063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,78 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +class CMmcBusChannel: public RBusLogicalChannel { + CMmcBusChannel(); + + void ConstructL(); +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/29/e0d992aa083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/29/e0d992aa083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..8b9c563 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/29/e0d992aa083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,22 @@ +/* + ============================================================================ + Name : mmcdump.h + Author : + Copyright : Your copyright notice + Description : Exe header file + ============================================================================ + */ + +#ifndef __MMCDUMP_H__ +#define __MMCDUMP_H__ + +// Include Files + +#include + +// Function Prototypes + +GLDEF_C TInt E32Main(); + +#endif // __MMCDUMP_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/2a/005d8a7b063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/2a/005d8a7b063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..a537c03 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/2a/005d8a7b063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,68 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + RBusLogicalDevice mmcdev; + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/2f/d0e39bc7103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/2f/d0e39bc7103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..eea14ff --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/2f/d0e39bc7103b001b1ea0d1ee13b4299c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x\n"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + + aFile.Write(outLine); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (TUint32 i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i](infoFile)); + + if (nerr != KErrNone) { + TBuf8<128> errLine; + errLine.Format(KTestFailFmtStr, i, nerr); + + infoFile.Write(errLine); + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/30/001f7e440a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/30/001f7e440a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..d7603cf --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/30/001f7e440a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); +_LIT(KMmcFailDumpInfoFileStr, "Fail dumping MMC info!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +void DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); + + aOutputFile.Flush(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + TRAPD(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint() + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/30/600ebae10e3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/30/600ebae10e3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..c944a06 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/30/600ebae10e3b001b1ea0d1ee13b4299c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\MmcInfo.txt"); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/30/80c5ec1f083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/30/80c5ec1f083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..9f0b97c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/30/80c5ec1f083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,22 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + return TVersion(1, 0, 1); +} + +void CMmcBusChannel::ConstructL() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + User::LeaveIfError(this->DoCreate(KMmcIfDvcName, )) +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/30/9091abeb0f3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/30/9091abeb0f3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..b29ba4e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/30/9091abeb0f3b001b1ea0d1ee13b4299c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +void DoLocalCodeCheck(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/33/601634230a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/33/601634230a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..736fe3c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/33/601634230a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); + + aOutputFile.Flush(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/34/b0961a0f083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/34/b0961a0f083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..2060ef3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/34/b0961a0f083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCBUS_H__ +#define __MMCBUS_H__ + +#include + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +class CMmcBusChannel: public RBusLogicalChannel { + CMmcBusChannel(); + + void ConstructL(); + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); +}; + +#endif // __MMCBUS_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/35/a0556434083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/35/a0556434083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..5dc0910 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/35/a0556434083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), 0, 0, 0)); +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/36/e0a736f70d3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/36/e0a736f70d3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..2344c05 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/36/e0a736f70d3b001b1ea0d1ee13b4299c @@ -0,0 +1,82 @@ +/* + ============================================================================ + Name : accuracy.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "accuracy.h" +#include +#include +#include // Console + +// Constants + +_LIT(KTextConsoleTitle, "Console"); +_LIT(KTextFailed, " failed, leave code = %d"); +_LIT(KTextPressAnyKey, " [press any key]\n"); + +// Global Variables + +LOCAL_D CConsoleBase* console; // write all messages to this + + +// Local Functions + +LOCAL_C void MainL() + { + // + // add your program code here, example code below + // + console->Write(_L("Hello, world!\n")); + } + +LOCAL_C void DoStartL() + { + // Create active scheduler (to run active objects) + CActiveScheduler* scheduler = new (ELeave) CActiveScheduler(); + CleanupStack::PushL(scheduler); + CActiveScheduler::Install(scheduler); + + MainL(); + + // Delete active scheduler + CleanupStack::PopAndDestroy(scheduler); + } + +// Global Functions + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Create output console + TRAPD( + createError, + console = Console::NewL(KTextConsoleTitle, + TSize(KConsFullScreen, KConsFullScreen))); + if (createError) + { + delete cleanup; + return createError; + } + + // Run application code inside TRAP harness, wait keypress when terminated + TRAPD(mainError, DoStartL()); + if (mainError) + console->Printf(KTextFailed, mainError); + console->Printf(KTextPressAnyKey); + console->Getch(); + + delete console; + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/3c/f042d01b093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/3c/f042d01b093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..368ce8d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/3c/f042d01b093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + TMmcIfInfo info; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/3d/105bb883033b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/3d/105bb883033b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..36dc8a2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/3d/105bb883033b001b1ddeae2b9fcc6e7c @@ -0,0 +1,28 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4/0053ce330f3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/4/0053ce330f3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..87a0b41 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4/0053ce330f3b001b1ea0d1ee13b4299c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\MmcInfo.txt"); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/41/507fdbb9043b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/41/507fdbb9043b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..3a4c1c1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/41/507fdbb9043b001b1ddeae2b9fcc6e7c @@ -0,0 +1,43 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RFile infoFile; + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/44/b063c097073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/44/b063c097073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..6a7b765 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/44/b063c097073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,11 @@ +TARGET mmcdump.exe +TARGETTYPE exe +UID 0 0xe96fe421 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE mmcdump.cpp + +LIBRARY euser.lib diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/49/5008733e0a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/49/5008733e0a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..c389140 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/49/5008733e0a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +void DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); + + aOutputFile.Flush(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + TRAPD(err, DumpCardInfoL(infoFile)); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4a/70239b70063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/4a/70239b70063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..12e5dd2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4a/70239b70063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,54 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4a/b02e7903093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/4a/b02e7903093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..0a13315 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4a/b02e7903093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCBUS_H__ +#define __MMCBUS_H__ + +#include + +_LIT(KMmcIfDvcName, "MmcIf"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +class CMmcBusChannel: public RBusLogicalChannel { + CMmcBusChannel(); + + void ConstructL(); + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); + + TVersion GetVersion(); +}; + +#endif // __MMCBUS_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/51/10f8d3820f3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/51/10f8d3820f3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..d118486 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/51/10f8d3820f3b001b1ea0d1ee13b4299c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +void DoLocalCodeCheck(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/51/b09b5033083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/51/b09b5033083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..7a6e81b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/51/b09b5033083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(this->DoCreate(KMmcIfDvcName, )) +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/54/806833b3083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/54/806833b3083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..913ba4a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/54/806833b3083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,28 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess)); +} + +TInt CMmcBusChannel::SelectCard(TInt aIndex) { + return DoControl(EMmcControlOpSelectCard, (TAny*)aIndex); +} + +TInt CMmcBusChannel::GetCardInfo(TMmcIfInfo *aInfo) { + return DoControl(EMmcControlOpCardInfo, aInfo); +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/56/d0487cdf0d3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/56/d0487cdf0d3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..69aac6c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/56/d0487cdf0d3b001b1ea0d1ee13b4299c @@ -0,0 +1,11 @@ +TARGET accuracy.exe +TARGETTYPE exe +UID 0 0xe2405073 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE accuracy.cpp + +LIBRARY euser.lib \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/58/5023073c083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/58/5023073c083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..188d44a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/58/5023073c083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), 0, 0, 0, 0)); +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/59/10cd46540a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/59/10cd46540a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..a022d76 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/59/10cd46540a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); +_LIT(KMmcFailDumpInfoFileStr, "Fail dumping MMC info!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +void DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); + + aOutputFile.Flush(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + TRAPD(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + return KErrNone; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/59/600eedb8093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/59/600eedb8093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..1ff0c89 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/59/600eedb8093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + } +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0f20fae083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0f20fae083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..3f61c53 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0f20fae083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCDUMP_H__ +#define __MMCDUMP_H__ + +// Include Files + +#include + +// Function Prototypes + +GLDEF_C TInt E32Main(); + +#endif // __MMCDUMP_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10db0a2d0a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10db0a2d0a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..0796b35 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10db0a2d0a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +void DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); + + aOutputFile.Flush(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5c/7093917e0f3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/5c/7093917e0f3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..e9ea2ec --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5c/7093917e0f3b001b1ea0d1ee13b4299c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +void DoLocalCodeCheck(RFile &aFile) { + +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5c/b0dc76cf093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/5c/b0dc76cf093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..1bb84a9 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5c/b0dc76cf093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + } +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/5e/a0c07a69103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/5e/a0c07a69103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..0719537 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/5e/a0c07a69103b001b1ea0d1ee13b4299c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x\n"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + + aFile.Write(outLine); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i]()); + + if (nerr != KErrNone) { + TBuf8<128> errLine; + errLine.Format(KTestFailFmtStr, i, nerr); + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/60/2042c95d083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/60/2042c95d083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..bda9619 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/60/2042c95d083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), 0, NULL, NULL, EOwnerProcess, EFalse)); +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/61/50785e4b103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/61/50785e4b103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..8773043 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/61/50785e4b103b001b1ea0d1ee13b4299c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTest[i]()); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/62/f03aeadf0f3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/62/f03aeadf0f3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..08caef6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/62/f03aeadf0f3b001b1ea0d1ee13b4299c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +void DoLocalCodeCheck(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + TBuf8<128> outLine; + testChunk.Base(); + +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/66/a0522d18093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/66/a0522d18093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..5ad3ac2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/66/a0522d18093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + TMmcIfInfo + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/69/205264150a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/69/205264150a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..c3a8ddd --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/69/205264150a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/69/c0c5c75c0a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/69/c0c5c75c0a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..2268736 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/69/c0c5c75c0a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); +_LIT(KMmcFailDumpInfoFileStr, "Fail dumping MMC info!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +void DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); + + aOutputFile.Flush(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAPD(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/6a/b08f1ff7083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/6a/b08f1ff7083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..8e3886c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/6a/b08f1ff7083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/6c/c0684531103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/6c/c0684531103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..86af1c3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/6c/c0684531103b001b1ea0d1ee13b4299c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e0230b050a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e0230b050a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..f2d86fc --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e0230b050a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return NULL; +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format() + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/6e/4009708c053b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/6e/4009708c053b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..c8b0f88 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/6e/4009708c053b001b1ddeae2b9fcc6e7c @@ -0,0 +1,44 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RFile infoFile; + infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite); + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0c193a2103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0c193a2103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..4f3db3e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0c193a2103b001b1ea0d1ee13b4299c @@ -0,0 +1,11 @@ +TARGET accuracy.exe +TARGETTYPE exe +UID 0 0xe2405073 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE accuracy.cpp + +LIBRARY euser.lib \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/73/50efd76d073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/73/50efd76d073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..4acdb3d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/73/50efd76d073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCBUS_H__ +#define __MMCBUS_H__ + +// Include Files + +#include + +// Function Prototypes + +GLDEF_C TInt E32Main(); + +#endif // __MMCDUMP_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/75/80ba369c103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/75/80ba369c103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..36a18ec --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/75/80ba369c103b001b1ea0d1ee13b4299c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x\n"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + + aFile.Write(outLine); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i](infoFile)); + + if (nerr != KErrNone) { + TBuf8<128> errLine; + errLine.Format(KTestFailFmtStr, i, nerr); + + infoFile.Write(errLine); + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7c/3075100d103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/7c/3075100d103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..6f36c12 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7c/3075100d103b001b1ea0d1ee13b4299c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7d/a047c6a2093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/7d/a047c6a2093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..28562c6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7d/a047c6a2093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7e/8091076f0e3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/7e/8091076f0e3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..57e2832 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7e/8091076f0e3b001b1ea0d1ee13b4299c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/7f/70cf63a8093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/7f/70cf63a8093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..0347117 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/7f/70cf63a8093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + } +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8/1018787b073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/8/1018787b073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..c522cb6 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8/1018787b073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCBUS_H__ +#define __MMCBUS_H__ + +#include + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +#endif // __MMCBUS_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/87/400329fd093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/87/400329fd093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..71fd9b2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/87/400329fd093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return NULL; +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/88/00a992bd063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/88/00a992bd063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..4ef37de --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/88/00a992bd063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,68 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + RBusLogicalChannel mmcdev; + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f0da568c103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f0da568c103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..984930e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f0da568c103b001b1ea0d1ee13b4299c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x\n"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + + aFile.Write(outLine); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i]()); + + if (nerr != KErrNone) { + TBuf8<128> errLine; + errLine.Format(KTestFailFmtStr, i, nerr); + + infoFile.Write(errLine); + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f0d3bcde0e3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f0d3bcde0e3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..90d86f7 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f0d3bcde0e3b001b1ea0d1ee13b4299c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/92/f0872fcd0d3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/92/f0872fcd0d3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..110c8ae --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/92/f0872fcd0d3b001b1ea0d1ee13b4299c @@ -0,0 +1,22 @@ +/* +============================================================================ + Name : accuracy.mmp + Author : + Copyright : Your copyright notice + Description : This is the project specification file for accuracy. +============================================================================ +*/ + +TARGET accuracy.exe +TARGETTYPE exe +UID 0 0xe2405073 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE accuracy.cpp + +LIBRARY euser.lib + +DEBUGGABLE_UDEBONLY diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/94/40a22401073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/94/40a22401073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..4226235 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/94/40a22401073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,80 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +class CMmcBusChannel: public RBusLogicalChannel { + CMmcBusChannel(); + + void ConstructL(); + void SelectCard(TInt aIndex); + +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/94/b0a62223093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/94/b0a62223093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..e145082 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/94/b0a62223093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + TMmcIfInfo mmcInfo; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/99/600fe14e103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/99/600fe14e103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..38f0604 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/99/600fe14e103b001b1ea0d1ee13b4299c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i]()); + + if (nerr != KErrNone) { + TBuf + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c04b2bb6083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c04b2bb6083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..472ecc4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c04b2bb6083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,81 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +class CMmcBusChannel: public RBusLogicalChannel { + CMmcBusChannel(); + + void ConstructL(); + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a0/703e158a073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/a0/703e158a073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..9b999f8 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a0/703e158a073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,22 @@ +/* +============================================================================ + Name : mmcdump.mmp + Author : + Copyright : Your copyright notice + Description : This is the project specification file for mmcdump. +============================================================================ +*/ + +TARGET mmcdump.exe +TARGETTYPE exe +UID 0 0xe96fe421 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE mmcdump.cpp + +LIBRARY euser.lib + +DEBUGGABLE_UDEBONLY diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a2/006e8ae9093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/a2/006e8ae9093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..632df99 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a2/006e8ae9093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return NULL; +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a3/10721674073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/a3/10721674073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..bde9f97 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a3/10721674073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCBUS_H__ +#define __MMCBUS_H__ + +#include + +#endif // __MMCBUS_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/a4/00624915083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/a4/00624915083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..9aa5579 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/a4/00624915083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,18 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +void CMmcBusChannel::ConstructL() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + User::LeaveIfError(this->DoCreate(KMmcIfDvcName, )) +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a08e9092033b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a08e9092033b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..bc8be9e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a08e9092033b001b1ddeae2b9fcc6e7c @@ -0,0 +1,32 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +_LIT(KMmcIfLddName, "GD1DRV"); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/af/a0a27f16093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/af/a0a27f16093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..e016481 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/af/a0a27f16093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b0/008ccfb3093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/b0/008ccfb3093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..d5cc6b0 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b0/008ccfb3093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + } +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b0/f07d51af093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/b0/f07d51af093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..747e8ab --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b0/f07d51af093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + } +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b1/404411df083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/b1/404411df083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..82b3e72 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b1/404411df083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCBUS_H__ +#define __MMCBUS_H__ + +#include + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +class CMmcBusChannel: public RBusLogicalChannel { + CMmcBusChannel(); + + void ConstructL(); + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); + + TVersion GetVersion(); +}; + +#endif // __MMCBUS_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b5/807b39c0053b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/b5/807b39c0053b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..c2e50d5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b5/807b39c0053b001b1ddeae2b9fcc6e7c @@ -0,0 +1,53 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint() + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/b8/109309c7093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/b8/109309c7093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..54aaaed --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/b8/109309c7093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + } +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20163d3e083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20163d3e083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..9c8bac5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20163d3e083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), 0, 0, 0, 0), EFalse); +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20875e9b093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20875e9b093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..9d409f3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20875e9b093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + TMmcIfInfo mmcInfo; + + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b08833f70f3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b08833f70f3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..dfa4613 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b08833f70f3b001b1ea0d1ee13b4299c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c/4013b760083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c/4013b760083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..beeb493 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c/4013b760083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(this->DoCreate()(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess, EFalse)); +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c0/d04a1866073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c0/d04a1866073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..8c33919 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c0/d04a1866073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,22 @@ +/* + ============================================================================ + Name : mmcdump.h + Author : + Copyright : Your copyright notice + Description : Exe header file + ============================================================================ + */ + +#ifndef __MMCBUS_H__ +#define __MMCBUS_H__ + +// Include Files + +#include + +// Function Prototypes + +GLDEF_C TInt E32Main(); + +#endif // __MMCDUMP_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d0c3b193083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d0c3b193083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..dff6450 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d0c3b193083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,26 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess)); +} + +TInt CMmcBusChannel::SelectCard(TInt aIndex) { + return DoControl(EMmcControlOpSelectCard, (TAny*)aIndex); +} + +TInt CMmcBusChannel::GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c2/007ae692073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c2/007ae692073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..a5716eb --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c2/007ae692073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,13 @@ +TARGET mmcdump.exe +TARGETTYPE exe +UID 0 0xe96fe421 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE mmcdump.cpp + +LIBRARY euser.lib + +DEBUGGABLE_UDEBONLY diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c3/806ef918043b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c3/806ef918043b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..96e5952 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c3/806ef918043b001b1ddeae2b9fcc6e7c @@ -0,0 +1,37 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +_LIT(KMmcIfLddName, "GD1DRV"); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c4/e023de26103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/c4/e023de26103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..d43582d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c4/e023de26103b001b1ea0d1ee13b4299c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c5/30a73be9083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c5/30a73be9083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..40911aa --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c5/30a73be9083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c8/1094cf76063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c8/1094cf76063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..037c7c3 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c8/1094cf76063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,67 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c9/20a7e298083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c9/20a7e298083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..803e4a2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/c9/20a7e298083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,28 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess)); +} + +TInt CMmcBusChannel::SelectCard(TInt aIndex) { + return DoControl(EMmcControlOpSelectCard, (TAny*)aIndex); +} + +TInt CMmcBusChannel::GetCardInfo(TMmcIfInfo *aInfo) { + return DoControl(EMmcControlOpGetCardInfo, aInfo); +} diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/c9/801c0c14073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/c9/801c0c14073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ca/c06fffbb0f3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/ca/c06fffbb0f3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..3a8bbaf --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ca/c06fffbb0f3b001b1ea0d1ee13b4299c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +void DoLocalCodeCheck(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/cc/50c1728d073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/cc/50c1728d073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..69b4f93 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/cc/50c1728d073b001b1ddeae2b9fcc6e7c @@ -0,0 +1,13 @@ +TARGET mmcdump.exe +TARGETTYPE exe +UID 0 0xe96fe421 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE mmcdump.cpp + +LIBRARY euser.lib + +DEBUGGABLE_UDEBONLY diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f05d6f1a0a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f05d6f1a0a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..9920cfb --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f05d6f1a0a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d1/40916591053b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/d1/40916591053b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..21b17ea --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d1/40916591053b001b1ddeae2b9fcc6e7c @@ -0,0 +1,48 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d2/b06cdf0d0a3b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/d2/b06cdf0d0a3b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..9fd3bc9 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d2/b06cdf0d0a3b001b1ddeae2b9fcc6e7c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)"); +_LIT8(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + lineToWrite.Format(KMmcTypeFormatStr, ) + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d5/00c49c89103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/d5/00c49c89103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..17175ea --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d5/00c49c89103b001b1ea0d1ee13b4299c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x\n"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + + aFile.Write(outLine); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i]()); + + if (nerr != KErrNone) { + TBuf8<128> errLine; + errLine.Format(KTestFailFmtStr, i, nerr); + + infoFile.Write(errLine); + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70c68a1a103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70c68a1a103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..768241e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70c68a1a103b001b1ea0d1ee13b4299c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d5/8047f6e80d3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/d5/8047f6e80d3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..272dc1d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d5/8047f6e80d3b001b1ea0d1ee13b4299c @@ -0,0 +1,22 @@ +/* + ============================================================================ + Name : accuracy.h + Author : + Copyright : Your copyright notice + Description : Exe header file + ============================================================================ + */ + +#ifndef __ACCURACY_H__ +#define __ACCURACY_H__ + +// Include Files + +#include + +// Function Prototypes + +GLDEF_C TInt E32Main(); + +#endif // __ACCURACY_H__ + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d6/60d0f6bf093b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/d6/60d0f6bf093b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..943e89f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d6/60d0f6bf093b001b1ddeae2b9fcc6e7c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +_LIT(KMmcMediaTypeROMStr, "ROM"); +_LIT(KMmcMediaTypeFlashStr, "Flash"); +_LIT(KMmcMediaTypeIOStr, "IO"); +_LIT(KMmcMediaTypeOtherStr, "Other"); +_LIT(KMmcMediaTypeNotSupportedStr, "Not supported"); + +TDesC16 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + } +} + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf<256> lineToWrite; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/d8/5042848b083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/d8/5042848b083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..38fcd3f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/d8/5042848b083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,25 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess)); +} + +TInt CMmcBusChannel::SelectCard(TInt aIndex) { + return DoControl(EMmcControlOpSelectCard, aIndex); +} +TInt CMmcBusChannel::GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/db/201ef7fd083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/db/201ef7fd083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..5be3f0d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/db/201ef7fd083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +TInt DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel ch; + + User::FreeLogicalDevice(KMmcIfDvcName); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e/90d539b7083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/e/90d539b7083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..4df7c55 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e/90d539b7083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e/c01c4b70083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/e/c01c4b70083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..e7b4e2c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e/c01c4b70083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess, EFalse)); +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/e6/80a9b6660e3b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/e6/80a9b6660e3b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..46e8f27 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/e6/80a9b6660e3b001b1ea0d1ee13b4299c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)\n"); +_LIT8(KMmcIdFormatStr, "MMC ID: %08x-%08x-%08x-%08x\n"); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); +_LIT(KMmcFailDumpInfoFileStr, "Fail dumping MMC info!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +const TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +void DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + aOutputFile.Write(lineToWrite); + + lineToWrite.Format(KMmcIdFormatStr, mmcInfo.iMmcID[0], mmcInfo.iMmcID[1], mmcInfo.iMmcID[2], mmcInfo.iMmcID[3]); + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); + aOutputFile.Flush(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + delete cleanup; + __UHEAP_MARKEND; + return err; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/ea/c05c08b0073b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/ea/c05c08b0073b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f0/c075d384083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/f0/c075d384083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..a8e4a5c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f0/c075d384083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,23 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(this->DoCreate(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess)); +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f4/40733b7e063b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/f4/40733b7e063b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..42ebc29 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f4/40733b7e063b001b1ddeae2b9fcc6e7c @@ -0,0 +1,68 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + return 0; + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + RLogicalBusDevice mmcdev; + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/f6/603ba318083b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/f6/603ba318083b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..3994f5d --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/f6/603ba318083b001b1ddeae2b9fcc6e7c @@ -0,0 +1,22 @@ +#include "mmcbus.h" + +_LIT(KMmcIfDvcName, "MmcIf"); + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + +} + +void CMmcBusChannel::ConstructL() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + User::LeaveIfError(this->DoCreate(KMmcIfDvcName, )) +} + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/fa/704b8bbd053b001b1ddeae2b9fcc6e7c b/.metadata/.plugins/org.eclipse.core.resources/.history/fa/704b8bbd053b001b1ddeae2b9fcc6e7c new file mode 100644 index 0000000..b5b7173 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/fa/704b8bbd053b001b1ddeae2b9fcc6e7c @@ -0,0 +1,50 @@ +/* + ============================================================================ + Name : mmcdump.cpp + Author : + Copyright : Your copyright notice + Description : Exe source file + ============================================================================ + */ + +// Include Files + +#include "mmcdump.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT(KMmcTypeFormatStr, "MMC type: %s (%d)"); +_LIT(KMmcIdFormatStr, "MMC ID: "); + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + + } + + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/fc/809e6764103b001b1ea0d1ee13b4299c b/.metadata/.plugins/org.eclipse.core.resources/.history/fc/809e6764103b001b1ea0d1ee13b4299c new file mode 100644 index 0000000..53ef80b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/fc/809e6764103b001b1ea0d1ee13b4299c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + + aFile.Write(outLine); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (int i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i]()); + + if (nerr != KErrNone) { + TBuf8<128> errLine; + errLine.Format(KTestFailFmtStr, ) + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/7f/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/7f/history.index new file mode 100644 index 0000000..bf75112 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/7f/history.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/de/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/de/history.index new file mode 100644 index 0000000..e278405 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/de/history.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/e4/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/e4/history.index new file mode 100644 index 0000000..33e5f33 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/e4/history.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/e4/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/e4/properties.index new file mode 100644 index 0000000..1994d97 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/e4/properties.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/properties.index new file mode 100644 index 0000000..766206b Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/accuracy/.indexes/properties.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/7f/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/7f/history.index new file mode 100644 index 0000000..a9b994d Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/7f/history.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/de/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/de/history.index new file mode 100644 index 0000000..82e8071 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/de/history.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/de/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/de/properties.index new file mode 100644 index 0000000..4f2ca35 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/de/properties.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/e4/history.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/e4/history.index new file mode 100644 index 0000000..0c9bd71 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/e4/history.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/e4/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/e4/properties.index new file mode 100644 index 0000000..12cc738 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/e4/properties.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/properties.index new file mode 100644 index 0000000..45383f2 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.indexes/properties.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.markers b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.markers new file mode 100644 index 0000000..4becefd Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/mmcdump/.markers differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 0000000..25cb955 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000..bd2e71c Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version new file mode 100644 index 0000000..6b2aaa7 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree b/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree new file mode 100644 index 0000000..8dec695 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources new file mode 100644 index 0000000..fd0d625 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.nokia.carbide.cdt.builder.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.nokia.carbide.cdt.builder.prefs new file mode 100644 index 0000000..6721e8b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.nokia.carbide.cdt.builder.prefs @@ -0,0 +1,3 @@ +#Fri Dec 11 01:14:11 ICT 2020 +convertedSrcMappings2xTo3x=true +eclipse.preferences.version=1 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.core.prj-accuracy.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.core.prj-accuracy.prefs new file mode 100644 index 0000000..e95ca5a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.core.prj-accuracy.prefs @@ -0,0 +1,3 @@ +#Fri Dec 11 00:32:53 ICT 2020 +eclipse.preferences.version=1 +indexer/preferenceScope=0 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.core.prj-mmcdump.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.core.prj-mmcdump.prefs new file mode 100644 index 0000000..fd47d29 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.core.prj-mmcdump.prefs @@ -0,0 +1,3 @@ +#Thu Dec 10 23:15:03 ICT 2020 +eclipse.preferences.version=1 +indexer/preferenceScope=0 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.debug.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.debug.core.prefs new file mode 100644 index 0000000..1c4f315 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.debug.core.prefs @@ -0,0 +1,3 @@ +#Thu Dec 10 23:45:01 ICT 2020 +org.eclipse.cdt.debug.core.cDebug.common_source_containers=\r\n\r\n\r\n\r\n +eclipse.preferences.version=1 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs new file mode 100644 index 0000000..9d3879e --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs @@ -0,0 +1,5 @@ +#Fri Dec 11 00:09:31 ICT 2020 +spelling_locale_initialized=true +useAnnotationsPrefPage=true +eclipse.preferences.version=1 +useQuickDiffPrefPage=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..67c4922 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Thu Dec 10 23:15:02 ICT 2020 +version=1 +eclipse.preferences.version=1 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs new file mode 100644 index 0000000..83a69b7 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs @@ -0,0 +1,3 @@ +#Thu Dec 10 23:45:41 ICT 2020 +//org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.launch.applicationLaunchType=org.eclipse.cdt.cdi.launch.localCLaunch,run +eclipse.preferences.version=1 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs new file mode 100644 index 0000000..da27907 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs @@ -0,0 +1,4 @@ +#Thu Dec 10 23:52:32 ICT 2020 +eclipse.preferences.version=1 +preferredTargets=org.eclipse.cdt.debug.ui.toggleCBreakpointTarget\:org.eclipse.cdt.debug.ui.toggleCBreakpointTarget| +org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\r\n\r\n diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs new file mode 100644 index 0000000..68f061c --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs @@ -0,0 +1,4 @@ +#Fri Dec 11 01:14:11 ICT 2020 +eclipse.preferences.version=1 +overviewRuler_migration=migrated_3.1 +lineNumberRuler=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 0000000..a413139 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,6 @@ +#Fri Dec 11 00:09:31 ICT 2020 +eclipse.preferences.version=1 +tipsAndTricks=true +platformState=1558747664156 +quickStart=false +PROBLEMS_FILTERS_MIGRATE=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..fc3024a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,3 @@ +#Fri Dec 11 00:09:31 ICT 2020 +eclipse.preferences.version=1 +//org.eclipse.ui.commands/state/org.eclipse.cdt.debug.edc.ui.snapshotCreation/org.eclipse.ui.commands.radioState=manual diff --git a/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2020/12/50/refactorings.history b/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2020/12/50/refactorings.history new file mode 100644 index 0000000..f683584 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2020/12/50/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2020/12/50/refactorings.index b/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2020/12/50/refactorings.index new file mode 100644 index 0000000..73079ee --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2020/12/50/refactorings.index @@ -0,0 +1 @@ +1607621649408 Delete resource 'accuracy/inc/accuracy.h' diff --git a/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/mmcdump/2020/12/50/refactorings.history b/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/mmcdump/2020/12/50/refactorings.history new file mode 100644 index 0000000..f1111ca --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/mmcdump/2020/12/50/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/mmcdump/2020/12/50/refactorings.index b/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/mmcdump/2020/12/50/refactorings.index new file mode 100644 index 0000000..4876827 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/mmcdump/2020/12/50/refactorings.index @@ -0,0 +1 @@ +1607618702225 Rename resource 'mmcbus' diff --git a/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml new file mode 100644 index 0000000..27eb404 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml @@ -0,0 +1,7 @@ + +
+
+ + +
+
diff --git a/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml new file mode 100644 index 0000000..dd230a1 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml @@ -0,0 +1,9 @@ + +
+
+ + + + +
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml new file mode 100644 index 0000000..5ca0b77 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml @@ -0,0 +1,3 @@ + +
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml new file mode 100644 index 0000000..454f6e4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml @@ -0,0 +1,431 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..a7bd60a --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.metadata/version.ini b/.metadata/version.ini new file mode 100644 index 0000000..c51ff74 --- /dev/null +++ b/.metadata/version.ini @@ -0,0 +1 @@ +org.eclipse.core.runtime=1 \ No newline at end of file diff --git a/accuracy/.cproject b/accuracy/.cproject new file mode 100644 index 0000000..eb40824 --- /dev/null +++ b/accuracy/.cproject @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/accuracy/.project b/accuracy/.project new file mode 100644 index 0000000..bdac217 --- /dev/null +++ b/accuracy/.project @@ -0,0 +1,19 @@ + + + accuracy + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff --git a/accuracy/group/ABLD.BAT b/accuracy/group/ABLD.BAT new file mode 100644 index 0000000..e758af8 --- /dev/null +++ b/accuracy/group/ABLD.BAT @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\DEV\PROJECTS\AKUDAMA\ACCURACY\GROUP\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff --git a/accuracy/group/accuracy.mmp b/accuracy/group/accuracy.mmp new file mode 100644 index 0000000..3b65a5a --- /dev/null +++ b/accuracy/group/accuracy.mmp @@ -0,0 +1,11 @@ +TARGET accuracy.exe +TARGETTYPE exe +UID 0 0xe2405073 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE accuracy.cpp + +LIBRARY euser.lib efsrv.lib \ No newline at end of file diff --git a/accuracy/group/bld.inf b/accuracy/group/bld.inf new file mode 100644 index 0000000..0d0bd23 --- /dev/null +++ b/accuracy/group/bld.inf @@ -0,0 +1,15 @@ +/* +============================================================================ + Name : bld.inf + Author : + Copyright : Your copyright notice + Description : This file provides the information required for building the + whole of a accuracy. +============================================================================ +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +accuracy.mmp diff --git a/accuracy/sis/accuracy_EKA2.pkg b/accuracy/sis/accuracy_EKA2.pkg new file mode 100644 index 0000000..0412b7b --- /dev/null +++ b/accuracy/sis/accuracy_EKA2.pkg @@ -0,0 +1,24 @@ +; Installation file for Symbian OS 9.x for generic console application +; Installation file for accuracy EXE +; +; This is an auto-generated PKG file by Carbide. +; This file uses variables specific to Carbide builds that will not work +; on command-line builds. If you want to use this generated PKG file from the +; command-line tools you will need to modify the variables with the appropriate +; values: $(EPOCROOT), $(PLATFORM), $(TARGET) +; + +; +; UID is the exe's UID +; +#{"accuracy EXE"},(0xe2405073),1,0,0 + + +;Localised Vendor name +%{"Vendor-EN"} + +;Unique Vendor name +:"Vendor" + +"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\accuracy.exe" -"!:\sys\bin\accuracy.exe" + diff --git a/accuracy/src/accuracy.cpp b/accuracy/src/accuracy.cpp new file mode 100644 index 0000000..777b699 --- /dev/null +++ b/accuracy/src/accuracy.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include +#include +#include + +_LIT(KAccuracyOutputPath, "C:\\AccuracyCheck.txt"); +_LIT(KMmcFailOpenAccuracyFileStr, "Fail opening file to write tests!"); + +_LIT8(KTestFailFmtStr, "Test %d failed with code %d"); + +typedef void (*TestFuncType)(RFile &); + +void DoLocalCodeCheckL(RFile &aFile) { + const TUint32 KTestCodeChunkSize = 0x1000; + + RChunk testChunk; + User::LeaveIfError(testChunk.CreateLocalCode(KTestCodeChunkSize, KTestCodeChunkSize, EOwnerProcess)); + + _LIT8(KLocalCodeChunkOutLineStr, "Base address of local code chunk is 0x%08x\n"); + + TBuf8<128> outLine; + outLine.Format(KLocalCodeChunkOutLineStr, (TUint32)testChunk.Base()); + + aFile.Write(outLine); + testChunk.Close(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + RFile infoFile; + if (infoFile.Replace(fs, KAccuracyOutputPath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenAccuracyFileStr); + } else { + TestFuncType listTests[] = { DoLocalCodeCheckL }; + + for (TUint32 i = 0; i < sizeof(listTests) / sizeof(TestFuncType); i++) { + TRAPD(nerr, listTests[i](infoFile)); + + if (nerr != KErrNone) { + TBuf8<128> errLine; + errLine.Format(KTestFailFmtStr, i, nerr); + + infoFile.Write(errLine); + } + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + diff --git a/mmcdump/.cproject b/mmcdump/.cproject new file mode 100644 index 0000000..1f0c297 --- /dev/null +++ b/mmcdump/.cproject @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mmcdump/.project b/mmcdump/.project new file mode 100644 index 0000000..92f8210 --- /dev/null +++ b/mmcdump/.project @@ -0,0 +1,19 @@ + + + mmcdump + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff --git a/mmcdump/group/ABLD.BAT b/mmcdump/group/ABLD.BAT new file mode 100644 index 0000000..4a64891 --- /dev/null +++ b/mmcdump/group/ABLD.BAT @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\DEV\PROJECTS\AKUDAMA\MMCDUMP\GROUP\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff --git a/mmcdump/group/bld.inf b/mmcdump/group/bld.inf new file mode 100644 index 0000000..a14e479 --- /dev/null +++ b/mmcdump/group/bld.inf @@ -0,0 +1,15 @@ +/* +============================================================================ + Name : bld.inf + Author : + Copyright : Your copyright notice + Description : This file provides the information required for building the + whole of a mmcdump. +============================================================================ +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +mmcdump.mmp diff --git a/mmcdump/group/mmcdump.mmp b/mmcdump/group/mmcdump.mmp new file mode 100644 index 0000000..64a0539 --- /dev/null +++ b/mmcdump/group/mmcdump.mmp @@ -0,0 +1,11 @@ +TARGET mmcdump.exe +TARGETTYPE exe +UID 0 0xe96fe421 + +USERINCLUDE ..\inc +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH ..\src +SOURCE mmcdump.cpp mmcbus.cpp + +LIBRARY euser.lib efsrv.lib diff --git a/mmcdump/inc/mmcbus.h b/mmcdump/inc/mmcbus.h new file mode 100644 index 0000000..b854057 --- /dev/null +++ b/mmcdump/inc/mmcbus.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCBUS_H__ +#define __MMCBUS_H__ + +#include + +_LIT(KMmcIfDvcName, "MmcIf"); + +enum TMmcMediaType { + EMmcROM, + EMmcFlash, + EMmcIO, + EMmcOther, + EMmcNotSupported +}; + +struct TMmcIfInfo { + TUint32 iMmcID[4]; + TUint32 iMmcType; +}; + +enum TMmcControlOp { + EMmcControlOpSelectCard = 4, + EMmcControlOpCardInfo = 6 +}; + +class CMmcBusChannel: public RBusLogicalChannel { +public: + CMmcBusChannel(); + + void ConstructL(); + + TInt SelectCard(TInt aIndex); + TInt GetCardInfo(TMmcIfInfo *aInfo); + + TVersion GetVersion(); +}; + +#endif // __MMCBUS_H__ + diff --git a/mmcdump/inc/mmcdump.h b/mmcdump/inc/mmcdump.h new file mode 100644 index 0000000..b37492e --- /dev/null +++ b/mmcdump/inc/mmcdump.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#ifndef __MMCDUMP_H__ +#define __MMCDUMP_H__ + +#include + +GLDEF_C TInt E32Main(); + +#endif // __MMCDUMP_H__ + diff --git a/mmcdump/src/mmcbus.cpp b/mmcdump/src/mmcbus.cpp new file mode 100644 index 0000000..980ae8d --- /dev/null +++ b/mmcdump/src/mmcbus.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcbus.h" + +CMmcBusChannel::CMmcBusChannel() + : RBusLogicalChannel() { +} + +TVersion CMmcBusChannel::GetVersion() { + TVersion dver; + dver.iMajor = 1; + dver.iMinor = 0; + dver.iBuild = 1; + + return dver; +} + +void CMmcBusChannel::ConstructL() { + User::LeaveIfError(DoCreate(KMmcIfDvcName, GetVersion(), NULL, 0, NULL, NULL, EOwnerProcess)); +} + +TInt CMmcBusChannel::SelectCard(TInt aIndex) { + return DoControl(EMmcControlOpSelectCard, (TAny*)aIndex); +} + +TInt CMmcBusChannel::GetCardInfo(TMmcIfInfo *aInfo) { + return DoControl(EMmcControlOpCardInfo, aInfo); +} diff --git a/mmcdump/src/mmcdump.cpp b/mmcdump/src/mmcdump.cpp new file mode 100644 index 0000000..8ff6547 --- /dev/null +++ b/mmcdump/src/mmcdump.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2020 EKA2L1 Team. + * + * This work is licensed under the terms of the MIT license. + * For a copy, see . + */ + +#include "mmcdump.h" +#include "mmcbus.h" + +#include +#include +#include + +#include + +_LIT(KMmcIfLddName, "GD1DRV"); +_LIT(KMmcInfoFilePath, "C:\\MmcInfo.txt"); + +_LIT8(KMmcTypeFormatStr, "MMC type: %S (%d)\n"); +_LIT8(KMmcIdFormatStr, "MMC ID: %08x-%08x-%08x-%08x\n"); + +_LIT(KMmcFailOpenDumpInfoFileStr, "Fail opening MMC info dump file!"); +_LIT(KMmcFailDumpInfoFileStr, "Fail dumping MMC info!"); + +_LIT8(KMmcMediaTypeROMStr, "ROM"); +_LIT8(KMmcMediaTypeFlashStr, "Flash"); +_LIT8(KMmcMediaTypeIOStr, "IO"); +_LIT8(KMmcMediaTypeOtherStr, "Other"); +_LIT8(KMmcMediaTypeNotSupportedStr, "Not supported"); + +const TDesC8 *GetMmcMediaTypeStr(const TInt aType) { + switch (aType) { + case EMmcROM: + return &KMmcMediaTypeROMStr; + + case EMmcFlash: + return &KMmcMediaTypeFlashStr; + + case EMmcIO: + return &KMmcMediaTypeIOStr; + + case EMmcOther: + return &KMmcMediaTypeOtherStr; + + case EMmcNotSupported: + return &KMmcMediaTypeNotSupportedStr; + + default: + break; + } + + return &KMmcMediaTypeNotSupportedStr; +} + +void DumpCardInfoL(RFile &aOutputFile) { + // Load logical device + User::LoadLogicalDevice(KMmcIfLddName); + + CMmcBusChannel mmcDev; + mmcDev.ConstructL(); + + User::LeaveIfError(mmcDev.SelectCard(0)); + + // Get card info + TMmcIfInfo mmcInfo; + User::LeaveIfError(mmcDev.GetCardInfo(&mmcInfo)); + + TBuf8<256> lineToWrite; + + lineToWrite.Format(KMmcTypeFormatStr, GetMmcMediaTypeStr(mmcInfo.iMmcType), mmcInfo.iMmcType); + aOutputFile.Write(lineToWrite); + + lineToWrite.Format(KMmcIdFormatStr, mmcInfo.iMmcID[0], mmcInfo.iMmcID[1], mmcInfo.iMmcID[2], mmcInfo.iMmcID[3]); + aOutputFile.Write(lineToWrite); + + User::FreeLogicalDevice(KMmcIfDvcName); + aOutputFile.Flush(); +} + +GLDEF_C TInt E32Main() + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Connect to FS service first + RFs fs; + fs.Connect(-1); + + RNotifier notifier; + notifier.Connect(); + + TInt err = KErrNone; + + RFile infoFile; + if (infoFile.Replace(fs, KMmcInfoFilePath, EFileShareAny|EFileWrite) != KErrNone) { + notifier.InfoPrint(KMmcFailOpenDumpInfoFileStr); + } else { + TRAP(err, DumpCardInfoL(infoFile)); + + if (err != KErrNone) { + notifier.InfoPrint(KMmcFailDumpInfoFileStr); + } + } + + infoFile.Close(); + notifier.Close(); + fs.Close(); + + delete cleanup; + __UHEAP_MARKEND; + return err; + } +