diff --git a/Labs/Lab2/requirements/src/pcd/.vs/pcd/FileContentIndex/9e1d62dc-8a3e-46b5-8824-c500b2b0b459.vsidx b/Labs/Lab2/requirements/src/pcd/.vs/pcd/FileContentIndex/9e1d62dc-8a3e-46b5-8824-c500b2b0b459.vsidx new file mode 100644 index 0000000..1004f28 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/.vs/pcd/FileContentIndex/9e1d62dc-8a3e-46b5-8824-c500b2b0b459.vsidx differ diff --git a/Labs/Lab2/requirements/src/pcd/.vs/pcd/FileContentIndex/e977a2ad-d4c4-493f-9768-9902bcac2c1c.vsidx b/Labs/Lab2/requirements/src/pcd/.vs/pcd/FileContentIndex/e977a2ad-d4c4-493f-9768-9902bcac2c1c.vsidx new file mode 100644 index 0000000..70aef67 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/.vs/pcd/FileContentIndex/e977a2ad-d4c4-493f-9768-9902bcac2c1c.vsidx differ diff --git a/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/.suo b/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/.suo new file mode 100644 index 0000000..f855889 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/.suo differ diff --git a/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/Browse.VC.db b/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/Browse.VC.db new file mode 100644 index 0000000..96c6f96 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/Browse.VC.db differ diff --git a/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/Solution.VC.db b/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/Solution.VC.db new file mode 100644 index 0000000..3428f03 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/Solution.VC.db differ diff --git a/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/fileList.bin b/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/fileList.bin new file mode 100644 index 0000000..0782e62 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/.vs/pcd/v17/fileList.bin differ diff --git a/Labs/Lab2/requirements/src/pcd/Debug/pcd.exe b/Labs/Lab2/requirements/src/pcd/Debug/pcd.exe new file mode 100644 index 0000000..edf73a5 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/Debug/pcd.exe differ diff --git a/Labs/Lab2/requirements/src/pcd/Debug/pcd.pdb b/Labs/Lab2/requirements/src/pcd/Debug/pcd.pdb new file mode 100644 index 0000000..201889a Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/Debug/pcd.pdb differ diff --git a/Labs/Lab2/requirements/src/pcd/ipch/pcd-7e06187c/pcd-98c53d03.ipch b/Labs/Lab2/requirements/src/pcd/ipch/pcd-7e06187c/pcd-98c53d03.ipch new file mode 100644 index 0000000..dc41624 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/ipch/pcd-7e06187c/pcd-98c53d03.ipch differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd.sdf b/Labs/Lab2/requirements/src/pcd/pcd.sdf new file mode 100644 index 0000000..8b1a024 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd.sdf differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd.sln b/Labs/Lab2/requirements/src/pcd/pcd.sln new file mode 100644 index 0000000..19b3959 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcd", "pcd\pcd.vcxproj", "{52A56147-DD63-4F16-B275-8E0E36743540}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {52A56147-DD63-4F16-B275-8E0E36743540}.Debug|Win32.ActiveCfg = Debug|Win32 + {52A56147-DD63-4F16-B275-8E0E36743540}.Debug|Win32.Build.0 = Debug|Win32 + {52A56147-DD63-4F16-B275-8E0E36743540}.Release|Win32.ActiveCfg = Release|Win32 + {52A56147-DD63-4F16-B275-8E0E36743540}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Labs/Lab2/requirements/src/pcd/pcd.suo b/Labs/Lab2/requirements/src/pcd/pcd.suo new file mode 100644 index 0000000..ce612f3 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd.suo differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/PktAnalysis_ISO14443A.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/PktAnalysis_ISO14443A.obj new file mode 100644 index 0000000..6750606 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/PktAnalysis_ISO14443A.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.Build.CppClean.log b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.Build.CppClean.log new file mode 100644 index 0000000..64321c5 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.Build.CppClean.log @@ -0,0 +1,57 @@ +E:\VSRFID\PCD\DEBUG\PCD.EXE +E:\VSRFID\PCD\DEBUG\PCD.ILK +E:\VSRFID\PCD\DEBUG\PCD.PDB +E:\vsrfid\pcd\pcd\Debug\cl.command.1.tlog +E:\vsrfid\pcd\pcd\Debug\CL.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\CL.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.12508.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.12508.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.12508-cvtres.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.12508-cvtres.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.12688.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.12688.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.12688-cvtres.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.12688-cvtres.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.14224.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.14224.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.14224-cvtres.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.14224-cvtres.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.33272.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.33272.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.33272-cvtres.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.33272-cvtres.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.command.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\link-cvtres.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\link-cvtres.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\mt.command.1.tlog +E:\vsrfid\pcd\pcd\Debug\mt.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\mt.write.1.tlog +E:\VSRFID\PCD\PCD\DEBUG\PCD.EXE.EMBED.MANIFEST +E:\VSRFID\PCD\PCD\DEBUG\PCD.EXE.EMBED.MANIFEST.RES +E:\VSRFID\PCD\PCD\DEBUG\PCD.EXE.INTERMEDIATE.MANIFEST +E:\VSRFID\PCD\PCD\DEBUG\PCD.OBJ +E:\VSRFID\PCD\PCD\DEBUG\PCD.PCH +E:\VSRFID\PCD\PCD\DEBUG\PCD.RES +E:\vsrfid\pcd\pcd\Debug\pcd.vcxprojResolveAssemblyReference.cache +E:\vsrfid\pcd\pcd\Debug\pcd.write.1.tlog +E:\vsrfid\pcd\pcd\Debug\pcd_manifest.rc +E:\VSRFID\PCD\PCD\DEBUG\PCD_THREAD.OBJ +E:\VSRFID\PCD\PCD\DEBUG\PCDDLG.OBJ +E:\VSRFID\PCD\PCD\DEBUG\PICC_THREAD.OBJ +E:\VSRFID\PCD\PCD\DEBUG\PKTANALYSIS_ISO14443A.OBJ +E:\vsrfid\pcd\pcd\Debug\rc.command.1.tlog +E:\vsrfid\pcd\pcd\Debug\rc.read.1.tlog +E:\vsrfid\pcd\pcd\Debug\rc.write.1.tlog +E:\VSRFID\PCD\PCD\DEBUG\RFID_CHK.OBJ +E:\VSRFID\PCD\PCD\DEBUG\RFID_COM.OBJ +E:\VSRFID\PCD\PCD\DEBUG\RFID_ISO14443A_CMDRX.OBJ +E:\VSRFID\PCD\PCD\DEBUG\RFID_ISO14443A_CMDTX.OBJ +E:\VSRFID\PCD\PCD\DEBUG\RFID_ISO14443A_CODEC.OBJ +E:\VSRFID\PCD\PCD\DEBUG\RFID_ISO14443A_FRM.OBJ +E:\VSRFID\PCD\PCD\DEBUG\RFID_ISO14443A_PCD.OBJ +E:\VSRFID\PCD\PCD\DEBUG\RFID_ISO14443A_PICC.OBJ +E:\VSRFID\PCD\PCD\DEBUG\STDAFX.OBJ +E:\vsrfid\pcd\pcd\Debug\vc100.idb +E:\VSRFID\PCD\PCD\DEBUG\VC100.PDB diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.exe.recipe b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.exe.recipe new file mode 100644 index 0000000..0f79bfa --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\Debug\pcd.exe + + + + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.ilk b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.ilk new file mode 100644 index 0000000..995e95f Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.ilk differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.log b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.log new file mode 100644 index 0000000..73d13ef --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.log @@ -0,0 +1,167 @@ + pcd_thread.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/pcd_thread.cpp”) + + picc_thread.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/picc_thread.cpp”) + + PktAnalysis_ISO14443A.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/PktAnalysis_ISO14443A.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(46,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(59,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(72,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(84,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(89,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(93,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(94,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(95,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(96,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(97,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(98,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(103,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(104,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(108,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(116,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(119,7): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(120,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(126,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(129,7): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(130,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(132,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(136,7): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(137,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(145,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(146,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(165,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(170,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(171,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(179,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(180,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(184,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(185,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(187,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(188,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(191,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(192,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(195,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(196,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(203,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(204,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(208,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(212,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(214,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(218,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(25,7): warning C4101: “str”: 未引用的局部变量 +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(302,28): warning C4474: sprintf: 格式字符串中传递的参数太多 + D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(302,28): + 占位符和其参数预计 0 可变参数,但提供的却是 1 参数 + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(250,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(251,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(252,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(255,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(256,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(257,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(262,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(266,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(270,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(277,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(278,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(284,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(287,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(288,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(293,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(294,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(300,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(301,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(302,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(308,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(309,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(310,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(313,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(314,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(315,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(318,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(319,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(331,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(332,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(336,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(337,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(343,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(347,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(348,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + rfid_chk.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_chk.cpp”) + + rfid_com.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_com.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(122,33): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(209,34): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(405,6): warning C4101: “sin_len”: 未引用的局部变量 +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(406,12): warning C4101: “i”: 未引用的局部变量 + rfid_iso14443A_cmdrx.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_cmdrx.cpp”) + + rfid_iso14443A_cmdtx.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_cmdtx.cpp”) + + rfid_iso14443A_codec.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_codec.cpp”) + + rfid_iso14443A_frm.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_frm.cpp”) + + rfid_iso14443A_pcd.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_pcd.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(35,14): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(43,15): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(46,10): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(84,16): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(750,6): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(755,8): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(756,8): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + rfid_iso14443A_picc.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_picc.cpp”) + + 正在生成代码... +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(245): warning C4715: “RFID_COM_Init”: 不是所有的控件路径都返回值 +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(226): warning C4715: “CPktAnalysis_ISO14443A::getDesp”: 不是所有的控件路径都返回值 + pcd.cpp + pcdDlg.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“/pcdDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\pcdDlg.cpp(318,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/pcdDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\pcdDlg.cpp(319,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/pcdDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\pcdDlg.cpp(320,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/pcdDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\pcdDlg.cpp(321,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/pcdDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\pcdDlg.cpp(330,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/pcdDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\pcdDlg.cpp(345,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/pcdDlg.cpp”) + + 正在生成代码... + LINK : 没有找到 D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\Debug\pcd.exe 或上一个增量链接没有生成它;正在执行完全链接 + pcd.vcxproj -> D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\Debug\pcd.exe diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.obj new file mode 100644 index 0000000..f3da9dc Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.pch b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.pch new file mode 100644 index 0000000..77fd36e Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.pch differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.res b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.res new file mode 100644 index 0000000..0a213c4 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.res differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.command.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.command.1.tlog new file mode 100644 index 0000000..7721977 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.command.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.read.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.read.1.tlog new file mode 100644 index 0000000..50fa96e Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.read.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.write.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.write.1.tlog new file mode 100644 index 0000000..df5cd53 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/CL.write.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/Cl.items.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/Cl.items.tlog new file mode 100644 index 0000000..9a8de6d --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/Cl.items.tlog @@ -0,0 +1,14 @@ +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\pcd_thread.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\pcd_thread.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\picc_thread.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\picc_thread.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\PktAnalysis_ISO14443A.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_chk.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\rfid_chk.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\rfid_com.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_cmdrx.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\rfid_iso14443A_cmdrx.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_cmdtx.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\rfid_iso14443A_cmdtx.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_codec.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\rfid_iso14443A_codec.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_frm.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\rfid_iso14443A_frm.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\rfid_iso14443A_pcd.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_picc.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\rfid_iso14443A_picc.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\pcd.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\pcd.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\pcdDlg.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\pcdDlg.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\stdafx.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\pcd\Debug\stdafx.obj diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.command.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.command.1.tlog new file mode 100644 index 0000000..4432dc1 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.command.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.read.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.read.1.tlog new file mode 100644 index 0000000..8fc32ec Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.read.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.write.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.write.1.tlog new file mode 100644 index 0000000..0d616c6 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/link.write.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/pcd.lastbuildstate b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/pcd.lastbuildstate new file mode 100644 index 0000000..7e28230 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/pcd.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.38.33130:TargetPlatformVersion=10.0.22000.0: +Debug|Win32|D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\pcd\| diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.command.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.command.1.tlog new file mode 100644 index 0000000..7a47c61 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.command.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.read.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.read.1.tlog new file mode 100644 index 0000000..7772e16 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.read.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.write.1.tlog b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.write.1.tlog new file mode 100644 index 0000000..c7a5ba2 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd.tlog/rc.write.1.tlog differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcdDlg.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcdDlg.obj new file mode 100644 index 0000000..f3e1fd7 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcdDlg.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd_thread.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd_thread.obj new file mode 100644 index 0000000..b9a0fe0 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/pcd_thread.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/picc_thread.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/picc_thread.obj new file mode 100644 index 0000000..5887b6b Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/picc_thread.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_chk.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_chk.obj new file mode 100644 index 0000000..af8ddf6 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_chk.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_com.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_com.obj new file mode 100644 index 0000000..d5e800f Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_com.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_cmdrx.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_cmdrx.obj new file mode 100644 index 0000000..743b28b Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_cmdrx.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_cmdtx.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_cmdtx.obj new file mode 100644 index 0000000..2a3060e Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_cmdtx.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_codec.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_codec.obj new file mode 100644 index 0000000..5bea062 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_codec.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_frm.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_frm.obj new file mode 100644 index 0000000..edc532c Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_frm.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_pcd.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_pcd.obj new file mode 100644 index 0000000..813793a Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_pcd.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_picc.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_picc.obj new file mode 100644 index 0000000..dd339cb Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/rfid_iso14443A_picc.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/stdafx.obj b/Labs/Lab2/requirements/src/pcd/pcd/Debug/stdafx.obj new file mode 100644 index 0000000..7dd2bf8 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/stdafx.obj differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/vc143.idb b/Labs/Lab2/requirements/src/pcd/pcd/Debug/vc143.idb new file mode 100644 index 0000000..b927ac8 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/vc143.idb differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/Debug/vc143.pdb b/Labs/Lab2/requirements/src/pcd/pcd/Debug/vc143.pdb new file mode 100644 index 0000000..108b584 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/Debug/vc143.pdb differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/ReadMe.txt b/Labs/Lab2/requirements/src/pcd/pcd/ReadMe.txt new file mode 100644 index 0000000..c903657 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/ReadMe.txt @@ -0,0 +1,74 @@ +================================================================================ +MICROSOFT : pcd Ŀ +=============================================================================== + +ӦóΪ pcd Ӧó򡣴Ӧó򲻽ʾ Microsoft Ļʹ÷ΪдӦó㡣 + +ļҪ pcd Ӧóÿļݡ + +pcd.vcxproj +ʹӦóɵ VC++ ĿĿļ +ɸļ Visual C++ İ汾ϢԼйʹӦóѡƽ̨úĿܵϢ + +pcd.vcxproj.filters + ʹáӦó򵼡ɵ VC++ Ŀɸѡļ + йĿļɸѡ֮ĹϢ IDE УֹͨضڵԷʽʾչļ磬.cppļ롰Դļɸѡ + +pcd.h +ӦóҪͷļĿضͷļ( Resource.h) CpcdApp Ӧóࡣ + +pcd.cpp +ǰӦó CpcdApp ҪӦóԴļ + +pcd.rc +dzʹõ Microsoft Windows Դб RES Ŀ¼д洢ͼꡢλͼ͹ꡣļֱ Microsoft Visual C++ нб༭ĿԴλ 2052 С + +res\pcd.ico +ӦóͼͼļͼҪԴļ pcd.rc С + +res\pcd.rc2 +ļ Microsoft Visual C++ нб༭ԴӦýԴ༭༭ԴڴļС + + +///////////////////////////////////////////////////////////////////////////// + +Ӧó򵼴һԻ: + +pcdDlg.hpcdDlg.cpp - Ի +Щļ CpcdDlg ࡣඨӦóԻΪöԻģλ pcd.rc Уļ Microsoft Visual C++ нб༭ + + +///////////////////////////////////////////////////////////////////////////// + +: + +ActiveX ؼ +Ӧóʹ ActiveX ؼ֧֡ + +///////////////////////////////////////////////////////////////////////////// + +׼ļ: + +StdAfx.hStdAfx.cpp +ЩļΪ pcd.pch Ԥͷ (PCH) ļΪ StdAfx.obj Ԥļ + +Resource.h +DZ׼ͷļµԴ ID +Microsoft Visual C++ ȡ´ļ + +pcd.manifest + Ӧó嵥ļ Windows XP Ӧó + ض汾г򼯵ԡسʹô + Ϣӳ򼯻ʵij򼯻 + Ӧó˽ϢӦó嵥Ϊ·ַΪ + Ӧóִļװͬļеⲿ .manifest ļ + ҲԴʽڸÿִļС +///////////////////////////////////////////////////////////////////////////// + +ע: + +ӦóʹáTODO:ָʾӦӻԶԴ벿֡ + +Ӧóڹ DLL ʹ MFCҪ·Щ MFC DLLӦóõϵͳĵǰòͬҪ·ӦıػԴ MFC100XXX.DLLйĸϢμ MSDN ĵй Redistributing Visual C++ applications (· Visual C++ Ӧó)½ڡ + +///////////////////////////////////////////////////////////////////////////// diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcd.aps b/Labs/Lab2/requirements/src/pcd/pcd/pcd.aps new file mode 100644 index 0000000..03a3bab Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/pcd.aps differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcd.cpp b/Labs/Lab2/requirements/src/pcd/pcd/pcd.cpp new file mode 100644 index 0000000..4cb0308 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/pcd.cpp @@ -0,0 +1,94 @@ + +// pcd.cpp : ӦóΪ +// + +#include "stdafx.h" +#include "pcd.h" +#include "pcdDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CpcdApp + +BEGIN_MESSAGE_MAP(CpcdApp, CWinApp) + ON_COMMAND(ID_HELP, &CWinApp::OnHelp) +END_MESSAGE_MAP() + + +// CpcdApp + +CpcdApp::CpcdApp() +{ + // ֧ + m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; + + // TODO: ڴ˴ӹ룬 + // Ҫijʼ InitInstance +} + + +// Ψһһ CpcdApp + +CpcdApp theApp; + + +// CpcdApp ʼ + +BOOL CpcdApp::InitInstance() +{ + // һ Windows XP ϵӦó嵥ָҪ + // ʹ ComCtl32.dll 汾 6 ߰汾ÿӻʽ + //Ҫ InitCommonControlsEx()򣬽޷ڡ + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // ΪҪӦóʹõ + // ؼࡣ + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + + CWinApp::InitInstance(); + + + AfxEnableControlContainer(); + + // shell ԷԻ + // κ shell ͼؼ shell бͼؼ + CShellManager *pShellManager = new CShellManager; + + // ׼ʼ + // δʹЩܲϣС + // տִļĴСӦƳ + // Ҫضʼ + // ڴ洢õע + // TODO: Ӧʵ޸ĸַ + // ޸Ϊ˾֯ + SetRegistryKey(_T("ӦóɵıӦó")); + + CpcdDlg dlg; + m_pMainWnd = &dlg; + INT_PTR nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: ڴ˷ôʱ + // ȷرնԻĴ + } + else if (nResponse == IDCANCEL) + { + // TODO: ڴ˷ôʱ + // ȡرնԻĴ + } + + // ɾ洴 shell + if (pShellManager != NULL) + { + delete pShellManager; + } + + // ڶԻѹرգԽ FALSE Ա˳Ӧó + // ӦóϢá + return FALSE; +} + diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcd.h b/Labs/Lab2/requirements/src/pcd/pcd/pcd.h new file mode 100644 index 0000000..ed1dce4 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/pcd.h @@ -0,0 +1,32 @@ + +// pcd.h : PROJECT_NAME Ӧóͷļ +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "ڰļ֮ǰstdafx.h PCH ļ" +#endif + +#include "resource.h" // + + +// CpcdApp: +// йشʵ֣ pcd.cpp +// + +class CpcdApp : public CWinApp +{ +public: + CpcdApp(); + +// д +public: + virtual BOOL InitInstance(); + +// ʵ + + DECLARE_MESSAGE_MAP() +}; + +extern CpcdApp theApp; \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcd.rc b/Labs/Lab2/requirements/src/pcd/pcd/pcd.rc new file mode 100644 index 0000000..8c9a33f Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/pcd.rc differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj b/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj new file mode 100644 index 0000000..475450f --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj @@ -0,0 +1,174 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {52A56147-DD63-4F16-B275-8E0E36743540} + pcd + MFCProj + + + + Application + true + MultiByte + Dynamic + v143 + + + Application + false + true + MultiByte + Dynamic + v143 + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + + + Windows + true + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0804 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0804 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + + + Create + Create + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj.filters b/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj.filters new file mode 100644 index 0000000..d4f8c03 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj.filters @@ -0,0 +1,128 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + 资源文件 + + + 资源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj.user b/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj.user new file mode 100644 index 0000000..3f03091 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/pcd.vcxproj.user @@ -0,0 +1,6 @@ + + + + false + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcdDlg.cpp b/Labs/Lab2/requirements/src/pcd/pcd/pcdDlg.cpp new file mode 100644 index 0000000..3cbd024 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/pcdDlg.cpp @@ -0,0 +1,355 @@ + +// pcdDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "pcd.h" +#include "pcdDlg.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\pcd_thread.h" +#include "..\..\rfidsrc\PktAnalysis_ISO14443A.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +#define WM_USER_PCD_RX_CMD (WM_USER + 1000) + +// Ӧó򡰹ڡ˵ CAboutDlg Ի + +class CAboutDlg : public CDialogEx +{ +public: + CAboutDlg(); + +// Ի + enum { IDD = IDD_ABOUTBOX }; + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + +// ʵ +protected: + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD) +{ +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) +END_MESSAGE_MAP() + + +// CpcdDlg Ի + + + + +CpcdDlg::CpcdDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CpcdDlg::IDD, pParent) +{ + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + m_nRx_udp_port = 10000; + m_nTx_udp_port = 10001; + m_nBitValue = 0; + m_nPCDStatus = 0; + m_nRowNo = 0; +} + +void CpcdDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_RX_UDP_PORT, m_nRx_udp_port); + DDV_MinMaxInt(pDX, m_nRx_udp_port, 1, 65535); + DDX_Text(pDX, IDC_EDIT_TX_UDP_PORT, m_nTx_udp_port); + DDV_MinMaxInt(pDX, m_nTx_udp_port, 1, 65535); + DDX_Radio(pDX, IDC_RADIO_BV, m_nBitValue); + DDX_Radio(pDX, IDC_RADIO_PCD_STATUS, m_nPCDStatus); + DDV_MinMaxInt(pDX, m_nPCDStatus, 0, 4); + DDX_Control(pDX, IDC_LIST_INFO, m_clist_Info); +} + +BEGIN_MESSAGE_MAP(CpcdDlg, CDialogEx) + ON_WM_SYSCOMMAND() + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_BN_CLICKED(IDC_BUTTON_STEP, &CpcdDlg::OnBnClickedButtonStep) + ON_BN_CLICKED(IDC_BUTTON_RUN, &CpcdDlg::OnClickedButtonRun) + ON_BN_CLICKED(IDC_BUTTON_STOP, &CpcdDlg::OnClickedButtonStop) + + ON_MESSAGE(WM_USER_PCD_RX_CMD, &CpcdDlg::OnPcdRxCmd) + +END_MESSAGE_MAP() + + +// CpcdDlg Ϣ + +BOOL CpcdDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // ...˵ӵϵͳ˵С + + // IDM_ABOUTBOX ϵͳΧڡ + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + m_nRowNo = 0; + init_ListCtrl(); + + // ô˶ԻͼꡣӦóڲǶԻʱܽԶ + // ִд˲ + SetIcon(m_hIcon, TRUE); // ôͼ + SetIcon(m_hIcon, FALSE); // Сͼ + + // TODO: ڴӶijʼ + GetDlgItem(IDC_BUTTON_STEP)->EnableWindow(); + GetDlgItem(IDC_BUTTON_RUN)->EnableWindow(); + GetDlgItem(IDC_BUTTON_STOP)->EnableWindow(0); + + return TRUE; // ǽõؼ򷵻 TRUE +} + +void CpcdDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + if ((nID & 0xFFF0) == IDM_ABOUTBOX) + { + CAboutDlg dlgAbout; + dlgAbout.DoModal(); + } + else + { + CDialogEx::OnSysCommand(nID, lParam); + } +} + +// ԻСťҪĴ +// Ƹͼꡣʹĵ/ͼģ͵ MFC Ӧó +// ⽫ɿԶɡ + +void CpcdDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // ڻƵ豸 + + SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); + + // ʹͼڹо + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // ͼ + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialogEx::OnPaint(); + } +} + +//û϶Сʱϵͳô˺ȡù +//ʾ +HCURSOR CpcdDlg::OnQueryDragIcon() +{ + return static_cast(m_hIcon); +} + + +extern bool g_bRun; +extern bool g_bStep; +extern int g_nStep; + +void CpcdDlg::OnBnClickedButtonStep() +{ + // TODO: ڴӿؼ֪ͨ + + DWORD ThreadId; + PCD_Thread_In_prm inPrm; + + UpdateData( ); + m_nRowNo = 0; + + m_nPCDStatus = 1; + UpdateData(false); + + g_bStep = true; + g_nStep = -1; + + inPrm.hWnd = this->m_hWnd; + inPrm.uMsgId = WM_USER_PCD_RX_CMD; + inPrm.u16_pcd_rx_port = m_nRx_udp_port; + inPrm.u16_picc_rx_port = m_nTx_udp_port; + inPrm.nBitValue = m_nBitValue; + + m_hThreadPcd=CreateThread(NULL, + 0, + (LPTHREAD_START_ROUTINE)pcd_thread, + (void *)&inPrm, + 0, + &ThreadId); + + GetDlgItem(IDC_BUTTON_STEP)->EnableWindow(0); + GetDlgItem(IDC_BUTTON_RUN)->EnableWindow(0); + GetDlgItem(IDC_BUTTON_STOP)->EnableWindow(); +} + +void CpcdDlg::OnClickedButtonRun() +{ + // TODO: ڴӿؼ֪ͨ + + DWORD ThreadId; + PCD_Thread_In_prm inPrm; + + UpdateData( ); + m_nRowNo = 0; + + m_nPCDStatus = 1; + UpdateData(false); + + g_bStep = false; + + inPrm.hWnd = this->m_hWnd; + inPrm.uMsgId = WM_USER_PCD_RX_CMD; + inPrm.u16_pcd_rx_port = m_nRx_udp_port; + inPrm.u16_picc_rx_port = m_nTx_udp_port; + inPrm.nBitValue = m_nBitValue; + + m_hThreadPcd=CreateThread(NULL, + 0, + (LPTHREAD_START_ROUTINE)pcd_thread, + (void *)&inPrm, + 0, + &ThreadId); + + + GetDlgItem(IDC_BUTTON_STEP)->EnableWindow(0); + GetDlgItem(IDC_BUTTON_RUN)->EnableWindow(0); + GetDlgItem(IDC_BUTTON_STOP)->EnableWindow(); +} + + +void CpcdDlg::OnClickedButtonStop() +{ + // TODO: ڴӿؼ֪ͨ + g_nStep++; +} + +LRESULT CpcdDlg::OnPcdRxCmd(WPARAM wParam, LPARAM lParam) +{ + if( !wParam ) + { + m_nPCDStatus = lParam; + UpdateData(false); + return NULL; + } + + PCD_Thread_Out_prm* pOutPrm = (PCD_Thread_Out_prm*)wParam; + + addItem( pOutPrm->buf, pOutPrm->nBufBitLen, pOutPrm->npcd_cmd, pOutPrm->action ); + return NULL; +} + +int CpcdDlg::init_ListCtrl(void) +{ + LONG style = GetWindowLong( m_clist_Info.m_hWnd, GWL_STYLE ); + style &= ~LVS_TYPEMASK; + style |= LVS_REPORT; + SetWindowLong( m_clist_Info.m_hWnd, GWL_STYLE, style ); + + DWORD dwStyle = m_clist_Info.GetExtendedStyle(); + dwStyle |= LVS_EX_FULLROWSELECT; + dwStyle |= LVS_EX_GRIDLINES; + m_clist_Info.SetExtendedStyle( dwStyle ); + + m_clist_Info.InsertColumn(0, "" ); + m_clist_Info.SetColumnWidth( 0, 40 ); + m_clist_Info.InsertColumn(1, "" ); // tx or rx + m_clist_Info.SetColumnWidth( 1, 40 ); + m_clist_Info.InsertColumn(2, "(16)" ); // ͻ߽յݰ; + m_clist_Info.SetColumnWidth( 2, 150 ); + m_clist_Info.InsertColumn(3, "" ); // /Ӧ + m_clist_Info.SetColumnWidth( 3, 100 ); + m_clist_Info.InsertColumn(4, "" ); // Ľ + m_clist_Info.SetColumnWidth( 4, 430 ); + m_clist_Info.InsertColumn(5, "" ); // ִеһ + m_clist_Info.SetColumnWidth( 5, 230 ); + + return 0; +} + +// úݣ뵽listctrl +int CpcdDlg::addItem(byte* buf, int nbitLen, int pcd_cmd, char *action ) +{ + CPktAnalysis_ISO14443A pcd; + char *items[5]; + for( int i = 0; i < 5; i++ ) + { + items[i] = new char[1024]; + } + + if( !buf ) + { + // ; + sprintf( items[0], "rx" ); + sprintf( items[1], "26" ); + sprintf( items[2], "REQA" ); + sprintf( items[3], "" ); + + addItem( items ); + } + + pcd.analysis( buf, nbitLen, items[0], items[1], items[2], items[3], pcd_cmd ); + items[4][0] = 0x00; + if( action ) + { + strcpy( items[4], action ); + } + + addItem( items ); + for( int i = 0; i < 4; i++ ) + { + delete[] items[i]; + } + return 1; +} + +int CpcdDlg::addItem( char* items[] ) +{ + char no[10]; + + sprintf(no, "%d", m_nRowNo ); + m_clist_Info.InsertItem( m_nRowNo, no ); + m_clist_Info.SetItemText( m_nRowNo, 1, items[0] ); + m_clist_Info.SetItemText( m_nRowNo, 2, items[1] ); + m_clist_Info.SetItemText( m_nRowNo, 3, items[2] ); + m_clist_Info.SetItemText( m_nRowNo, 4, items[3] ); + m_clist_Info.SetItemText( m_nRowNo, 5, items[4] ); + m_nRowNo++; + + return 1; +} diff --git a/Labs/Lab2/requirements/src/pcd/pcd/pcdDlg.h b/Labs/Lab2/requirements/src/pcd/pcd/pcdDlg.h new file mode 100644 index 0000000..5e5f887 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/pcdDlg.h @@ -0,0 +1,53 @@ + +// pcdDlg.h : ͷļ +// + +#pragma once + + +// CpcdDlg Ի +class CpcdDlg : public CDialogEx +{ +// +public: + CpcdDlg(CWnd* pParent = NULL); // ׼캯 + +// Ի + enum { IDD = IDD_PCD_DIALOG }; + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + +// ʵ +protected: + HICON m_hIcon; + HANDLE m_hThreadPcd; // picc_thread handle. + + // ɵϢӳ亯 + virtual BOOL OnInitDialog(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + afx_msg LRESULT OnPcdRxCmd(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +public: + int m_nRx_udp_port; + int m_nTx_udp_port; + int m_nBitValue; + int m_nPCDStatus; + afx_msg void OnBnClickedButtonStep(); + afx_msg void OnClickedButtonRun(); + afx_msg void OnClickedButtonStop(); + +protected: + int init_ListCtrl(void); + int addItem( char *items[] ); + +public: + int addItem(byte* buf, int nbitLen, int pcd_cmd, char *action ); + + CListCtrl m_clist_Info; + int m_nRowNo; +}; diff --git a/Labs/Lab2/requirements/src/pcd/pcd/res/pcd.ico b/Labs/Lab2/requirements/src/pcd/pcd/res/pcd.ico new file mode 100644 index 0000000..d56fbcd Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/res/pcd.ico differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/res/pcd.rc2 b/Labs/Lab2/requirements/src/pcd/pcd/res/pcd.rc2 new file mode 100644 index 0000000..0d2bb23 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/res/pcd.rc2 differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/resource.h b/Labs/Lab2/requirements/src/pcd/pcd/resource.h new file mode 100644 index 0000000..34bf7f1 Binary files /dev/null and b/Labs/Lab2/requirements/src/pcd/pcd/resource.h differ diff --git a/Labs/Lab2/requirements/src/pcd/pcd/stdafx.cpp b/Labs/Lab2/requirements/src/pcd/pcd/stdafx.cpp new file mode 100644 index 0000000..606269e --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/stdafx.cpp @@ -0,0 +1,8 @@ + +// stdafx.cpp : ֻ׼ļԴļ +// pcd.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + + diff --git a/Labs/Lab2/requirements/src/pcd/pcd/stdafx.h b/Labs/Lab2/requirements/src/pcd/pcd/stdafx.h new file mode 100644 index 0000000..fac7631 --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/stdafx.h @@ -0,0 +1,58 @@ + +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ + +#pragma once + +#ifndef _SECURE_ATL +#define _SECURE_ATL 1 +#endif + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Windows ͷųʹõ +#endif + +#include "targetver.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString 캯ʽ + +// ر MFC ijЩɷĺԵľϢ +#define _AFX_ALL_WARNINGS + +#include // MFC ͱ׼ +#include // MFC չ + + +#include // MFC Զ + + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC Internet Explorer 4 ؼ֧ +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC Windows ؼ֧ +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include // Ϳؼ MFC ֧ + + + + + + + + + +#ifdef _UNICODE +#if defined _M_IX86 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") +#elif defined _M_X64 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#else +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#endif +#endif + + diff --git a/Labs/Lab2/requirements/src/pcd/pcd/targetver.h b/Labs/Lab2/requirements/src/pcd/pcd/targetver.h new file mode 100644 index 0000000..0afac5b --- /dev/null +++ b/Labs/Lab2/requirements/src/pcd/pcd/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h ߰汾Ŀ Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/Labs/Lab2/requirements/src/picc/.vs/VSWorkspaceState.json b/Labs/Lab2/requirements/src/picc/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..6b61141 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/.vs/VSWorkspaceState.json @@ -0,0 +1,6 @@ +{ + "ExpandedNodes": [ + "" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/2267d0e4-279e-487b-9b79-ce492b2425ea.vsidx b/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/2267d0e4-279e-487b-9b79-ce492b2425ea.vsidx new file mode 100644 index 0000000..70aef67 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/2267d0e4-279e-487b-9b79-ce492b2425ea.vsidx differ diff --git a/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/5c51c71b-6565-452a-b159-20be99684908.vsidx b/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/5c51c71b-6565-452a-b159-20be99684908.vsidx new file mode 100644 index 0000000..6bb5dfc Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/5c51c71b-6565-452a-b159-20be99684908.vsidx differ diff --git a/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/5f080aad-52d2-48da-a6dd-866376b64c8a.vsidx b/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/5f080aad-52d2-48da-a6dd-866376b64c8a.vsidx new file mode 100644 index 0000000..70aef67 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/.vs/picc/FileContentIndex/5f080aad-52d2-48da-a6dd-866376b64c8a.vsidx differ diff --git a/Labs/Lab2/requirements/src/picc/.vs/picc/v17/.suo b/Labs/Lab2/requirements/src/picc/.vs/picc/v17/.suo new file mode 100644 index 0000000..781b8f7 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/.vs/picc/v17/.suo differ diff --git a/Labs/Lab2/requirements/src/picc/.vs/picc/v17/.wsuo b/Labs/Lab2/requirements/src/picc/.vs/picc/v17/.wsuo new file mode 100644 index 0000000..7b9a965 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/.vs/picc/v17/.wsuo differ diff --git a/Labs/Lab2/requirements/src/picc/.vs/picc/v17/Browse.VC.db b/Labs/Lab2/requirements/src/picc/.vs/picc/v17/Browse.VC.db new file mode 100644 index 0000000..7b1ed4e Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/.vs/picc/v17/Browse.VC.db differ diff --git a/Labs/Lab2/requirements/src/picc/.vs/picc/v17/Solution.VC.db b/Labs/Lab2/requirements/src/picc/.vs/picc/v17/Solution.VC.db new file mode 100644 index 0000000..a7aec5f Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/.vs/picc/v17/Solution.VC.db differ diff --git a/Labs/Lab2/requirements/src/picc/.vs/slnx.sqlite b/Labs/Lab2/requirements/src/picc/.vs/slnx.sqlite new file mode 100644 index 0000000..6749f61 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/.vs/slnx.sqlite differ diff --git a/Labs/Lab2/requirements/src/picc/Debug/picc.exe b/Labs/Lab2/requirements/src/picc/Debug/picc.exe new file mode 100644 index 0000000..5142381 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/Debug/picc.exe differ diff --git a/Labs/Lab2/requirements/src/picc/Debug/picc.pdb b/Labs/Lab2/requirements/src/picc/Debug/picc.pdb new file mode 100644 index 0000000..17896b5 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/Debug/picc.pdb differ diff --git a/Labs/Lab2/requirements/src/picc/ipch/picc-82c7ee74/picc-80903a0b.ipch b/Labs/Lab2/requirements/src/picc/ipch/picc-82c7ee74/picc-80903a0b.ipch new file mode 100644 index 0000000..28c1067 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/ipch/picc-82c7ee74/picc-80903a0b.ipch differ diff --git a/Labs/Lab2/requirements/src/picc/picc.sdf b/Labs/Lab2/requirements/src/picc/picc.sdf new file mode 100644 index 0000000..12ec0c2 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc.sdf differ diff --git a/Labs/Lab2/requirements/src/picc/picc.sln b/Labs/Lab2/requirements/src/picc/picc.sln new file mode 100644 index 0000000..1af6a55 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "picc", "picc\picc.vcxproj", "{2BB9FD04-E6FA-42DA-9B19-CE9D8CD8D58B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2BB9FD04-E6FA-42DA-9B19-CE9D8CD8D58B}.Debug|Win32.ActiveCfg = Debug|Win32 + {2BB9FD04-E6FA-42DA-9B19-CE9D8CD8D58B}.Debug|Win32.Build.0 = Debug|Win32 + {2BB9FD04-E6FA-42DA-9B19-CE9D8CD8D58B}.Release|Win32.ActiveCfg = Release|Win32 + {2BB9FD04-E6FA-42DA-9B19-CE9D8CD8D58B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Labs/Lab2/requirements/src/picc/picc.suo b/Labs/Lab2/requirements/src/picc/picc.suo new file mode 100644 index 0000000..0549443 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc.suo differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/PktAnalysis_ISO14443A.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/PktAnalysis_ISO14443A.obj new file mode 100644 index 0000000..226ea5f Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/PktAnalysis_ISO14443A.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/pcd_thread.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/pcd_thread.obj new file mode 100644 index 0000000..a334fdb Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/pcd_thread.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.Build.CppClean.log b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.exe.recipe b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.exe.recipe new file mode 100644 index 0000000..2c68ca8 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\Debug\picc.exe + + + + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.ilk b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.ilk new file mode 100644 index 0000000..0634824 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.ilk differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.log b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.log new file mode 100644 index 0000000..4711646 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.log @@ -0,0 +1,176 @@ + stdafx.cpp + pcd_thread.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/pcd_thread.cpp”) + + picc_thread.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/picc_thread.cpp”) + + PktAnalysis_ISO14443A.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/PktAnalysis_ISO14443A.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(46,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(59,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(72,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(84,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(89,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(93,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(94,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(95,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(96,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(97,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(98,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(103,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(104,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(108,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(116,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(119,7): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(120,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(126,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(129,7): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(130,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(132,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(136,7): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(137,7): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(145,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(146,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(165,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(170,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(171,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(179,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(180,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(184,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(185,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(187,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(188,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(191,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(192,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(195,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(196,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(203,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(204,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(208,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(212,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(214,4): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(218,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(25,7): warning C4101: “str”: 未引用的局部变量 +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(302,28): warning C4474: sprintf: 格式字符串中传递的参数太多 + D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(302,28): + 占位符和其参数预计 0 可变参数,但提供的却是 1 参数 + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(250,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(251,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(252,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(255,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(256,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(257,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(262,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(266,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(270,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(277,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(278,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(284,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(287,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(288,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(293,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(294,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(300,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(301,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(302,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(308,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(309,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(310,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(313,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(314,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(315,4): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(318,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(319,4): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(331,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(332,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(336,6): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(337,6): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(343,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(347,5): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(348,5): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + rfid_chk.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_chk.cpp”) + + rfid_com.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_com.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(122,33): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(209,34): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(405,6): warning C4101: “sin_len”: 未引用的局部变量 +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(406,12): warning C4101: “i”: 未引用的局部变量 + rfid_iso14443A_cmdrx.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_cmdrx.cpp”) + + rfid_iso14443A_cmdtx.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_cmdtx.cpp”) + + rfid_iso14443A_codec.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_codec.cpp”) + + rfid_iso14443A_frm.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_frm.cpp”) + + rfid_iso14443A_pcd.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_pcd.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(35,14): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(43,15): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(46,10): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(84,16): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(750,6): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(755,8): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp(756,8): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + rfid_iso14443A_picc.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“../../rfidsrc/rfid_iso14443A_picc.cpp”) + + 正在生成代码... +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp(245): warning C4715: “RFID_COM_Init”: 不是所有的控件路径都返回值 +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp(226): warning C4715: “CPktAnalysis_ISO14443A::getDesp”: 不是所有的控件路径都返回值 + picc.cpp + piccDlg.cpp +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_def.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(135,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(138,2): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(123,7): warning C4101: “c”: 未引用的局部变量 + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(225,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(226,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(227,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(228,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(237,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/piccDlg.cpp”) + +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp(253,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + (编译源文件“/piccDlg.cpp”) + + 正在生成代码... + picc.vcxproj -> D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\Debug\picc.exe diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.obj new file mode 100644 index 0000000..d572298 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.pch b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.pch new file mode 100644 index 0000000..4454845 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.pch differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.res b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.res new file mode 100644 index 0000000..30e52d6 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.res differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.command.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.command.1.tlog new file mode 100644 index 0000000..acd3e41 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.command.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.read.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.read.1.tlog new file mode 100644 index 0000000..ca6b217 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.read.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.write.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.write.1.tlog new file mode 100644 index 0000000..d3ba408 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/CL.write.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/Cl.items.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/Cl.items.tlog new file mode 100644 index 0000000..49d8b52 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/Cl.items.tlog @@ -0,0 +1,14 @@ +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\pcd_thread.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\pcd_thread.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\picc_thread.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\picc_thread.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\PktAnalysis_ISO14443A.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\PktAnalysis_ISO14443A.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_chk.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\rfid_chk.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_com.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\rfid_com.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_cmdrx.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\rfid_iso14443A_cmdrx.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_cmdtx.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\rfid_iso14443A_cmdtx.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_codec.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\rfid_iso14443A_codec.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_frm.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\rfid_iso14443A_frm.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_pcd.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\rfid_iso14443A_pcd.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\rfidsrc\rfid_iso14443A_picc.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\rfid_iso14443A_picc.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\picc.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\picc.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\piccDlg.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\piccDlg.obj +D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\stdafx.cpp;D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\picc\Debug\stdafx.obj diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.command.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.command.1.tlog new file mode 100644 index 0000000..2915893 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.command.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.read.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.read.1.tlog new file mode 100644 index 0000000..26855f8 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.read.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.write.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.write.1.tlog new file mode 100644 index 0000000..e2a9157 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/link.write.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/picc.lastbuildstate b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/picc.lastbuildstate new file mode 100644 index 0000000..3677164 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/picc.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.38.33130:TargetPlatformVersion=10.0.22000.0: +Debug|Win32|D:\Courseware\Principle_and_Application_of_RFID\Labs\Lab2\requirements\src\picc\| diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.command.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.command.1.tlog new file mode 100644 index 0000000..9badcd5 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.command.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.read.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.read.1.tlog new file mode 100644 index 0000000..c11b2f0 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.read.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.write.1.tlog b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.write.1.tlog new file mode 100644 index 0000000..e21d7b4 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.tlog/rc.write.1.tlog differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc.vcxproj.FileListAbsolute.txt b/Labs/Lab2/requirements/src/picc/picc/Debug/picc.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/piccDlg.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/piccDlg.obj new file mode 100644 index 0000000..51965bc Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/piccDlg.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/picc_thread.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/picc_thread.obj new file mode 100644 index 0000000..7bb14fb Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/picc_thread.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_chk.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_chk.obj new file mode 100644 index 0000000..36121a6 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_chk.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_com.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_com.obj new file mode 100644 index 0000000..6c18180 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_com.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_cmdrx.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_cmdrx.obj new file mode 100644 index 0000000..ee388c7 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_cmdrx.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_cmdtx.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_cmdtx.obj new file mode 100644 index 0000000..36c3b36 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_cmdtx.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_codec.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_codec.obj new file mode 100644 index 0000000..65aff9e Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_codec.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_frm.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_frm.obj new file mode 100644 index 0000000..35a7d1a Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_frm.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_pcd.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_pcd.obj new file mode 100644 index 0000000..be884ca Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_pcd.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_picc.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_picc.obj new file mode 100644 index 0000000..a59a41a Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/rfid_iso14443A_picc.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/stdafx.obj b/Labs/Lab2/requirements/src/picc/picc/Debug/stdafx.obj new file mode 100644 index 0000000..6f14344 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/stdafx.obj differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/vc143.idb b/Labs/Lab2/requirements/src/picc/picc/Debug/vc143.idb new file mode 100644 index 0000000..58725b6 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/vc143.idb differ diff --git a/Labs/Lab2/requirements/src/picc/picc/Debug/vc143.pdb b/Labs/Lab2/requirements/src/picc/picc/Debug/vc143.pdb new file mode 100644 index 0000000..ad20594 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/Debug/vc143.pdb differ diff --git a/Labs/Lab2/requirements/src/picc/picc/ReadMe.txt b/Labs/Lab2/requirements/src/picc/picc/ReadMe.txt new file mode 100644 index 0000000..23bd0da --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/ReadMe.txt @@ -0,0 +1,77 @@ +================================================================================ +MICROSOFT : picc Ŀ +=============================================================================== + +ӦóΪ picc Ӧó򡣴Ӧó򲻽ʾ Microsoft Ļʹ÷ΪдӦó㡣 + +ļҪ picc Ӧóÿļݡ + +picc.vcxproj +ʹӦóɵ VC++ ĿĿļ +ɸļ Visual C++ İ汾ϢԼйʹӦóѡƽ̨úĿܵϢ + +picc.vcxproj.filters + ʹáӦó򵼡ɵ VC++ Ŀɸѡļ + йĿļɸѡ֮ĹϢ IDE УֹͨضڵԷʽʾչļ磬.cppļ롰Դļɸѡ + +picc.h +ӦóҪͷļĿضͷļ( Resource.h) CpiccApp Ӧóࡣ + +picc.cpp +ǰӦó CpiccApp ҪӦóԴļ + +picc.rc +dzʹõ Microsoft Windows Դб RES Ŀ¼д洢ͼꡢλͼ͹ꡣļֱ Microsoft Visual C++ нб༭ĿԴλ 2052 С + +res\picc.ico +ӦóͼͼļͼҪԴļ picc.rc С + +res\picc.rc2 +ļ Microsoft Visual C++ нб༭ԴӦýԴ༭༭ԴڴļС + + +///////////////////////////////////////////////////////////////////////////// + +Ӧó򵼴һԻ: + +piccDlg.hpiccDlg.cpp - Ի +Щļ CpiccDlg ࡣඨӦóԻΪöԻģλ picc.rc Уļ Microsoft Visual C++ нб༭ + + +///////////////////////////////////////////////////////////////////////////// + +: + +ActiveX ؼ +Ӧóʹ ActiveX ؼ֧֡ + +ӡӡԤ֧ +Ӧóͨ MFC CView еijԱڴӡӡúʹӡԤĴ롣 + +///////////////////////////////////////////////////////////////////////////// + +׼ļ: + +StdAfx.hStdAfx.cpp +ЩļΪ picc.pch Ԥͷ (PCH) ļΪ StdAfx.obj Ԥļ + +Resource.h +DZ׼ͷļµԴ ID +Microsoft Visual C++ ȡ´ļ + +picc.manifest + Ӧó嵥ļ Windows XP Ӧó + ض汾г򼯵ԡسʹô + Ϣӳ򼯻ʵij򼯻 + Ӧó˽ϢӦó嵥Ϊ·ַΪ + Ӧóִļװͬļеⲿ .manifest ļ + ҲԴʽڸÿִļС +///////////////////////////////////////////////////////////////////////////// + +ע: + +ӦóʹáTODO:ָʾӦӻԶԴ벿֡ + +Ӧóڹ DLL ʹ MFCҪ·Щ MFC DLLӦóõϵͳĵǰòͬҪ·ӦıػԴ MFC100XXX.DLLйĸϢμ MSDN ĵй Redistributing Visual C++ applications (· Visual C++ Ӧó)½ڡ + +///////////////////////////////////////////////////////////////////////////// diff --git a/Labs/Lab2/requirements/src/picc/picc/picc.aps b/Labs/Lab2/requirements/src/picc/picc/picc.aps new file mode 100644 index 0000000..3fe0db3 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/picc.aps differ diff --git a/Labs/Lab2/requirements/src/picc/picc/picc.cpp b/Labs/Lab2/requirements/src/picc/picc/picc.cpp new file mode 100644 index 0000000..5702cdb --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/picc.cpp @@ -0,0 +1,94 @@ + +// picc.cpp : ӦóΪ +// + +#include "stdafx.h" +#include "picc.h" +#include "piccDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CpiccApp + +BEGIN_MESSAGE_MAP(CpiccApp, CWinApp) + ON_COMMAND(ID_HELP, &CWinApp::OnHelp) +END_MESSAGE_MAP() + + +// CpiccApp + +CpiccApp::CpiccApp() +{ + // ֧ + m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; + + // TODO: ڴ˴ӹ룬 + // Ҫijʼ InitInstance +} + + +// Ψһһ CpiccApp + +CpiccApp theApp; + + +// CpiccApp ʼ + +BOOL CpiccApp::InitInstance() +{ + // һ Windows XP ϵӦó嵥ָҪ + // ʹ ComCtl32.dll 汾 6 ߰汾ÿӻʽ + //Ҫ InitCommonControlsEx()򣬽޷ڡ + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // ΪҪӦóʹõ + // ؼࡣ + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + + CWinApp::InitInstance(); + + + AfxEnableControlContainer(); + + // shell ԷԻ + // κ shell ͼؼ shell бͼؼ + CShellManager *pShellManager = new CShellManager; + + // ׼ʼ + // δʹЩܲϣС + // տִļĴСӦƳ + // Ҫضʼ + // ڴ洢õע + // TODO: Ӧʵ޸ĸַ + // ޸Ϊ˾֯ + SetRegistryKey(_T("ӦóɵıӦó")); + + CpiccDlg dlg; + m_pMainWnd = &dlg; + INT_PTR nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: ڴ˷ôʱ + // ȷرնԻĴ + } + else if (nResponse == IDCANCEL) + { + // TODO: ڴ˷ôʱ + // ȡرնԻĴ + } + + // ɾ洴 shell + if (pShellManager != NULL) + { + delete pShellManager; + } + + // ڶԻѹرգԽ FALSE Ա˳Ӧó + // ӦóϢá + return FALSE; +} + diff --git a/Labs/Lab2/requirements/src/picc/picc/picc.h b/Labs/Lab2/requirements/src/picc/picc/picc.h new file mode 100644 index 0000000..b26adb8 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/picc.h @@ -0,0 +1,32 @@ + +// picc.h : PROJECT_NAME Ӧóͷļ +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "ڰļ֮ǰstdafx.h PCH ļ" +#endif + +#include "resource.h" // + + +// CpiccApp: +// йشʵ֣ picc.cpp +// + +class CpiccApp : public CWinApp +{ +public: + CpiccApp(); + +// д +public: + virtual BOOL InitInstance(); + +// ʵ + + DECLARE_MESSAGE_MAP() +}; + +extern CpiccApp theApp; \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/picc/picc/picc.rc b/Labs/Lab2/requirements/src/picc/picc/picc.rc new file mode 100644 index 0000000..613df81 Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/picc.rc differ diff --git a/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj b/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj new file mode 100644 index 0000000..3e1ff64 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj @@ -0,0 +1,174 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {2BB9FD04-E6FA-42DA-9B19-CE9D8CD8D58B} + picc + MFCProj + + + + Application + true + MultiByte + Dynamic + v143 + + + Application + false + true + MultiByte + Dynamic + v143 + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + + + Windows + true + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0804 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0804 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + NotUsing + + + + + Create + Create + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj.filters b/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj.filters new file mode 100644 index 0000000..e640071 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj.filters @@ -0,0 +1,128 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + 资源文件 + + + 资源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj.user b/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/picc.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/picc/picc/piccDlg.cpp b/Labs/Lab2/requirements/src/picc/picc/piccDlg.cpp new file mode 100644 index 0000000..7a300d9 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/piccDlg.cpp @@ -0,0 +1,265 @@ + +// piccDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "picc.h" +#include "piccDlg.h" +#include "afxdialogex.h" +#include "../../rfidsrc/picc_thread.h" +#include "../../rfidsrc/PktAnalysis_ISO14443A.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CpiccDlg Ի + +#define WM_USER_PICC_RX_CMD (WM_USER + 1000) + + +CpiccDlg::CpiccDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CpiccDlg::IDD, pParent) +{ + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + m_sPICCID = _T("12345678"); + m_nRx_udp_port = 10001; + m_nTx_udp_port = 10000; + m_nPICCStatus = 0; +} + +void CpiccDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_PICCID, m_sPICCID); + DDV_MaxChars(pDX, m_sPICCID, 20); + DDX_Text(pDX, IDC_EDIT_RX_UDP_PORT, m_nRx_udp_port); + DDV_MinMaxInt(pDX, m_nRx_udp_port, 1, 65535); + DDX_Text(pDX, IDC_EDIT_TX_UDP_PORT, m_nTx_udp_port); + DDV_MinMaxInt(pDX, m_nTx_udp_port, 1, 65535); + DDX_Control(pDX, IDC_LIST_INFO, m_clist_Info); + DDX_Radio(pDX, IDC_RADIO_PICC_STATUS, m_nPICCStatus); + DDV_MinMaxInt(pDX, m_nPICCStatus, 0, 4); + DDX_Control(pDX, IDC_IPADDRESS_PCD, m_cPCDip); +} + +BEGIN_MESSAGE_MAP(CpiccDlg, CDialogEx) + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_BN_CLICKED(IDC_BUTTON_POWERUP, &CpiccDlg::OnClickedButtonPowerup) + ON_BN_CLICKED(IDC_BUTTON_STOP, &CpiccDlg::OnClickedButtonStop) + ON_MESSAGE(WM_USER_PICC_RX_CMD, &CpiccDlg::OnPiccRxCmd) +END_MESSAGE_MAP() + + +// CpiccDlg Ϣ + +BOOL CpiccDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // ô˶ԻͼꡣӦóڲǶԻʱܽԶ + // ִд˲ + SetIcon(m_hIcon, TRUE); // ôͼ + SetIcon(m_hIcon, FALSE); // Сͼ + + // TODO: ڴӶijʼ + + // ipַĬϱ + m_cPCDip.SetAddress( 127,0,0,1); + + m_nRowNo = 0; + init_ListCtrl(); + + GetDlgItem( IDC_BUTTON_POWERUP )->EnableWindow( ); + GetDlgItem( IDC_BUTTON_STOP )->EnableWindow( 0 ); + + return TRUE; // ǽõؼ򷵻 TRUE +} + +// ԻСťҪĴ +// Ƹͼꡣʹĵ/ͼģ͵ MFC Ӧó +// ⽫ɿԶɡ + +void CpiccDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // ڻƵ豸 + + SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); + + // ʹͼڹо + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // ͼ + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialogEx::OnPaint(); + } +} + +//û϶Сʱϵͳô˺ȡù +//ʾ +HCURSOR CpiccDlg::OnQueryDragIcon() +{ + return static_cast(m_hIcon); +} + +// ʼ߳ +void CpiccDlg::OnClickedButtonPowerup() +{ + // TODO: ڴӿؼ֪ͨ + m_nRowNo = 0; + DWORD ThreadId; + char c; + + UpdateData( ); + + PICC_Thread_In_prm inPrm; + + inPrm.hWnd = this->m_hWnd; + inPrm.uMsgId = WM_USER_PICC_RX_CMD; + inPrm.u16_pcd_rx_port = m_nTx_udp_port; + inPrm.u16_picc_rx_port = m_nRx_udp_port; + BYTE b0, b1, b2, b3; + m_cPCDip.GetAddress( b0, b1, b2, b3 ); + sprintf( inPrm.sz_pcd_ip, "%d.%d.%d.%d", b0, b1, b2, b3); + + inPrm.uc_picc_ID_Len = m_sPICCID.GetLength()/2; + strcpy(inPrm.sz_picc_ID, m_sPICCID.GetBuffer()); + + m_hThreadPicc=CreateThread(NULL, + 0, + (LPTHREAD_START_ROUTINE)picc_thread, + (void *)&inPrm, + 0, + &ThreadId); + + m_nPICCStatus = 1; // ʼУidle. + UpdateData( false ); + GetDlgItem( IDC_BUTTON_POWERUP )->EnableWindow( 0 ); + GetDlgItem( IDC_BUTTON_STOP )->EnableWindow( ); +} + + +// ֹͣ߳; +void CpiccDlg::OnClickedButtonStop() +{ + // TODO: ڴӿؼ֪ͨ + + // ֹͣ߳. + GetDlgItem( IDC_BUTTON_POWERUP )->EnableWindow( ); + GetDlgItem( IDC_BUTTON_STOP )->EnableWindow( 0 ); +} + +// wParam, PICC_Thread_Out_prm* +// lParam + + +LRESULT CpiccDlg::OnPiccRxCmd(WPARAM wParam, LPARAM lParam) +{ + if( !wParam ) + { + m_nPICCStatus = lParam; + UpdateData(false); + return NULL; + } + + PICC_Thread_Out_prm* pOutPrm = (PICC_Thread_Out_prm*)wParam; + + addItem( pOutPrm->buf, pOutPrm->nBufBitLen, pOutPrm->npicc_status, pOutPrm->action ); + + return NULL; +} + +int CpiccDlg::init_ListCtrl(void) +{ + LONG style = GetWindowLong( m_clist_Info.m_hWnd, GWL_STYLE ); + style &= ~LVS_TYPEMASK; + style |= LVS_REPORT; + SetWindowLong( m_clist_Info.m_hWnd, GWL_STYLE, style ); + + DWORD dwStyle = m_clist_Info.GetExtendedStyle(); + dwStyle |= LVS_EX_FULLROWSELECT; + dwStyle |= LVS_EX_GRIDLINES; + m_clist_Info.SetExtendedStyle( dwStyle ); + + m_clist_Info.InsertColumn(0, "" ); + m_clist_Info.SetColumnWidth( 0, 40 ); + m_clist_Info.InsertColumn(1, "" ); // tx or rx + m_clist_Info.SetColumnWidth( 1, 40 ); + m_clist_Info.InsertColumn(2, "(16)" ); // ͻ߽յݰ; + m_clist_Info.SetColumnWidth( 2, 150 ); + m_clist_Info.InsertColumn(3, "" ); // /Ӧ + m_clist_Info.SetColumnWidth( 3, 100 ); + m_clist_Info.InsertColumn(4, "" ); // Ľ + m_clist_Info.SetColumnWidth( 4, 430 ); + m_clist_Info.InsertColumn(5, "" ); // ִеһ + m_clist_Info.SetColumnWidth( 5, 230 ); + + return 0; +} + +// úݣ뵽listctrl +int CpiccDlg::addItem(byte* buf, int nbitLen, int picc_cmd, char *action ) +{ + CPktAnalysis_ISO14443A picc(0); + char *items[5]; + for( int i = 0; i < 5; i++ ) + { + items[i] = new char[1024]; + } + + if( !buf ) + { + // ; + sprintf( items[0], "rx" ); + sprintf( items[1], "26" ); + sprintf( items[2], "REQA" ); + sprintf( items[3], "" ); + + addItem( items ); + } + + picc.analysis( buf, nbitLen, items[0], items[1], items[2], items[3], picc_cmd ); + items[4][0] = 0x00; + if( action ) + { + strcpy( items[4], action ); + } + + addItem( items ); + + for( int i = 0; i < 5; i++ ) + { + delete[] items[i]; + } + return 1; +} + +int CpiccDlg::addItem( char* items[] ) +{ + char no[10]; + + sprintf(no, "%d", m_nRowNo ); + m_clist_Info.InsertItem( m_nRowNo, no ); + m_clist_Info.SetItemText( m_nRowNo, 1, items[0] ); + m_clist_Info.SetItemText( m_nRowNo, 2, items[1] ); + m_clist_Info.SetItemText( m_nRowNo, 3, items[2] ); + m_clist_Info.SetItemText( m_nRowNo, 4, items[3] ); + m_clist_Info.SetItemText( m_nRowNo, 5, items[4] ); + m_nRowNo++; + + return 1; +} + + diff --git a/Labs/Lab2/requirements/src/picc/picc/piccDlg.h b/Labs/Lab2/requirements/src/picc/picc/piccDlg.h new file mode 100644 index 0000000..c15b2f4 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/piccDlg.h @@ -0,0 +1,53 @@ + +// piccDlg.h : ͷļ +// + +#pragma once + + +// CpiccDlg Ի +class CpiccDlg : public CDialogEx +{ +// +public: + CpiccDlg(CWnd* pParent = NULL); // ׼캯 + +// Ի + enum { IDD = IDD_PICC_DIALOG }; + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + +// ʵ +protected: + HICON m_hIcon; + + // ɵϢӳ亯 + virtual BOOL OnInitDialog(); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnClickedButtonPowerup(); + afx_msg void OnClickedButtonStop(); + afx_msg LRESULT OnPiccRxCmd(WPARAM wParam, LPARAM lParam); + + CString m_sPICCID; + int m_nRx_udp_port; + int m_nTx_udp_port; + CListCtrl m_clist_Info; +protected: + int init_ListCtrl(void); + int addItem( char *items[] ); + +public: + int addItem(byte* buf, int nbitLen, int picc_cmd, char *action ); + +protected: + int m_nRowNo; // ǰ + HANDLE m_hThreadPicc; // picc_thread handle. +public: + int m_nPICCStatus; + CIPAddressCtrl m_cPCDip; +}; diff --git a/Labs/Lab2/requirements/src/picc/picc/res/picc.ico b/Labs/Lab2/requirements/src/picc/picc/res/picc.ico new file mode 100644 index 0000000..d56fbcd Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/res/picc.ico differ diff --git a/Labs/Lab2/requirements/src/picc/picc/res/picc.rc2 b/Labs/Lab2/requirements/src/picc/picc/res/picc.rc2 new file mode 100644 index 0000000..0bef10a Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/res/picc.rc2 differ diff --git a/Labs/Lab2/requirements/src/picc/picc/resource.h b/Labs/Lab2/requirements/src/picc/picc/resource.h new file mode 100644 index 0000000..29ebeba Binary files /dev/null and b/Labs/Lab2/requirements/src/picc/picc/resource.h differ diff --git a/Labs/Lab2/requirements/src/picc/picc/stdafx.cpp b/Labs/Lab2/requirements/src/picc/picc/stdafx.cpp new file mode 100644 index 0000000..e25ea75 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/stdafx.cpp @@ -0,0 +1,8 @@ + +// stdafx.cpp : ֻ׼ļԴļ +// picc.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + + diff --git a/Labs/Lab2/requirements/src/picc/picc/stdafx.h b/Labs/Lab2/requirements/src/picc/picc/stdafx.h new file mode 100644 index 0000000..fac7631 --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/stdafx.h @@ -0,0 +1,58 @@ + +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ + +#pragma once + +#ifndef _SECURE_ATL +#define _SECURE_ATL 1 +#endif + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Windows ͷųʹõ +#endif + +#include "targetver.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString 캯ʽ + +// ر MFC ijЩɷĺԵľϢ +#define _AFX_ALL_WARNINGS + +#include // MFC ͱ׼ +#include // MFC չ + + +#include // MFC Զ + + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC Internet Explorer 4 ؼ֧ +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC Windows ؼ֧ +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include // Ϳؼ MFC ֧ + + + + + + + + + +#ifdef _UNICODE +#if defined _M_IX86 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") +#elif defined _M_X64 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#else +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#endif +#endif + + diff --git a/Labs/Lab2/requirements/src/picc/picc/targetver.h b/Labs/Lab2/requirements/src/picc/picc/targetver.h new file mode 100644 index 0000000..0afac5b --- /dev/null +++ b/Labs/Lab2/requirements/src/picc/picc/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h ߰汾Ŀ Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/Labs/Lab2/requirements/src/rfidsrc/PktAnalysis_ISO14443A.cpp b/Labs/Lab2/requirements/src/rfidsrc/PktAnalysis_ISO14443A.cpp new file mode 100644 index 0000000..e967240 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/PktAnalysis_ISO14443A.cpp @@ -0,0 +1,357 @@ +#include "PktAnalysis_ISO14443A.h" + +CPktAnalysis_ISO14443A::CPktAnalysis_ISO14443A(int pcd ) +{ + m_nPcd = pcd; +} + + +CPktAnalysis_ISO14443A::~CPktAnalysis_ISO14443A(void) +{ +} + +bool CPktAnalysis_ISO14443A::analysis( byte* buf, int bitLen, char *dir, char* hexdat, char *cmd, char *desp, int cmdid ) +{ + if( getOthers( buf, bitLen, dir, hexdat, cmd, cmdid )) + { + return getDesp( buf, bitLen, desp, cmdid); + } + return false; +} + +// . +bool CPktAnalysis_ISO14443A::getDesp( byte *buf, int bitLen, char *desp, int cmdid ) +{ + char str[10]; + int m, n, k; + + if( cmdid == 0 ) + { + } + else + { + switch( cmdid ) + { + case ISO_14443_CMD_REQA: +#if 0 + if( buf[0] != cmdid ) + { + return false; + } + else + { + sprintf( desp, "0x%02x, REQA", cmdid ); + } +#endif + sprintf( desp, "%02x, REQA", cmdid ); + break; + case ISO_14443_CMD_WUPA: +#if 0 + if( buf[0] != cmdid ) + { + return false; + } + else + { + sprintf( desp, "0x%02x, WUPA", cmdid ); + } +#endif + sprintf( desp, "%02x, WUPA", cmdid ); + break; + case ISO_14443_CMD_HALT: +#if 0 + if( buf[0] != cmdid ) + { + return false; + } + else + { + sprintf( desp, "5000, HALT" ); + } +#endif + sprintf( desp, "5000, HALT" ); + break; + + case ISO_14443_CMD_SEL_CL1: + case ISO_14443_CMD_SEL_CL2: + case ISO_14443_CMD_SEL_CL3: + char str[100]; + + // buf[0] + if( buf[1] == 0x70 ) + { + // SELECT. + sprintf( desp, "%02x:SELECT, ", cmdid ); + } + else + { + // 93/95/97. + sprintf( desp, "%02x:ANTI_CL%d, ", cmdid, (cmdid-0x93)/2+1 ); + } + + // buf[1] + sprintf( str, "%02x:NVB,", buf[1] ); + strcat( desp, str ); + sprintf( str, "Byte num = %d, ", (buf[1] >> 4)&0x07 ); + strcat( desp, str ); + sprintf( str, "bit num = %d, ", buf[1] & 0x07 ); + strcat( desp, str ); + + // buf[2-...] + if( buf[1] == 0x70 ) + { + sprintf( str, "UID=%02x%02x%02x%02x",buf[2], buf[3], buf[4], buf[5] ); + strcat( desp, str ); + } + else if( buf[1] == 0x20 ) + { + sprintf( desp, "UID=void" ); + } + else + { + int k = (( buf[1] >> 4 )&0x07) - 2; + int m = buf[1] & 0x07; // m + if( m == 0 ) + { + strcat( desp, "UID="); + for( int i = 0; i < k; i++ ) + { + sprintf( str, "%02x", buf[2+i]); + strcat( desp, str ); + } + } + else + { + k--; + strcat( desp, "UID="); + for( int i = 0; i < k; i++ ) + { + sprintf( str, "%02x", buf[2+i]); + strcat( desp, str ); + } + strcat(desp,"_"); + // һֽڣӡͱ + for( int i = m-1; i >= 0; i-- ) + { + sprintf( str, "%d", (buf[2+k]>>i)&1); + strcat( desp, str ); + } + } + } + + // BCC, BCCǾһڵ6ֽ + if( buf[1] == 0x70 ) + { + sprintf(str, ", BCC=%02x", buf[6] ); + strcat( desp, str ); + } + + // 0x70CRC +#if 0 + // CRCڽ֡ʱѾȥˡ + if( buf[1] == 0x70 ) + { + sprintf( str, ", CRC=%02x%02x", buf[7], buf[8]); + strcat( desp, str ); + } +#endif + break; + case ISO_14443_CMD_SEL_CLx: + // յײ; + // ݣUID + BCCbitLen % 8 != 0һֽڱbit. + m = bitLen % 8; + n = bitLen / 8; + + strcpy( desp, "UID=" ); + if( m == 0 ) + { + for( int i = 0; i < n-1; i++ ) + { + sprintf( str, "%02x", buf[i] ); + strcat( desp, str ); + } + } + else + { + n++; + for( int i = m-1; i >=0 ; i-- ) + { + sprintf( str, "%d", ( buf[0]>> i)&1); + strcat( desp, str ); + } + for( int i = 0; i < 8-m; i++ ) + { + sprintf( str, "."); + strcat( desp, str ); + } + sprintf( str, "_" ); + strcat( desp, str ); + for( int i = 0; i < n-2; i++ ) + { + sprintf( str, "%02x", buf[i+1] ); + strcat( desp, str ); + } + } + sprintf( str, ", BCC=%02x", buf[n-1] ); + strcat( desp, str ); + + break; + case ISO_14443_CMD_SAK: + desp[0]=0x00; + for( int i=0; i < 8; i++ ) + { + sprintf( str, "%d", (buf[0]>>(7-i))&1 ); + strcat(desp, str ); + } + if( buf[0] & 0x04 ) + { + sprintf( str, ", b3=1, incompleted UID. continue anti" ); + } + else + { + sprintf( str, ", b3=0, UID OK" ); + } + strcat( desp, str ); + break; + case ISO_14443_CMD_ATQA: + k = ( buf[1] >> 6 ) & 0x03; + sprintf( desp, "bit8:7=%d%d, CL%d", (buf[1]>>7)&1, (buf[1]>>6)&1, k+1); + break; + default: + return false; + + } + return true; + } +} + + +// ⣺ANTI frame, PCD tx: ں󣬱δαʾ; +// PCD rx: ǰ +// +bool CPktAnalysis_ISO14443A::getOthers( byte *buf, int bitLen, char *dir, char* hexdat, char *cmd, int cmdid ) +{ + int k, i; + char t[10]; + + if( cmdid == 0 ) + { + // ȫ֪cmd. + // ɶʹã + return true; + } + else + { + switch( cmdid ) + { + /////////////////////////////////////// + // PCDͷ + case ISO_14443_CMD_REQA: + strcpy( dir, ( m_nPcd ? "tx":"rx") ); + strcpy( cmd, "REQA" ); + sprintf( hexdat, "%02X",cmdid ); + break; + case ISO_14443_CMD_WUPA: + strcpy( dir, ( m_nPcd ? "tx":"rx") ); + strcpy( cmd, "WUPA" ); + sprintf( hexdat, "%02X",cmdid ); + break; + case ISO_14443_CMD_SEL_CL1: + case ISO_14443_CMD_SEL_CL2: + case ISO_14443_CMD_SEL_CL3: + strcpy( dir, ( m_nPcd ? "tx":"rx") ); + // пSELECT, NVBж + if( buf[1] != 0x70 ) + { + sprintf( cmd, "ANTI_CL=%02X", cmdid ); + } + else + { + sprintf( cmd, "SELECT_CL=%02X", cmdid ); + } + // ӡݣbitLen; + k = bitLen/8; + hexdat[0] = 0x00; + for( i = 0; i < k; i++ ) + { + sprintf(t, "%02x", buf[i]); + strcat( hexdat, t ); + } + + // ٴӡ󼸸; + if( bitLen % 8 ) + { + strcat( hexdat, "_" ); + for( i = 0; i < 8-bitLen%8; i++ ) + { + sprintf( t, "." ); + strcat( hexdat, t ); + } + + for( i=bitLen%8-1; i >= 0; i-- ) + { + sprintf( t, "%d", (buf[k]>>i)&1); + strcat( hexdat, t ); + } + } + + break; + case ISO_14443_CMD_HALT: + strcpy( dir, ( m_nPcd ? "tx":"rx") ); + strcpy( cmd, "HALT" ); + sprintf( hexdat, "5000",cmdid ); + break; + + //////////////////////////////////////// + // PCDշ. + case ISO_14443_CMD_SAK: + strcpy( dir, ( m_nPcd ? "rx":"tx") ); + strcpy( cmd, "SAK" ); + sprintf( hexdat, "%02X", buf[0] ); + break; + case ISO_14443_CMD_ATQA: + strcpy( dir, ( m_nPcd ? "rx":"tx") ); + strcpy( cmd, "ATQA" ); + sprintf( hexdat, "%02X,%02X", buf[0], buf[1] ); + break; + case ISO_14443_CMD_SEL_CLx: + strcpy( dir, ( m_nPcd ? "rx":"tx") ); + strcpy( cmd, "ANTI" ); + + hexdat[0] = 0x00; + k = bitLen / 8; + i = 0; + if( bitLen % 8 != 0 ) + { + k++; + // һֽ; + int m = bitLen % 8; + for( i = m-1; i >=0; i-- ) + { + sprintf( t,"%d", (buf[0] >> i)&1 ); + strcat( hexdat, t ); + } + for( i = 0; i < 8-m; i++ ) + { + sprintf( t,"." ); + strcat( hexdat, t ); + } + i = 1; + } + if( i != 0 ) + { + strcat( hexdat, "_" ); + } + for( ; i < k; i++ ) + { + sprintf( t, "%02x", buf[i] ); + strcat( hexdat, t ); + } + + break; + default: + return false; + } + } + return true; +} diff --git a/Labs/Lab2/requirements/src/rfidsrc/PktAnalysis_ISO14443A.h b/Labs/Lab2/requirements/src/rfidsrc/PktAnalysis_ISO14443A.h new file mode 100644 index 0000000..c326933 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/PktAnalysis_ISO14443A.h @@ -0,0 +1,60 @@ +#pragma once +#include "rfid_def.h" + +/////////////// +// ISO14443 frameз +// frame: short Frame: 7bits, ߱0 +// std frame: nx8bits; +// ANTICOLLISION frame, bitȲȷ +// frame S/E bit, old parity bit, CRC(std frame) +// У short frameû old parity bit, CRC(std frame) +// framebitlenֽڶ룬 +// short frame: bit7Ч; +// ANTICOLLISION frame: +// +//-------------------------------------------------------------------- +// : byte *buf short frame: bit7Ч +// anti frame: ʣbitһֽڵĵbitλã +// +// int bitlen Ϊ +// : dir: rx/tx +// cmd. +// hexdat: hexʾframeݣ +// cmd: REQA/WUPA/ATQA/SAK/HALT/SELECT/ANTICOLLISION +// REQA/WUPA/HALT/SELECT, PCD: tx, PICC: rx +// ATQA/SAK PCDrx, PICC: tx +// ANTICOLLISION: PCD/PICCtx/rx +// +// desp: ; +// cmdid: cmdid != 0˵û֪ԼҪcmdʱdir/hexdatٴbufнtx; +// cmdid == 0Ҫbufн, ڽշʹã +// ڽշЭҲûжid: ATQA/SAK; +// +// +class CPktAnalysis_ISO14443A +{ +public: + CPktAnalysis_ISO14443A(int pcd = 1 ); + ~CPktAnalysis_ISO14443A(void); + +public: + bool analysis_tx( byte* buf, int bitLen, char *dir, char* hexdat, char *cmd, char *desp, int cmdid ) + { + return analysis(buf, bitLen, dir, hexdat, cmd, desp, cmdid); + } + bool analysis_rx( byte* buf, int bitLen, char *dir, char* hexdat, char *cmd, char *desp ) + { + return analysis(buf, bitLen, dir, hexdat, cmd, desp, 0); + } + bool analysis( byte* buf, int bitLen, char *dir, char* hexdat, char *cmd, char *desp, int cmdid = 0 ); + +protected: + + // ж + bool getDesp( byte *buf, int bitLen, char *desp, int cmdid ); + bool getOthers( byte *buf, int bitLen, char *dir, char* hexdat, char *cmd, int cmdid ); + +protected: + int m_nPcd; // 1PCD, 0PICC; +}; + diff --git a/Labs/Lab2/requirements/src/rfidsrc/VC中的thread.docx b/Labs/Lab2/requirements/src/rfidsrc/VC中的thread.docx new file mode 100644 index 0000000..06775a7 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/VC中的thread.docx differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/CRC16.cpp b/Labs/Lab2/requirements/src/rfidsrc/class/CRC16.cpp new file mode 100644 index 0000000..021e8ff --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/CRC16.cpp @@ -0,0 +1,55 @@ + +#include "CRC16.h" + +namespace VSPR_OF_ISO14443A +{ + CCRC16::CCRC16(void) + { + } + + + CCRC16::~CCRC16(void) + { + } + + /** + * CRCУ + * + * \input BYTE aBuf[], + * UINT16 u16Len + * UINT16 u16InitPrm CRC16ֵ. + * \ouput BYTE *pCRCMSB CRC8bit + * BYTE *pCRCLSB CRC8bit + * \return 1ɹ<0ʧ. + */ + int CCRC16::GetCRC16( UINT16 u16InitValue, BYTE aBuf[], UINT16 u16Len,BYTE *pCRCMSB, BYTE *pCRCLSB ) + { + UINT16 wCrc; + unsigned char chBlock; + int i; + + wCrc = u16InitValue; + for( i = 0; i < u16Len; i++ ) + { + chBlock = aBuf[i]; + UpdateCrc(chBlock, &wCrc); + } + if( u16InitValue == 0xFFFF ) + { + wCrc = ~wCrc; // ISO 3309 + } + *pCRCLSB = (BYTE) (wCrc & 0xFF); + *pCRCMSB = (BYTE) ((wCrc >> 8) & 0xFF); + + return 1; + } + + UINT16 CCRC16::UpdateCrc(BYTE ch, UINT16 *lpwCrc) + { + ch = (ch^(unsigned char)((*lpwCrc) & 0x00FF)); + ch = (ch^(ch<<4)); + + *lpwCrc = (*lpwCrc >> 8)^((UINT16)ch << 8)^((UINT16)ch<<3)^((UINT16)ch>>4); + return(*lpwCrc); + } +} diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/CRC16.h b/Labs/Lab2/requirements/src/rfidsrc/class/CRC16.h new file mode 100644 index 0000000..ac35763 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/CRC16.h @@ -0,0 +1,60 @@ +#pragma once +#include "..\rfid_def.h" + +namespace VSPR_OF_ISO14443A +{ + class CCRC16 + { + public: + CCRC16(void); + ~CCRC16(void); + + /** + * CRCУ + * + * \input BYTE aBuf[], + * UINT16 u16Len + * UINT16 u16InitPrm CRC16ֵ. + * \ouput BYTE *pCRCMSB CRC8bit + * BYTE *pCRCLSB CRC8bit + * \return 1ɹ<0ʧ. + */ + int GetCRC16( UINT16 u16InitValue, BYTE aBuf[], UINT16 u16Len,BYTE *pCRCMSB, BYTE *pCRCLSB ); + protected: + UINT16 UpdateCrc(BYTE ch, UINT16 *lpwCrc); + }; + + class CCRC16of14443A : public CCRC16 + { + public: + CCRC16of14443A(void) + { + } + ~CCRC16of14443A(void) + { + } + + int GetCRC16( BYTE aBuf[], UINT16 u16Len, BYTE *pCRCMSB, BYTE *pCRCLSB ) + { + return CCRC16::GetCRC16( 0x6363, aBuf, u16Len, pCRCMSB, pCRCLSB ); + } + }; + + class CCRC16of14443B : public CCRC16 + { + public: + CCRC16of14443B(void) + { + } + ~CCRC16of14443B(void) + { + } + + int GetCRC16( BYTE aBuf[], UINT16 u16Len, BYTE *pCRCMSB, BYTE *pCRCLSB ) + { + return CCRC16::GetCRC16( 0xFFFF, aBuf, u16Len, pCRCMSB, pCRCLSB ); + } + + }; +} + diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/OddParity.cpp b/Labs/Lab2/requirements/src/rfidsrc/class/OddParity.cpp new file mode 100644 index 0000000..bc2dfa0 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/OddParity.cpp @@ -0,0 +1,38 @@ +#include "StdAfx.h" +#include "OddParity.h" + +namespace VSPR_OF_ISO14443A +{ + COddParity::COddParity(void) + { + } + + COddParity::COddParity(BYTE btDat ) + { + m_btDat = btDat; + } + + COddParity::~COddParity(void) + { + } + + int COddParity::GetOddParity() + { + int n = 0; + for( int i = 0; i < 8; i++ ) + { + if( (m_btDat >> i) & 0x01 ) + { + n++; + } + } + return (n % 2)?0:1; + } + + int COddParity::GetOddParity( BYTE byDat ) + { + m_btDat = byDat; + + return GetOddParity( ); + } +} diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/OddParity.h b/Labs/Lab2/requirements/src/rfidsrc/class/OddParity.h new file mode 100644 index 0000000..a2f3f7b --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/OddParity.h @@ -0,0 +1,20 @@ +#pragma once +namespace VSPR_OF_ISO14443A +{ + class COddParity + { + public: + COddParity(void); + COddParity(BYTE btDat ); + + ~COddParity(void); + public: + int GetOddParity( ); + int GetOddParity( BYTE btDat ); + + protected: + BYTE m_btDat; + }; +} + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/clUSPTrans.h b/Labs/Lab2/requirements/src/rfidsrc/class/clUSPTrans.h new file mode 100644 index 0000000..3373f1a --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/clUSPTrans.h @@ -0,0 +1,137 @@ +/** + * \file clUSPTrans.h + * + * USP ˵transceiver. + */ + +#include "clVSPRCOM.h" + +#ifndef _CLASS_USP_TRANS_H_ +#define _CLASS_USP_TRANS_H_ + +namespace VSPR_OF_ISO14443A +{ + /** + * USPPCD/PICC֮ͨ + * + * USP + */ + class clUSPTransceiver : public clVSPRUDPTransceiver + { + public: + /** + * NULLʾ. + */ + clUSPTransceiver( char *szRemoteIpAddr = NULL ) + : clVSPRUDPTransceiver( szRemoteIpAddr ) + { + } + ~clUSPTransceiver() + { + } + int Init( char *szRemoteIPAddr = NULL ) + { + VSPR_TRACE(); + clVSPRUDPTransceiver::Init( szRemoteIPAddr ); + m_pTx = (clVSPRUDPSocket_Tx *)(new clUSPToVSPR( m_szRemoteIpAddr )); + if( !m_pTx ) + { + return -1; + } + if( m_pTx->Init() < 0 ) + { + return -1; + } + + m_pRx = (clVSPRUDPSocket_Rx *)(new clUSPFromVSPR( )); + if( !m_pRx ) + { + return -1; + } + if( m_pRx->Init() < 0 ) + { + return -1; + } + return 0; + } + }; + + /** + * USPPCD/PICC֮ͨ + * + * VSPR + */ + class clVSPRTransceiver : public clVSPRUDPTransceiver + { + public: + clVSPRTransceiver( char *szRemoteIpAddr = NULL ) + : clVSPRUDPTransceiver( szRemoteIpAddr ) + { + } + ~clVSPRTransceiver() + { + } + int Init( char *szRemoteIPAddr = NULL ) + { + VSPR_TRACE(); + clVSPRUDPTransceiver::Init( szRemoteIPAddr ); + m_pTx = (clVSPRUDPSocket_Tx *)(new clVSPRToUSP( m_szRemoteIpAddr )); + if( !m_pTx ) + { + return -1; + } + if( m_pTx->Init() < 0 ) + { + return -1; + } + + m_pRx = (clVSPRUDPSocket_Rx *)(new clVSPRFromUSP( )); + if( !m_pRx ) + { + return -1; + } + if( m_pRx->Init() < 0 ) + { + return -1; + } + return 0; + } + }; +#if 0 + /** + * APIӿ + */ + clUSPTransceiver* g_pUSPTrans = NULL; + + int USP_To_VSPR_Init( char *vsprIp = NULL ) + { + if( !g_pUSPTrans ) + { + g_pUSPTrans = new clUSPTransceiver( vsprIp ); + if( !g_pUSPTrans ) + { + return -1; + } + if( g_pUSPTrans->Init() < 0 ) + { + return -1; + } + } + return 1; + } + + int USP_To_VSPR_Tx(UCHAR *pBuf, UINT16 u16BitLen, UCHAR ucCmd ) + { + USP_Init(); + return g_pUSPTrans->Send( pBuf, u16BitLen, ucCmd); + }; + + int USP_FROM_VSPR_Rx(UCHAR *pBuf, UINT16 u16BufLen, UCHAR *pucCmd ) + { + USP_Init(); + return g_pUSPTrans->Recv( pBuf, u16BufLen, pucCmd); + }; +#endif +} + +#endif diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCOM.h b/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCOM.h new file mode 100644 index 0000000..c173c26 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCOM.h @@ -0,0 +1,674 @@ +#include "..\rfid_def.h" + +#ifdef _OS_WINDOWS_ +#include "winsock.h" +#include "Winsock2.h" +#include +#include +#include + +#ifdef _IDE_VS2010_ +#define close _close +#endif + +#else +#include +#include +#include +#include +#include +#include +#endif + +#define DEBUG +#ifdef DEBUG + #define VSPR_TRACE() printf("\n%s %d %s", __FILE__, __LINE__, __FUNCTION__ ); + #define VSPR_TRACE1(x) x; +#else + #define VSPR_TRACE() + #define VSPR_TRACE1(x) +#endif + +#ifndef _CLASS_VSPR_COM_H_ +#define _CLASS_VSPR_COM_H_ + +/** + * namespace: VSPR: visual simulation platform of RFID. + * + */ +namespace VSPR_OF_ISO14443A +{ + + /*-----------------------------------------------------------------*\ + * 定义PCD/PICC/USP的UDP侦听端口号 + *-----------------------------------------------------------------*/ + #define UDP_PORT_PCD 34566 + #define UDP_PORT_PICC 34567 + // 在环境的情况下. + #define UDP_PORT_USP 34568 + #define UDP_PORT_VSPR 34579 + + #define BROADCAST_IP (char *)"224.0.0.1" + #define LOCAL_IP (char *)"127.0.0.1" + + /*-----------------------------------------------------------------*\ + * Rx方向 + * + *-----------------------------------------------------------------*/ + + class clUDPSocket_Rx + { + public: + clUDPSocket_Rx( USHORT usPort = 0 ) + { + VSPR_TRACE(); + m_usPortId = usPort; + m_nSocketId = -1; + memset( (void *)&m_stAddr, 0x00, sizeof( m_stAddr )); + } + + virtual ~clUDPSocket_Rx( ) + { + VSPR_TRACE(); + if( m_nSocketId != -1 ) + { + closesocket( m_nSocketId ); + m_nSocketId = -1; + } + } + + virtual int Init( USHORT usPort = 0 ) + { + VSPR_TRACE(); + { + WSADATA wsa; + if (WSAStartup(MAKEWORD(2,2),&wsa) != 0) + { + return -1; + } + } + if( m_nSocketId == -1 ) + { + m_nSocketId = socket( AF_INET, SOCK_DGRAM, 0 ); + } + // 如果Init()传入了新的port参数,则采用这个参数。 + if( usPort != 0 ) + { + m_usPortId = usPort; + } + // 如果构造和Init()都没有传入新的参数,则返回错误。 + if( m_usPortId == 0 ) + { + return -1; + } + + // bzero( &m_stAddr, sizeof( m_stAddr )); + memset( &m_stAddr, 0x00, sizeof( m_stAddr )); + + m_stAddr.sin_family = AF_INET; + m_stAddr.sin_addr.s_addr = htonl( INADDR_ANY ); + m_stAddr.sin_port = htons( m_usPortId ); + + bind( m_nSocketId, (struct sockaddr *)&m_stAddr, sizeof( m_stAddr )); + + return 0; + } + + // 默认阻塞接收 + // 可以返回发送方的 ip 地址和 port + int Recvfrom( UCHAR *pucBuf, USHORT usBufLen ) + { + VSPR_TRACE(); + + VSPR_TRACE1(printf("\nsocketid=%d, local udp port=%d\n", m_nSocketId, m_usPortId )); + return recv( m_nSocketId, (char *)pucBuf, usBufLen, 0 ); + } + + // 用于支持select操作. + int GetSocketId( ) + { + return m_nSocketId; + } + // 设置为非阻塞方式, 默认为阻塞方式 + // 默认为200ms. + void SetUnBlock( int delayTime = 200000 ) + { + struct timeval timeout = {0,delayTime}; // 200ms. + setsockopt( m_nSocketId, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,sizeof(struct timeval)); + } + + protected: + int m_nSocketId; // socket id. + + USHORT m_usPortId; // UDP端口号 + struct sockaddr_in m_stAddr; + int m_sin_len; + + }; + + /** + * 按VSPR的数据格式要求,解析Header,执行如下功能: + * 1. 判断:方向 + * 2. 必要时,判断命令; + */ + class clVSPRUDPSocket_Rx : public clUDPSocket_Rx + { + public: + clVSPRUDPSocket_Rx( UCHAR ucDirection = DIRECTION_UNDEFINED, USHORT usPort = 0 ) + : clUDPSocket_Rx( usPort ) + { + VSPR_TRACE(); + m_ucDirection = ucDirection; + } + + ~clVSPRUDPSocket_Rx() + { + VSPR_TRACE(); + } + + virtual int Init( UCHAR ucDirection = DIRECTION_UNDEFINED, USHORT usPort = 0 ) + { + VSPR_TRACE(); + + if( ucDirection != DIRECTION_UNDEFINED ) + { + m_ucDirection = ucDirection; + } + + if( m_ucDirection == DIRECTION_UNDEFINED ) + { + return -1; + } + + return clUDPSocket_Rx::Init( usPort ); + } + + /** + * 返回接收比特长度! + * u16BufLen: 是缓冲区 pucBuf 的字节长度 + */ + virtual int Recv( UCHAR *pucBuf, UINT16 u16BufLen, UCHAR *pucCmd ) + { + UINT16 u16Len; + UINT32 u32bitLen; + int n; + + VSPR_TRACE(); + n = Recvfrom( m_aucRxBuf, 1024); +#ifdef DEBUG + printf("\nrx byte len = %d", n); + for( int i = 0; i < n; i++ ) + { + printf("%02x ", m_aucRxBuf[i] ); + } + printf("\n"); +#endif + + /** + * 接收包是否合格 + * + */ + + /** + * 1.长度是否合格; + */ + if( n <= 8 ) + { + return -1; + } + + // 取长度 + u32bitLen = *((UINT32 *)&m_aucRxBuf[4]); + u32bitLen = ntohl(u32bitLen); + + // payload字节长度 + u16Len = u32bitLen / 8 + ((u32bitLen % 8)?1:0); + n -= 8 + u16Len; + VSPR_TRACE1( printf("\nrx bitlen = %lu, n = %d", u32bitLen, n)); + // 数据包长度错误 + if( n ) + { + return -1; + } + + // 判断包头等 + if( m_aucRxBuf[0] != VSPR_HEADER_MARK ) + { + return -1; + } + if( m_aucRxBuf[1] != m_ucDirection ) + { + return -1; + } + + if( pucCmd ) + { + *pucCmd = m_aucRxBuf[2]; + } + + // 复制数据 + if( u16Len <= u16BufLen ) + { + memcpy( pucBuf, &m_aucRxBuf[8], u16Len); + return u32bitLen; + } + + // 缓冲区长度不足 + return -2; + } + + protected: + UCHAR m_ucDirection; + UCHAR m_aucRxBuf[1024]; + }; + + class clUSPFromVSPR : public clVSPRUDPSocket_Rx + { + public: + clUSPFromVSPR( ) + :clVSPRUDPSocket_Rx(DIRECTION_USP_FROM_VSPR, UDP_PORT_USP) + { + VSPR_TRACE(); + } + ~clUSPFromVSPR( ) + { + VSPR_TRACE(); + } + }; + class clVSPRFromUSP : public clVSPRUDPSocket_Rx + { + public: + clVSPRFromUSP( ) + :clVSPRUDPSocket_Rx(DIRECTION_VSPR_FROM_USP, UDP_PORT_VSPR ) + { + VSPR_TRACE(); + } + ~clVSPRFromUSP( ) + { + VSPR_TRACE(); + } + }; + + class clPCDFromPICC : public clVSPRUDPSocket_Rx + { + public: + clPCDFromPICC( ) + :clVSPRUDPSocket_Rx(DIRECTION_PCD_FROM_PICC, UDP_PORT_PCD) + { + VSPR_TRACE(); + } + ~clPCDFromPICC( ) + { + VSPR_TRACE(); + } + }; + + class clPICCFromPCD : public clVSPRUDPSocket_Rx + { + public: + clPICCFromPCD( ) + :clVSPRUDPSocket_Rx( DIRECTION_PICC_FROM_PCD, UDP_PORT_PICC) + { + VSPR_TRACE(); + } + ~clPICCFromPCD( ) + { + VSPR_TRACE(); + + setsockopt(m_nSocketId, IPPROTO_IP, IP_DROP_MEMBERSHIP, (const char *)&m_stCommand, sizeof( m_stCommand )); + } +#ifdef PCD_TO_PICC_USE_BROAD + /** + * 对于PICC,其接收的是组播消息. + * + */ + virtual int Init( UCHAR ucDirection = DIRECTION_UNDEFINED, USHORT usPort = 0 ) + { + int r; + struct ip_mreq command; + + VSPR_TRACE(); + r = clVSPRUDPSocket_Rx::Init( ucDirection, usPort ); + // allow multiple processses to use this port. + int loop = 1; + setsockopt( m_nSocketId, SOL_SOCKET, SO_REUSEADDR, (const char *)&loop, sizeof(loop )); + + // allow broadcart to this machine + setsockopt( m_nSocketId, IPPROTO_IP, IP_MULTICAST_LOOP, (const char *)&loop, sizeof( loop )); + + // join the broadcast group + m_stCommand.imr_multiaddr.s_addr = inet_addr(BROADCAST_IP); + m_stCommand.imr_interface.s_addr = htonl( INADDR_ANY ); + setsockopt( m_nSocketId, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const char *)&m_stCommand, sizeof(m_stCommand)); + } +#endif + protected: + struct ip_mreq m_stCommand; + }; + + /*-----------------------------------------------------------------*\ + * Tx方向 + * + *-----------------------------------------------------------------*/ + + class clUDPSocket_Tx + { + public: + clUDPSocket_Tx( ) + { + VSPR_TRACE(); + m_nSocketId = -1; + m_usRemoteUDPPort = 0; + m_szRemoteIpAddr[0] = 0x00; + memset( (void *)&m_stAddr, 0x00, sizeof( m_stAddr )); + } + + clUDPSocket_Tx( USHORT usRemoteUDPPort, char *szRemoteIPAddr = NULL ) + { + VSPR_TRACE(); + m_nSocketId = -1; + m_usRemoteUDPPort = usRemoteUDPPort; + memset( (void *)&m_stAddr, 0x00, sizeof( m_stAddr )); + if( szRemoteIPAddr ) + { + strcpy_s( m_szRemoteIpAddr, szRemoteIPAddr ); + } + } + + virtual ~clUDPSocket_Tx( ) + { + VSPR_TRACE(); + if( m_nSocketId != -1 ) + { + closesocket( m_nSocketId ); + m_nSocketId = -1; + } + } + + int Init( USHORT usRemoteUDPPort = 0, char *szRemoteIpAddr = NULL ) + { + VSPR_TRACE(); + + { + WSADATA wsa; + if (WSAStartup(MAKEWORD(2,2),&wsa) != 0) + { + return -1; + } + } + + if( m_nSocketId == -1 ) + { + m_nSocketId = socket( AF_INET, SOCK_DGRAM, 0 ); + } + + if( szRemoteIpAddr ) + { + strcpy_s( m_szRemoteIpAddr, szRemoteIpAddr ); + } + + if( m_szRemoteIpAddr[0] == 0x00 ) + { + strcpy_s( m_szRemoteIpAddr, LOCAL_IP ); + } + + if( usRemoteUDPPort ) + { + m_usRemoteUDPPort = usRemoteUDPPort; + } + + // bzero( &m_stAddr, sizeof( m_stAddr )); + memset( &m_stAddr, 0x00, sizeof( m_stAddr )); + m_stAddr.sin_family = AF_INET; + m_stAddr.sin_addr.s_addr = inet_addr( m_szRemoteIpAddr ); + m_stAddr.sin_port = htons( m_usRemoteUDPPort ); + + return 0; + } + + int SendTo( UCHAR *pucBuf, USHORT usBufLen ) + { + VSPR_TRACE(); + if( m_nSocketId != -1 && m_usRemoteUDPPort != 0 ) + { + VSPR_TRACE1( printf("\nsocketid=%d, remote udp port=%d, hostip = %s", m_nSocketId, m_usRemoteUDPPort, m_szRemoteIpAddr )); + return sendto( m_nSocketId, (const char *)pucBuf, usBufLen, 0, (struct sockaddr *)&m_stAddr, sizeof( m_stAddr )); + } + return -1; + } + + + protected: + int m_nSocketId; // socket id. + + char m_szRemoteIpAddr[20]; + USHORT m_usRemoteUDPPort; + + struct sockaddr_in m_stAddr; + int m_sin_len; + }; + + class clVSPRUDPSocket_Tx : public clUDPSocket_Tx + { + public: + clVSPRUDPSocket_Tx( ) + { + VSPR_TRACE(); + m_ucDirection = DIRECTION_UNDEFINED; + } + + clVSPRUDPSocket_Tx( UCHAR ucDirection, USHORT usRemoteUDPPort, char *szRemoteIPAddr = NULL ) + : clUDPSocket_Tx( usRemoteUDPPort, szRemoteIPAddr ) + { + VSPR_TRACE(); + m_ucDirection = ucDirection; + } + + ~clVSPRUDPSocket_Tx() + { + VSPR_TRACE(); + } + + int Init( UCHAR ucDirection, USHORT usRemoteUDPPort, char *szRemoteIpAddr = NULL ) + { + VSPR_TRACE(); + m_ucDirection = ucDirection; + m_aucTxBuf[0] = VSPR_HEADER_MARK; + m_aucTxBuf[1] = m_ucDirection; + return clUDPSocket_Tx::Init( usRemoteUDPPort, szRemoteIpAddr ); + } + + int Init( ) + { + VSPR_TRACE(); + m_aucTxBuf[0] = VSPR_HEADER_MARK; + m_aucTxBuf[1] = m_ucDirection; + return clUDPSocket_Tx::Init( ); + } + + /** + * 发送比特长度数据! + * + */ + virtual int Send( UCHAR *pucBuf, UINT32 u32BitLen, UCHAR ucCmd = VSPR_CMD_UNSED ) + { + UINT16 u16SendLen; + + VSPR_TRACE(); + m_aucTxBuf[2] = ucCmd; + m_aucTxBuf[3] = 0x00; + + *((UINT32 *)&m_aucTxBuf[4]) = htonl(u32BitLen); + + u16SendLen = u32BitLen / 8; + u16SendLen += ( u32BitLen % 8 ) ? 1:0; + + memcpy( &m_aucTxBuf[8], pucBuf, u16SendLen ); + + return SendTo( m_aucTxBuf, u16SendLen + 8 ); + } + protected: + UCHAR m_ucDirection; + UCHAR m_aucTxBuf[1024]; + }; + + class clPCDToPICC : public clVSPRUDPSocket_Tx + { + public: + // 如果szRemoteIPAddr + // PCDToPICC默认采用多播方式广播,其地址为:224.0.0.1 + // NULL表示本地,否则远端主机ip地址 +#ifdef PCD_TO_PICC_USE_BROAD + clPCDToPICC( char *szRemoteIPAddr = BROADCAST_IP ) +#else + clPCDToPICC( char *szRemoteIPAddr = NULL ) +#endif + : clVSPRUDPSocket_Tx( DIRECTION_PCD_TO_PICC, UDP_PORT_PICC, szRemoteIPAddr ) + { + VSPR_TRACE(); + } + ~clPCDToPICC() + { + VSPR_TRACE(); + } + }; + + /** + * 可以继续其他类 + */ + class clPICCToPCD : public clVSPRUDPSocket_Tx + { + public: + clPICCToPCD( char *szRemoteIPAddr = NULL ) + : clVSPRUDPSocket_Tx( DIRECTION_PICC_TO_PCD, UDP_PORT_PCD, szRemoteIPAddr ) + { + VSPR_TRACE(); + } + ~clPICCToPCD() + { + VSPR_TRACE(); + } + }; + + /** + * 可以继续其他类 + */ + class clUSPToVSPR : public clVSPRUDPSocket_Tx + { + public: + clUSPToVSPR( char *szRemoteIPAddr = NULL ) + : clVSPRUDPSocket_Tx( DIRECTION_USP_TO_VSPR, UDP_PORT_VSPR, szRemoteIPAddr ) + { + VSPR_TRACE(); + } + ~clUSPToVSPR() + { + VSPR_TRACE(); + } + }; + + /** + * 可以继续其他类 + */ + class clVSPRToUSP : public clVSPRUDPSocket_Tx + { + public: + clVSPRToUSP( char *szRemoteIPAddr = NULL ) + : clVSPRUDPSocket_Tx( DIRECTION_VSPR_TO_USP, UDP_PORT_USP, szRemoteIPAddr ) + { + VSPR_TRACE(); + } + ~clVSPRToUSP() + { + VSPR_TRACE(); + } + }; + + /** + * 为VSPR平台封装一个采用UDP实现的Transceiver + * 在发送和接收方向,分别使用UDP Tx/Rx实现 + * + */ + class clVSPRUDPTransceiver + { + public: + clVSPRUDPTransceiver( char *szRemoteIPAddr = NULL ) + { + VSPR_TRACE(); + m_pTx = NULL; + m_pRx = NULL; + + SetRemoteIpAddr( szRemoteIPAddr ); + } + ~clVSPRUDPTransceiver() + { + VSPR_TRACE(); + if( m_pTx ) + { + delete m_pTx; + m_pTx = NULL; + } + + if( m_pRx ) + { + delete m_pRx; + m_pRx = NULL; + } + } + + /** + * 用于new and init两个udp tx/rx类 + * + */ + virtual int Init( char *szRemoteIPAddr = NULL ) + { + SetRemoteIpAddr( szRemoteIPAddr ); + + return 0; + } + + int Send( UCHAR *pucBuf, UINT32 u32BitLen, UCHAR ucCmd = VSPR_CMD_UNSED ) + { + VSPR_TRACE(); + if( m_pTx ) + { + return m_pTx->Send( pucBuf, u32BitLen, ucCmd ); + } + return 0; + } + + /** + * 返回:接收数据长度 + */ + int Recv( UCHAR *pucBuf, UINT16 u16BufLen, UCHAR *pucCmd = NULL ) + { + VSPR_TRACE(); + if( m_pRx ) + { + return m_pRx->Recv( pucBuf, u16BufLen, pucCmd ); + } + return 0; + } + protected: + void SetRemoteIpAddr( char *szRemoteIPAddr ) + { + if( szRemoteIPAddr ) + { + strcpy_s( m_szRemoteIpAddr, szRemoteIPAddr ); + } + else + { + strcpy_s( m_szRemoteIpAddr, LOCAL_IP ); + } + } + protected: + char m_szRemoteIpAddr[10]; + clVSPRUDPSocket_Tx* m_pTx; + clVSPRUDPSocket_Rx* m_pRx; + }; +} + +#endif + + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCmd.cpp b/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCmd.cpp new file mode 100644 index 0000000..ea81f3e --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCmd.cpp @@ -0,0 +1,171 @@ +/** + * \file clVSPRCmd.cpp + * + * + */ +#include "clVSPRCmd.h" + +namespace VSPR_OF_ISO14443A +{ + clVSPRCmd::clVSPRCmd( UCHAR ucHost ) + { + m_ucHost = ucHost; + + m_stTxHeader.ucHeaderMark = VSPR_HEADER_MARK; + m_stTxHeader.ucCmd = VSPR_CMD_UNSED; + m_stTxHeader.ucRsvd = 0x00; + m_stTxHeader.nBitLen = 0; + + m_stRxHeader.ucHeaderMark = VSPR_HEADER_MARK; + m_stRxHeader.ucCmd = VSPR_CMD_UNSED; + m_stRxHeader.ucRsvd = 0x00; + m_stRxHeader.nBitLen = 0; + + switch( m_ucHost ) + { + case HOST_VSPR: + m_stTxHeader.ucDirection = DIRECTION_VSPR_TO_USP; + m_stRxHeader.ucDirection = DIRECTION_VSPR_FROM_USP; + break; + case HOST_USP: + m_stTxHeader.ucDirection = DIRECTION_USP_TO_VSPR; + m_stRxHeader.ucDirection = DIRECTION_USP_FROM_VSPR; + break; + } + } + + clVSPRCmd::~clVSPRCmd() + { + } + + bool clVSPRCmd::Init() + { + return true; + } + + int clVSPRCmd::GetStream_CODE_1BIT_REQ(UCHAR ucPCD, UCHAR ucPreBit, UCHAR ucBit, UCHAR *streamBuf, int *pstreamBitLen ) + { + UCHAR payloadBuf[3]; + + payloadBuf[0] = ucPCD ? 1:0; + payloadBuf[1] = ucPreBit ? 1:0; + payloadBuf[2] = ucBit ? 1:0; + return GetStream( VSPR_CMD_CODE_1BIT_REQ, payloadBuf, 24, streamBuf, pstreamBitLen ); + } + + int clVSPRCmd::GetStream_CODE_SOF_REQ( UCHAR ucPCD, UCHAR *streamBuf, int *pstreamBitLen ) + { + UCHAR payloadBuf[1]; + + payloadBuf[0] = ucPCD ? 1:0; + return GetStream( VSPR_CMD_CODE_SOF_REQ, payloadBuf, 8, streamBuf, pstreamBitLen ); + } + + int clVSPRCmd::GetStream_CODE_EOF_REQ( UCHAR ucPCD, UCHAR ucPreBit, UCHAR *streamBuf, int *pstreamBitLen ) + { + UCHAR payloadBuf[2]; + + payloadBuf[0] = ucPCD ? 1:0; + payloadBuf[1] = ucPreBit ? 1:0; + return GetStream( VSPR_CMD_CODE_EOF_REQ, payloadBuf, 16, streamBuf, pstreamBitLen ); + } + + + int clVSPRCmd::GetStream_CODE_FRAME_REQ( UCHAR ucPCD, UCHAR buf[], int bufBitLen, UCHAR *streamBuf, int *pstreamBitLen ) + { + UCHAR payloadBuf[1024]; + + payloadBuf[0] = ucPCD ? 1:0; + memcpy( payloadBuf+1, buf, bufBitLen/8+((bufBitLen%8)?1:0)); + return GetStream( VSPR_CMD_CODE_FRAME_REQ, payloadBuf, bufBitLen+8, streamBuf, pstreamBitLen ); + } + + + int clVSPRCmd::GetCmd_CODE_1BIT_REQ( UCHAR *streamBuf, int streamBitLen, UCHAR *pucPCD, UCHAR *Coded ) + { + *pucPCD = streamBuf[0]; + *Coded = streamBuf[1]; + return 16; + } + + int clVSPRCmd::GetCmd_CODE_SOF_REQ( UCHAR *streamBuf, int streamBitLen, UCHAR *pucPCD, UCHAR *Coded ) + { + *pucPCD = streamBuf[0]; + *Coded = streamBuf[1]; + return 16; + } + + int clVSPRCmd::GetCmd_CODE_EOF_REQ( UCHAR *streamBuf, int streamBitLen, UCHAR *pucPCD, UCHAR *Coded ) + { + *pucPCD = streamBuf[0]; + *Coded = streamBuf[1]; + return 16; + } + + int clVSPRCmd::GetCmd_CODE_FRAME_REQ( UCHAR *streamBuf, int streamBitLen, UCHAR *pucPCD, UCHAR *pCodedBuf, int *pbufBitLen ) + { + UCHAR ucCmdId; + *pucPCD = streamBuf[0]; + return GetCmd(streamBuf+1,streamBitLen-8, &ucCmdId, pCodedBuf, pbufBitLen); + } + + int clVSPRCmd::GetStream( UCHAR cmdId, UCHAR *payloadBuf, int payloadBitLen, UCHAR *streamBuf, int *pstreamBitLen ) + { + int len = 0, k; + + m_stTxHeader.ucCmd = cmdId; + m_stTxHeader.nBitLen = payloadBitLen; + + memcpy( streamBuf, &m_stTxHeader, sizeof(m_stTxHeader)); + len += sizeof(m_stTxHeader); + + k = payloadBitLen/8; + memcpy( streamBuf+len, payloadBuf, k ); + len += k; + + if( payloadBitLen%8 ) + { + streamBuf[len] = 0x00; +#if 0 + for( int i = 0; i > (7-i)) & 1; + } +#endif + streamBuf[len] = payloadBuf[k]; + + len++; + } + + *pstreamBitLen = payloadBitLen + 8 * sizeof(m_stRxHeader); + return len; + } + + int clVSPRCmd::GetCmd( UCHAR *streamBuf, int streamBitLen, UCHAR *pcmdId, UCHAR *payloadBuf, int *payloadBitLen ) + { + int len = 0, k; + + memcpy( payloadBuf, streamBuf, sizeof(m_stRxHeader)); + len += sizeof(m_stRxHeader); + *pcmdId = m_stRxHeader.ucCmd; + + k = streamBitLen/8-len; + memcpy( payloadBuf, streamBuf+len, k ); + len += k; + + if( streamBitLen%8 ) + { + payloadBuf[k] = 0x00; + for( int i = (streamBitLen%8)-1; i >= 0; i-- ) + { + streamBuf[k] |= (payloadBuf[len] >> (7-i)) & 1; + } + len++; + } + + *payloadBitLen = streamBitLen - 8 * sizeof(m_stRxHeader); + m_stRxHeader.nBitLen = *payloadBitLen; + + return len; + } +} \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCmd.h b/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCmd.h new file mode 100644 index 0000000..8bc38a4 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRCmd.h @@ -0,0 +1,100 @@ +/** + * \file clVSPRCmd.h + * + * + */ +#include "..\rfid_def.h" +namespace VSPR_OF_ISO14443A +{ + + class clVSPRCmd + { + public: + clVSPRCmd( UCHAR ucHost ); + ~clVSPRCmd(); + + bool Init(); + + // + int GetStream_CODE_1BIT_REQ(UCHAR ucPCD, UCHAR ucPreBit, UCHAR ucBit, UCHAR *streamBuf, int *pstreamBitLen ); + int GetStream_CODE_SOF_REQ(UCHAR ucPCD, UCHAR *streamBuf, int *pstreamBitLen); + int GetStream_CODE_EOF_REQ(UCHAR ucPCD, UCHAR ucPreBit, UCHAR *streamBuf, int *pstreamBitLen); + int GetStream_CODE_FRAME_REQ(UCHAR ucPCD, UCHAR buf[], int bufBitLen, UCHAR *streamBuf, int *pstreamBitLen ); + + // Ӧ + int GetCmd_CODE_1BIT_REQ( UCHAR *streamBuf, int streamBitLen, UCHAR *pucPCD, UCHAR *Coded ); + int GetCmd_CODE_SOF_REQ( UCHAR *streamBuf, int streamBitLen, UCHAR *pucPCD, UCHAR *Coded ); + int GetCmd_CODE_EOF_REQ( UCHAR *streamBuf, int streamBitLen, UCHAR *pucPCD, UCHAR *Coded ); + int GetCmd_CODE_FRAME_REQ( UCHAR *streamBuf, int streamBitLen, UCHAR *pucPCD, UCHAR *pCodedBuf, int *pbufBitLen ); + + // У + int GetStream_ODD_PARITY_REQ( UCHAR dat, UCHAR *streamBuf, int *pstreamBitLen ) + { + return GetStream( VSPR_CMD_ODD_PARITY_REQ, &dat, 8, streamBuf, pstreamBitLen ); + } + int GetStream_CRC16_REQ( UCHAR buf[], int bufLen, UCHAR *streamBuf, int *pstreamBitLen ) + { + return GetStream( VSPR_CMD_CRC16_REQ, buf, bufLen*8, streamBuf, pstreamBitLen ); + } + + int GetCmd_ODD_PARITY_REQ( UCHAR *streamBuf, int *pstreamBitLen, UCHAR *parity ) + { + *parity = streamBuf[8]; + return 1; + } + + int GetCmd_CRC16_REQ( UCHAR streamBuf[], int streamBufBitLen, UCHAR *lsb, UCHAR *msb ) + { + *lsb = streamBuf[8]; + *msb = streamBuf[9]; + return 2; + } +#if 0 + // ֡ + #define VSPR_CMD_UNFRAME_SHORT_REQ 0x28 + #define VSPR_CMD_UNFRAME_SHORT_RSP 0xA8 + #define VSPR_CMD_UNFRAME_STD_REQ 0x29 + #define VSPR_CMD_UNFRAME_STD_RSP 0xA9 + #define VSPR_CMD_UNFRAME_ANTICOLISSION_REQ 0x2A + #define VSPR_CMD_UNFRAME_ANTICOLISSION_RSP 0xAA + + int Get +#endif + + protected: + // <0ʧ + // 룺˳ݣһֽڵЧλͼλϣ + // streamڷͣ + int GetStream( UCHAR cmdId, UCHAR *payloadBuf, int payloadBitLen, UCHAR *streamBuf, int *pstreamBitLen ); + + // յݺʾȣ + // ˳ݣһֽڵЧλͼλϣ + int GetCmd( UCHAR *streamBuf, int streamBitLen, UCHAR *pcmdId, UCHAR *payloadBuf, int *payloadBitLen ); + protected: + UCHAR m_ucHost; + HeaderOfVSPRCOM m_stTxHeader; + HeaderOfVSPRCOM m_stRxHeader; + + }; + + class clVSPR_VSPR : public clVSPRCmd + { + public: + clVSPR_VSPR( ) + : clVSPRCmd( HOST_VSPR ) + { + } + }; + + class clVSPR_USP : public clVSPRCmd + { + public: + clVSPR_USP( ) + : clVSPRCmd( HOST_USP ) + { + } + }; +} + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRTrans.h b/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRTrans.h new file mode 100644 index 0000000..55ce3de --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/class/clVSPRTrans.h @@ -0,0 +1,131 @@ +/** + * clVSPRTrans.h + * + * PCD/PICC/USPʹõľзͺͽչܵ࣬ཫװTxRx. + */ + +#include "clVSPRCOM.h" + +#ifndef _CLASS_VSPR_TRANS_H_ +#define _CLASS_VSPR_TRANS_H_ + +namespace VSPR_OF_ISO14443A +{ + /** + * PCD TransʵֺPICCͨѶ. + * + */ + class clPCDTransceiver : public clVSPRUDPTransceiver + { + public: + clPCDTransceiver( char *szRemoteIpAddr = NULL ) + : clVSPRUDPTransceiver( szRemoteIpAddr ) + { + VSPR_TRACE(); + + // PCDͷǹ㲥ַ. + if( szRemoteIpAddr == NULL ) + { +#ifdef PCD_TO_PICC_USE_BROAD + strcpy( m_szRemoteIpAddr, BROADCAST_IP ); +#else + strcpy( m_szRemoteIpAddr, LOCAL_IP ); +#endif + } + } + + ~clPCDTransceiver() + { + VSPR_TRACE(); + } + + int Init( char *szRemoteIpAddr = NULL ) + { + VSPR_TRACE(); + + clVSPRUDPTransceiver::Init( szRemoteIpAddr ); + if( szRemoteIpAddr == NULL ) + { +#ifdef PCD_TO_PICC_USE_BROAD + strcpy( m_szRemoteIpAddr, BROADCAST_IP ); +#else + strcpy( m_szRemoteIpAddr, LOCAL_IP ); +#endif + } + + m_pTx = (clVSPRUDPSocket_Tx *)(new clPCDToPICC( m_szRemoteIpAddr )); + if( !m_pTx ) + { + return -1; + } + if( m_pTx->Init() < 0 ) + { + return -1; + } + + m_pRx = (clVSPRUDPSocket_Rx *)(new clPCDFromPICC( )); + if( !m_pRx ) + { + return -1; + } + if( m_pRx->Init() < 0 ) + { + return -1; + } + return 0; + } + }; + + /** + * PICC TransʵֺPCDͨѶ. + * + * Ĭ£PICCͷunicastʽշΪboradcast. + */ + class clPICCTransceiver : public clVSPRUDPTransceiver + { + public: + clPICCTransceiver( char *szRemoteIpAddr = NULL ) + : clVSPRUDPTransceiver( szRemoteIpAddr ) + { + VSPR_TRACE(); + } + ~clPICCTransceiver( ) + { + VSPR_TRACE(); + } + + int Init( char *szRemoteIPAddr = NULL ) + { + VSPR_TRACE(); + clVSPRUDPTransceiver::Init( szRemoteIPAddr ); + + m_pTx = (clVSPRUDPSocket_Tx *)(new clPICCToPCD( m_szRemoteIpAddr )); + if( !m_pTx ) + { + return -1; + } + if( m_pTx->Init() < 0 ) + { + return -1; + } + + m_pRx = (clVSPRUDPSocket_Rx *)(new clPICCFromPCD( )); + if( !m_pRx ) + { + return -1; + } + if( m_pRx->Init() < 0 ) + { + return -1; + } + return 0; + } + protected: + }; +} +#endif + + + + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/pcd_thread.cpp b/Labs/Lab2/requirements/src/rfidsrc/pcd_thread.cpp new file mode 100644 index 0000000..036c3f7 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/pcd_thread.cpp @@ -0,0 +1,59 @@ +#include "pcd_thread.h" +#include "rfid_com.h" +#include "rfid_iso14443A_pcd.h" + + +static HWND g_hWnd; +static UINT g_uMsgId; +extern int g_firstBitValue; + +void pcd_updateStatus( int status ) +{ + SendMessage( g_hWnd, g_uMsgId, NULL, (LPARAM)status ); +} + +void pcd_postMessage( UCHAR *buf, int nBufBitLen, int npcd_cmd, char *action ) +{ + PCD_Thread_Out_prm oprm; + + oprm.buf = buf; + oprm.nBufBitLen = nBufBitLen; + oprm.npcd_cmd = npcd_cmd; + oprm.action = action; + + SendMessage( g_hWnd, g_uMsgId, (WPARAM)&oprm, (LPARAM)0 ); +} + +bool g_bRun = true; + +void pcd_thread( PCD_Thread_In_prm *pPrm ) +{ + // ȡ + PCD_Thread_In_prm wprm = *pPrm; + int k = 0; + + g_hWnd = wprm.hWnd; + g_uMsgId = wprm.uMsgId; + g_firstBitValue = wprm.nBitValue ? 1:0; + + RFID_COM_PCD_Init( wprm.u16_pcd_rx_port, wprm.u16_picc_rx_port ); + + // յ. +#if 0 + UCHAR buf[]={0x12, 0x34, 0x57, 0x78}; + RFID_Reader_Tx( 32, buf ); +#endif + + ISO_14443A_PCD stPCD; + while( g_bRun ) + { + PCD_ISO14443A_run( &stPCD ); + if( stPCD.ucStatus == ISO_14443A_PCD_STATE_OK ) + { + // һPICC. +// pcd_postMessage( 0, 0); + } + } + + RFID_COM_Close(); +} \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/pcd_thread.h b/Labs/Lab2/requirements/src/rfidsrc/pcd_thread.h new file mode 100644 index 0000000..f6bee5f --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/pcd_thread.h @@ -0,0 +1,33 @@ +#ifndef _PCD_THREAD_H_ +#define _PCD_THREAD_H_ + +#include "rfid_def.h" +#include +#include // for HWND + +typedef struct tag_PCD_Thread_In_prm +{ + HWND hWnd; + UINT uMsgId; + UINT16 u16_pcd_rx_port; + UINT16 u16_picc_rx_port; + int nBitValue; +}PCD_Thread_In_prm; + +// 漰buffer. +// ΰݴȥ: ߲أ +typedef struct +{ + UCHAR *buf; + int nBufBitLen; + int npcd_cmd; + char *action; +}PCD_Thread_Out_prm; + +// ̺߳ +void pcd_thread( PCD_Thread_In_prm *pPrm ); + +void pcd_updateStatus( int status ); +void pcd_postMessage( UCHAR *buf, int nBufBitLen, int npcd_cmd, char *action ); + +#endif \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/picc_thread.cpp b/Labs/Lab2/requirements/src/rfidsrc/picc_thread.cpp new file mode 100644 index 0000000..4efa7df --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/picc_thread.cpp @@ -0,0 +1,58 @@ +#include "picc_thread.h" +#include "rfid_com.h" +#include "rfid_iso14443A_picc.h" + +static HWND g_hWnd; +static UINT g_uMsgId; + +void picc_updateStatus( int status ) +{ + SendMessage( g_hWnd, g_uMsgId, NULL, (LPARAM)status ); +} + +void picc_postMessage( UCHAR *buf, int nBufBitLen, int npicc_status, char *action ) +{ + PICC_Thread_Out_prm oprm; + + oprm.buf = buf; + oprm.nBufBitLen = nBufBitLen; + oprm.npicc_status = npicc_status; + oprm.action = action; + + SendMessage( g_hWnd, g_uMsgId, (WPARAM)&oprm, (LPARAM)0 ); +} + +void picc_thread( PICC_Thread_In_prm *pPrm ) +{ + // ȡ + bool m_bRun = true; + PICC_Thread_In_prm wprm = *pPrm; + + g_hWnd = wprm.hWnd; + g_uMsgId = wprm.uMsgId; + + ISO_14443A_PICC stPICC; + + stPICC.ucStatus = ISO_14443A_STATE_IDLE; + stPICC.ucCmpBits = 0; + switch( wprm.uc_picc_ID_Len ) + { + case 4: + stPICC.ucCLn = 0; + break; + case 7: + stPICC.ucCLn = 1; + break; + case 10: + stPICC.ucCLn = 2; + break; + } + GetUIDFromString( &stPICC, wprm.sz_picc_ID ); + + RFID_COM_PICC_Init( wprm.sz_pcd_ip, wprm.u16_pcd_rx_port, wprm.u16_picc_rx_port ); + + PICC_ISO14443A_run( &stPICC ); + + // SendMessage: Ϊյݵԭ. +// SendMessage( wprm.hWnd, wprm.uMsgId, 0, 0); +} \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/picc_thread.h b/Labs/Lab2/requirements/src/rfidsrc/picc_thread.h new file mode 100644 index 0000000..1b20dc1 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/picc_thread.h @@ -0,0 +1,36 @@ +#ifndef _PICC_THREAD_H_ +#define _PICC_THREAD_H_ +#include "rfid_def.h" +#include +#include // for HWND + +// to picc thread; +// buffer; +typedef struct tag_PICC_Thread_In_prm +{ + HWND hWnd; + UINT uMsgId; + char sz_pcd_ip[20]; + UINT16 u16_pcd_rx_port; + UINT16 u16_picc_rx_port; + char sz_picc_ID[21]; + UCHAR uc_picc_ID_Len; +}PICC_Thread_In_prm; + +// 漰buffer. +// ΰݴȥ: ߲أ +typedef struct +{ + UCHAR *buf; + int nBufBitLen; + int npicc_status; + char *action; +}PICC_Thread_Out_prm; + +// ̺߳ +void picc_thread( PICC_Thread_In_prm *pPrm ); + +// PICC +void picc_updateStatus( int status ); +void picc_postMessage( UCHAR *buf, int nBufBitLen, int npicc_status, char *action = NULL ); +#endif \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.IAB b/Labs/Lab2/requirements/src/rfidsrc/rfid.IAB new file mode 100644 index 0000000..a37d04e Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.IAB differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.IAD b/Labs/Lab2/requirements/src/rfidsrc/rfid.IAD new file mode 100644 index 0000000..ef3b18d Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.IAD differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.IMB b/Labs/Lab2/requirements/src/rfidsrc/rfid.IMB new file mode 100644 index 0000000..2a6ad08 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.IMB differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.IMD b/Labs/Lab2/requirements/src/rfidsrc/rfid.IMD new file mode 100644 index 0000000..2ffccb1 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.IMD differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.PFI b/Labs/Lab2/requirements/src/rfidsrc/rfid.PFI new file mode 100644 index 0000000..7e383b7 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.PFI differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.PO b/Labs/Lab2/requirements/src/rfidsrc/rfid.PO new file mode 100644 index 0000000..a54baca Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.PO differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.PR b/Labs/Lab2/requirements/src/rfidsrc/rfid.PR new file mode 100644 index 0000000..73b6310 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.PR differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.PRI b/Labs/Lab2/requirements/src/rfidsrc/rfid.PRI new file mode 100644 index 0000000..8516c84 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.PRI differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.PS b/Labs/Lab2/requirements/src/rfidsrc/rfid.PS new file mode 100644 index 0000000..675770e Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.PS differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid.WK3 b/Labs/Lab2/requirements/src/rfidsrc/rfid.WK3 new file mode 100644 index 0000000..6442199 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/rfid.WK3 differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_chk.cpp b/Labs/Lab2/requirements/src/rfidsrc/rfid_chk.cpp new file mode 100644 index 0000000..a9bcedf --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_chk.cpp @@ -0,0 +1,168 @@ +/** + * \file rfid_chk.c + * + * \brief ʵrfidеУ顣 + */ +//#include "StdAfx.h" + +#include "rfid_chk.h" + +/** + * CRCУ + * + * \input BYTE aBuf[], + * UINT16 u16Len + * UINT16 u16InitPrm CRC16ֵ. + * \ouput BYTE *pCRCMSB CRC8bit + * BYTE *pCRCLSB CRC8bit + * \return 1ɹ<0ʧ. + */ +int CRC16( UINT16 u16InitPrm, BYTE aBuf[], UINT16 u16Len,BYTE *pCRCMSB, BYTE *pCRCLSB ); + +int OldParity(BYTE Dat ) +{ + int k=0; + int i; + + for( i = 0; i < 8; i++ ) + { + if(( Dat >> i ) & 0x01 ) + { + k++; + } + } + return k % 2 ? 0:1; +} + +int ISO14443A_CRC( BYTE aBuf[], UINT16 u16Len,BYTE *pCRCMSB, BYTE *pCRCLSB ) +{ + return CRC16( 0x6363, aBuf, u16Len, pCRCMSB, pCRCLSB ); +} + + +UINT16 UpdateCrc(BYTE ch, UINT16 *lpwCrc) +{ + ch = (ch^(unsigned char)((*lpwCrc) & 0x00FF)); + ch = (ch^(ch<<4)); + + *lpwCrc = (*lpwCrc >> 8)^((UINT16)ch << 8)^((UINT16)ch<<3)^((UINT16)ch>>4); + return(*lpwCrc); +} + +/** + * CRCУ + * + * \input BYTE aBuf[], + * UINT16 u16Len + * UINT16 u16InitPrm CRC16ֵ. + * \ouput BYTE *pCRCMSB CRC8bit + * BYTE *pCRCLSB CRC8bit + * \return 1ɹ<0ʧ. + */ +int CRC16( UINT16 u16InitValue, BYTE aBuf[], UINT16 u16Len,BYTE *pCRCMSB, BYTE *pCRCLSB ) +{ + UINT16 wCrc; + unsigned char chBlock; + int i; + + wCrc = u16InitValue; + for( i = 0; i < u16Len; i++ ) + { + chBlock = aBuf[i]; + UpdateCrc(chBlock, &wCrc); + } + if( u16InitValue == 0xFFFF ) + { + wCrc = ~wCrc; // ISO 3309 + } + *pCRCLSB = (BYTE) (wCrc & 0xFF); + *pCRCMSB = (BYTE) ((wCrc >> 8) & 0xFF); + + return 1; +} + +#if 0 +/*------------------------------------------------------------*\ + * DZ׼УCRCļdemo. + * + */ +#include +#include +#include +#include + +#define CRC_A 1 +#define CRC_B 2 +#define BYTE unsigned char + +unsigned short UpdateCrc(unsigned char ch, unsigned short *lpwCrc) +{ +ch = (ch^(unsigned char)((*lpwCrc) & 0x00FF)); +ch = (ch^(ch<<4)); + +*lpwCrc = (*lpwCrc >> 8)^((unsigned short)ch << 8)^((unsigned +short)ch<<3)^((unsigned short)ch>>4); +return(*lpwCrc); +} + +void ComputeCrc(int CRCType, char *Data, int Length, +BYTE *TransmitFirst, BYTE *TransmitSecond) +{ +unsigned char chBlock; +unsigned short wCrc; + +switch(CRCType) { +case CRC_A: +wCrc = 0x6363; // ITU-V.41 +break; +case CRC_B: +wCrc = 0xFFFF; // ISO 3309 +break; +default: +return; +} + +do { +chBlock = *Data++; +UpdateCrc(chBlock, &wCrc); +} while (--Length); +if (CRCType == CRC_B) +wCrc = ~wCrc; // ISO 3309 +*TransmitFirst = (BYTE) (wCrc & 0xFF); +*TransmitSecond = (BYTE) ((wCrc >> 8) & 0xFF); + +return; +} + +BYTE BuffCRC_A[10] = {0x12, 0x34}; +BYTE BuffCRC_B[10] = {0x0A, 0x12, 0x34, 0x56}; +unsigned short Crc; +BYTE First, Second; +FILE *OutFd; +int i; + +int main(void) +{ +printf("CRC-16 reference results 3-Jun-1999\n"); + +printf("by Mickey Cohen - mickey@softchip.com\n\n"); +printf("Crc-16 G(x) = x^16 + x^12 + x^5 + 1\n\n"); + +printf("CRC_A of [ "); +for(i=0; i<2; i++) printf("%02X ",BuffCRC_A[i]); +ComputeCrc(CRC_A, BuffCRC_A, 2, &First, &Second); +printf("] Transmitted: %02X then %02X.\n", First, Second); + +printf("CRC_B of [ "); +for(i=0; i<4; i++) printf("%02X ",BuffCRC_B[i]); +ComputeCrc(CRC_B, BuffCRC_B, 4, &First, &Second); +printf("] Transmitted: %02X then %02X.\n", First, Second); + +return(0); +} +/*------------------------------------------------------------*\ + * DZ׼УCRCļdemo. + * + */ + +#endif \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_chk.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_chk.h new file mode 100644 index 0000000..1ff35c2 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_chk.h @@ -0,0 +1,47 @@ +/** + * \file rfid_chk.h + * + * \brief ʵrfidеУ顣 + */ + + +#ifndef _RFID_CHECK_H_ +#define _RFID_CHECK_H_ + +#include "rfid_def.h" +/** + * \function У + * + * \input 룺BYTE bDat: 0/1 + * \ouput + * \return Уֵ01. + */ +int OldParity(BYTE Dat ); + +/** + * CRCУ + * + * \input BYTE aBuf[], + * UINT16 u16Len + * \ouput BYTE *pCRCMSB CRC8bit + * BYTE *pCRCLSB CRC8bit + * \return 1ɹ<0ʧ. + */ + +int ISO14443A_CRC( BYTE aBuf[], UINT16 u16Len,BYTE *pCRCMSB, BYTE *pCRCLSB ); +int ISO14443B_CRC( BYTE aBuf[], UINT16 u16Len,BYTE *pCRCMSB, BYTE *pCRCLSB ); +int ISO15693_CRC( BYTE aBuf[], UINT16 u16Len, BYTE *pCRCMSB, BYTE *pCRCLSB ); + +/** + * ISO14443B + * + * + * ÿֽڣǰ1bit start, 1bit stop1صegt. + * ǵ䣺ȴLSBҪԵ: + */ +// ͬʱҪԵ +int ISO14443B_ByteExp( BYTE byDat ); +// ԭʼֽ +BYTE IOS14443B_UnByteExp( UINT16 u16Dat ); + +#endif diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_com.cpp b/Labs/Lab2/requirements/src/rfidsrc/rfid_com.cpp new file mode 100644 index 0000000..8ed7107 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_com.cpp @@ -0,0 +1,531 @@ +/** + * \file rfid_com.c + * + * \biref rfidͨ + */ + +//#include "stdafx.h" +#include "rfid_com.h" +#include +/** + * 1: ļ + * 彻ļ + * ļʽ + * + * 1B: : 0x50 Reader->Card + * 0x51 Card->Reader + * 1B: reserved + * 2B: ݱس + * . + */ + + +#ifdef _RFID_COM_FILE_ + + #define RFID_COM_FILE_CARD_TO_READER "d:\\rfid\\crwap" + #define RFID_COM_FILE_READER_TO_CARD "d:\\rfid\\rcwap" +#else +#ifdef _OS_WINDOWS_ + #include + + #pragma comment(lib,"Ws2_32.lib ") +#else + #include + #include + #include + #include + #include + #include +#endif + + #define RFID_CARD_UDP_PORT 10101 + #define RFID_READER_UDP_PORT 10201 + + int g_nSendSocketId = -1; + int g_nRecvSocketId = -1; + struct sockaddr_in g_stSendAddr; + struct sockaddr_in g_stRecvAddr; + +#endif + +#define RFID_COM_CARD_LOG_NAME "d:\\rfid\\rfid_card_log.txt" +#define RFID_COM_READER_LOG_NAME "d:\\rfid\\rfid_reader_log.txt" + +// Direction +#define RFID_COM_ID 0x50 +#define RFID_COM_CARD_TX 0 +#define RFID_COM_CARD_RX 1 +#define RFID_COM_READER_TX 2 +#define RFID_COM_READER_RX 3 + +int RFID_COM_LOG( UCHAR ucDirection, UINT16 u16BitLen, UCHAR *pBuf ); + +#ifdef _RFID_COM_FILE_ +char* RFID_COM_GetFileName( UCHAR ucDirection ) +{ + switch( ucDirection ) + { + case RFID_COM_CARD_TX: + case RFID_COM_READER_RX: + return RFID_COM_FILE_CARD_TO_READER; + case RFID_COM_CARD_RX: + case RFID_COM_READER_TX: + return RFID_COM_FILE_READER_TO_CARD; + } + return NULL; +} +#endif + +void RFID_COM_Init( int pcd_or_picc ); +int RFID_COM_Init( int pcd_or_picc, char *pcd_ip_addr, UINT16 u16pcd_rx_port, UINT16 u16picc_rx_port ); + +int RFID_COM_PCD_Init( UINT16 u16pcd_rx_port, UINT16 u16picc_rx_port ) +{ + return RFID_COM_Init( ISO_14443_PCD, NULL, u16pcd_rx_port, u16picc_rx_port ); +} + +int RFID_COM_PICC_Init( char *pcd_ip_addr, UINT16 u16pcd_rx_port, UINT16 u16picc_rx_port ) +{ + return RFID_COM_Init( ISO_14443_PICC, pcd_ip_addr, u16pcd_rx_port, u16picc_rx_port ); +} + + +void RFID_COM_Init( int pcd_or_picc ) +{ +#ifdef _RFID_COM_FILE_ + if( pcd_or_picc == ISO_14443_PCD ) + { + char *szFileName; + szFileName = RFID_COM_GetFileName( RFID_COM_READER_TX ); + if( access( szFileName, 0) == 0 ) + { + unlink( szFileName ); + } + + szFileName = RFID_COM_GetFileName( RFID_COM_READER_RX ); + if( access( szFileName, 0) == 0 ) + { + unlink( szFileName ); + } + } +#else + char str[20]; + struct timeval timeout = {0,200000}; // 200ms. + + g_nSendSocketId = socket( AF_INET, SOCK_DGRAM, 0 ); + g_nRecvSocketId = socket( AF_INET, SOCK_DGRAM, 0 ); + + sprintf_s( str, "127.0.0.1"); +// bzero( &g_stSendAddr, sizeof( g_stSendAddr )); + memset( &g_stSendAddr, sizeof( g_stSendAddr ), 0x00); + g_stSendAddr.sin_family = AF_INET; + g_stSendAddr.sin_addr.s_addr = inet_addr( str ); + +// bzero( &g_stRecvAddr, sizeof( g_stRecvAddr )); + memset( &g_stRecvAddr, sizeof( g_stRecvAddr ),0x00); + g_stRecvAddr.sin_family = AF_INET; + g_stRecvAddr.sin_addr.s_addr = htonl( INADDR_ANY ); + + if( pcd_or_picc == ISO_14443_PCD ) + { + g_stSendAddr.sin_port = htons(RFID_CARD_UDP_PORT); + g_stRecvAddr.sin_port = htons(RFID_READER_UDP_PORT); + } + else + { + g_stSendAddr.sin_port = htons(RFID_READER_UDP_PORT); + g_stRecvAddr.sin_port = htons(RFID_CARD_UDP_PORT); + } + bind( g_nRecvSocketId, (struct sockaddr *)&g_stRecvAddr, sizeof( g_stRecvAddr )); + setsockopt( g_nRecvSocketId, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,sizeof(struct timeval)); + +#endif +} + +void RFID_COM_Close() +{ + if( g_nSendSocketId != -1 ) + { +// _close( g_nSendSocketId ); + closesocket( g_nSendSocketId ); + g_nSendSocketId = -1; + } + + if( g_nRecvSocketId != -1 ) + { +// _close( g_nRecvSocketId ); + closesocket( g_nRecvSocketId ); + g_nRecvSocketId = -1; + } + WSACleanup(); +} + +// PCDù㲥ʽ +int RFID_COM_Init( int pcd_or_picc, char *pcd_ip_addr, UINT16 u16pcd_rx_port, UINT16 u16picc_rx_port ) +{ + // ԱtimeoutΪ0.n룬500msʱûãΪblock. + struct timeval timeout = {1,0}; // 1s. + + // Ѿʼ + if( g_nSendSocketId != -1 ) + { + return 0; + } + +#if 1 + WSADATA wsa; + if (WSAStartup(MAKEWORD(2,2),&wsa) != 0) + { + return -1; + } +#endif + + g_nSendSocketId = socket( AF_INET, SOCK_DGRAM, 0 ); + if( g_nSendSocketId < 0 ) + { + return -1; + } + // ÷ͷ + memset( &g_stSendAddr, sizeof( g_stSendAddr ), 0x00); + g_stSendAddr.sin_family = AF_INET; + + if( pcd_or_picc == ISO_14443_PCD ) + { + int opt=-1; + int nb = setsockopt(g_nSendSocketId,SOL_SOCKET,SO_BROADCAST,(char*)&opt,sizeof(opt)); + if( nb == -1) + { + return -2; // ʧ; + } + //׽ֵַΪ㲥ַ + g_stSendAddr.sin_addr.s_addr=htonl(INADDR_BROADCAST); + // +// g_stSendAddr.sin_addr.s_addr = inet_addr( "255.255.255.255" ); + + g_stSendAddr.sin_port = htons(u16picc_rx_port); + } + else + { + g_stSendAddr.sin_addr.s_addr = inet_addr( pcd_ip_addr ); + g_stSendAddr.sin_port = htons(u16pcd_rx_port); + } + + // ýշ + g_nRecvSocketId = socket( AF_INET, SOCK_DGRAM, 0 ); + if( g_nRecvSocketId < 0 ) + { + return -1; + } + if( pcd_or_picc != ISO_14443_PCD ) + { + int opt=-1; + int nb=setsockopt(g_nRecvSocketId,SOL_SOCKET,SO_BROADCAST,(char*)&opt,sizeof(opt)); + if( nb == -1 ) + { + return -2; + } + } + memset( &g_stRecvAddr, sizeof( g_stRecvAddr ),0x00); + g_stRecvAddr.sin_family = AF_INET; + g_stRecvAddr.sin_addr.s_addr = htonl( INADDR_ANY ); + + if( pcd_or_picc == ISO_14443_PCD ) + { + g_stRecvAddr.sin_port = htons(u16pcd_rx_port); + } + else + { + g_stRecvAddr.sin_port = htons(u16picc_rx_port); + } + bind( g_nRecvSocketId, (struct sockaddr *)&g_stRecvAddr, sizeof( g_stRecvAddr )); + if( setsockopt( g_nRecvSocketId, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,sizeof(struct timeval))) + { + return -2; + } +} + + +int RFID_COM_Tx( UCHAR ucDirection, UINT16 u16BitLen, UCHAR *pBuf ) +{ +#ifdef _RFID_COM_FILE_ + FILE *fp; + UCHAR aucBuf[4]={0x00}; + char *szFileName; + + szFileName = RFID_COM_GetFileName( ucDirection ); + // 2016/11/23 + // ļѾڣ˵Էûжȡȴ. + while(1) + { + if( access( szFileName, 0) == -1 ) + { + break; + } + // access: 0ʾڣ-1ʾ. + { + int i, k=0; + for( i = 0; i < 200000; i++ ) + { + k++; + } + } + } + + fp = fopen( szFileName, "wb" ); + if( !fp ) + { + return -1; + } + aucBuf[0] = RFID_COM_ID; + *(UINT16 *)&aucBuf[2] = u16BitLen; + + fwrite( aucBuf, 1, 4, fp ); + if( u16BitLen % 8 ) + { + fwrite( pBuf, 1, u16BitLen/8+1, fp ); + } + else + { + fwrite( pBuf, 1, u16BitLen/8, fp ); + } + fclose( fp ); + + RFID_COM_LOG( ucDirection, u16BitLen, pBuf ); + + return u16BitLen; +#else + UINT16 u16BufLen; + char aucBuf[200]; + + u16BufLen = u16BitLen/8; + if( u16BitLen % 8 ) + { + u16BufLen++; + } + + if( g_nSendSocketId != -1 ) + { +#ifdef _RFID_DEBUG_ + int i; + printf("\nTxLen = %d, bitLen = %d ", u16BufLen, u16BitLen ); + for( i = 0; i < u16BufLen; i++ ) + { + printf("0x%02x ", pBuf[i]); + } +#endif + aucBuf[0] = RFID_COM_ID; + *(UINT16 *)&aucBuf[2] = u16BitLen; + memcpy( aucBuf+4, pBuf, u16BufLen ); + + return sendto( g_nSendSocketId, aucBuf, u16BufLen+4, + 0, (struct sockaddr *)&g_stSendAddr, sizeof( g_stSendAddr )); + } + else + { + return 0; + } +#endif +} + +int RFID_COM_Rx( UCHAR ucDirection, UINT16 u16ByteLen, UCHAR *pBuf, int block ) +{ +#ifdef _RFID_COM_FILE_ + FILE *fp; + UCHAR aucBuf[4]={0x00}; + UINT16 u16BitLen; + char *szFileName; + + szFileName = RFID_COM_GetFileName( ucDirection ); + + // 2016/11/23 + // ļѾڣ˵Էûжȡȴ. + while(1) + { + // access: 0ʾڣ-1ʾ. + if( access( szFileName, 0) == 0 ) + { + break; + } + if( block == 0) + { + // . + return 0; + } + + // ȴȻ + { + int i, k=0; + for( i = 0; i < 200000; i++ ) + { + k++; + } + } + } + + // ڣļݻûд룬Եȴһᣬȷд롣 + { + int i, k=0; + for( i = 0; i < 150000; i++ ) + { + k++; + } + } + + + fp = fopen( szFileName, "rb" ); + if( !fp ) + { + return 0; + } + fread( aucBuf, 1, 4, fp ); + if( aucBuf[0] != RFID_COM_ID ) + { + fclose( fp ); + return 0; + } + u16BitLen = *(UINT16 *)&aucBuf[2]; + + if( u16BitLen % 8 ) + { + fread( pBuf, 1, u16BitLen/8+1, fp ); + } + else + { + fread( pBuf, 1, u16BitLen/8, fp ); + } + // ļļûԶռʽ + fclose( fp ); + + remove( szFileName ); + + RFID_COM_LOG( ucDirection, u16BitLen, pBuf ); + return u16BitLen; +#else + char aucBuf[200]; + int sin_len; + int n, k, i; + + if( g_nRecvSocketId != -1 ) + { + n = recv( g_nRecvSocketId, aucBuf, 200, 0 ); + if( n > 0 ) + { + k = *(UINT16 *)&aucBuf[2]; +#ifdef _RFID_DEBUG_ + printf("\nrx dat, len = %d, bitlen = %d.", n, k); + for( i = 0; i < n; i++ ) + { + printf("0x%02x ", aucBuf[i]); + } +#endif + memcpy( pBuf, aucBuf+4, n-4 ); + return k; + } + else + { +#ifdef _RFID_DEBUG_ + printf("\nrx: %d, error = %d", n, errno); +#endif + return 0; + } + } + else + { + return 0; + } +#endif +} + +int RFID_COM_LOG( UCHAR ucDirection, UINT16 u16BitLen, UCHAR *pBuf ) +{ +#ifdef _RFID_COM_FILE_ + FILE *fp; + int i; + char *szBuf[] = {"CardTx", "CardRx", "ReaderTx", "ReaderRx"}; + char *szFileName = NULL; + + if( ucDirection == RFID_COM_CARD_TX || ucDirection == RFID_COM_CARD_RX ) + { + szFileName = RFID_COM_CARD_LOG_NAME; + } + else + { + szFileName = RFID_COM_READER_LOG_NAME; + } + fp = fopen( szFileName, "a+" ); + if( !fp ) + { + fp = fopen( szFileName, "w" ); + } + fprintf(fp, "\n\n--%10s bitlen=%3d: \n-- ", szBuf[ucDirection], u16BitLen ); +#ifdef _RFID_DEBUG_ + printf("\n--%10s bitlen=%3d:\n-- ", szBuf[ucDirection], u16BitLen ); +#endif + for( i = 0; i < u16BitLen; i+=8 ) + { + fprintf( fp, "%02x ", *pBuf ); +#ifdef _RFID_DEBUG_ + printf("%02x ", *pBuf ); +#endif + pBuf++; + } + fclose( fp ); +#endif + return 1; +} + +/** + * ݣ + */ +int RFID_Card_Tx( UINT16 u16BitLen, UCHAR *pBuf ) +{ + return RFID_COM_Tx( RFID_COM_CARD_TX, u16BitLen, pBuf ); +} + +/** + * . + * + * ֵΪ + * >0ʵյݵıس; + * =0, ûյ; + */ +int RFID_Card_Rx( UINT16 u16ByteLen, UCHAR *pBuf ) +{ + return RFID_COM_Rx( RFID_COM_CARD_RX, u16ByteLen, pBuf, 1 ); // wait +} + +/** + * ݣ + */ +bool g_bStep = false; +int g_nStep = -1; +int RFID_Reader_Tx( UINT16 u16BitLen, UCHAR *pBuf ) +{ + static int step = 0; + + if( !g_bStep ) + { + return RFID_COM_Tx( RFID_COM_READER_TX, u16BitLen, pBuf ); + } + else + { + while( step != g_nStep ) + { + Sleep( 1000 ); + } + step++; + return RFID_COM_Tx( RFID_COM_READER_TX, u16BitLen, pBuf ); + } +} + +/** + * . + * + * ֵΪ + * >0ʵյݵıس; + * =0, ûյ; + */ +int RFID_Reader_Rx( UINT16 u16ByteLen, UCHAR *pBuf ) +{ + return RFID_COM_Rx( RFID_COM_READER_RX, u16ByteLen, pBuf, 0 ); // +} \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_com.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_com.h new file mode 100644 index 0000000..32994fc --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_com.h @@ -0,0 +1,52 @@ +/** + * \file RFID_com.h + * + * \brief RFIDϵͳУ/շ. + * + */ +#ifndef _RFID_COM_H_ +#define _RFID_COM_H_ + +#include "rfid_def.h" + +// udpͨѶ +// pcd->picc򣬹㲥/鲥ipַ޹أ +// picc->pcd򣬵Ժӿڶpcdipַ +// Ȳù㲥԰ + +int RFID_COM_PCD_Init( UINT16 u16pcd_rx_port, UINT16 u16picc_rx_port ); +int RFID_COM_PICC_Init( char *pcd_ip_addr, UINT16 u16pcd_rx_port, UINT16 u16picc_rx_port ); +void RFID_COM_Close(); +/** + * ݣ + * 鲥㲥; + */ +int RFID_Card_Tx( UINT16 u16BitLen, UCHAR *pBuf ); + +/** + * . + * + * ֵΪ + * >0ʵյݵıس; + * =0, ûյ; + */ +int RFID_Card_Rx( UINT16 u16ByteLen, UCHAR *pBuf ); + +/** + * ݣ + * + */ +int RFID_Reader_Tx( UINT16 u16BitLen, UCHAR *pBuf ); + +/** + * . + * + * ֵΪ + * >0ʵյݵıس; + * =0, ûյ; + */ +int RFID_Reader_Rx( UINT16 u16ByteLen, UCHAR *pBuf ); + +#endif + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_def.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_def.h new file mode 100644 index 0000000..1379277 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_def.h @@ -0,0 +1,225 @@ +/** + * \file rfid_def.h + * + * \brief 头文件定义 + */ +#ifndef _RFID_DEF_H_ +#define _RFID_DEF_H_ + +#define _OS_WINDOWS_ + +#include +#include +#include + +//#define _RFID_DEBUG_ + +#ifdef _OS_WINDOWS_ +// #define _RFID_COM_FILE_ + #define PCD_WAIT_TIME 2 +#else + #define PCD_WAIT_TIME 1 +#endif + +typedef unsigned char byte; +typedef unsigned char BYTE; +typedef unsigned char UCHAR; +typedef unsigned short UINT16; +typedef unsigned long ULONG; +//typedef unsigned long UINT32; +typedef unsigned short USHORT; +typedef int BOOL; +#define TRUE 1 +#define FALSE 0 + +/** + * 系统最多仿10个 PICC. + */ + +#define MAX_PICC_NUM 10 + +/** + * 下列宏定义,表示PCD使用broad方式向PICC发送命令 + * PICC需要加入组播组接收数据 + */ +#define PCD_TO_PICC_USE_BROAD + + +/*-----------------------------------------------------------------*\ + * 定义ISO14443A命令和状态 + * + * + *-----------------------------------------------------------------*/ +// 实际上不存在 +#define ISO_14443A_STATE_POWEROFF 0xA0 +// 系统启动,就处于IDLE状态,相当于已经加电. +#define ISO_14443A_STATE_IDLE 0xA1 +#define ISO_14443A_STATE_READY 0xA2 +#define ISO_14443A_STATE_ACTIVE 0xA3 +#define ISO_14443A_STATE_HALT 0xA4 + +// 定义PCD的状态机 +#define ISO_14443A_PCD_STATE_BEGIN 0xA8 +#define ISO_14443A_PCD_STATE_START 0xA9 // 开始。如果没有收到,继续发送REQA +#define ISO_14443A_PCD_STATE_ANTI 0xAA // 收到ATQA,转入READY.开始防冲突循环? +#define ISO_14443A_PCD_STATE_SELECT 0xAB // 收到SAK. + +#define ISO_14443A_PCD_STATE_OK 0xAC // PCD识别出一张卡 +#define ISO_14443A_PCD_STATE_ER 0xAD // PCD识别卡过程中,错误 + + +#define ISO_14443_CMD_REQA 0x26 +#define ISO_14443_CMD_WUPA 0x52 +#define ISO_14443_CMD_SEL_CL1 0x93 +#define ISO_14443_CMD_SEL_CL2 0x95 +#define ISO_14443_CMD_SEL_CL3 0x97 +#define ISO_14443_CMD_HALT 0x50 + +#define ISO_14443_PCD 0xF0 +#define ISO_14443_PICC 0xF1 + +// ISO14443A没有定义,自己定义 +#define ISO_14443_CMD_SAK 0xC0 +#define ISO_14443_CMD_ATQA 0xC1 +#define ISO_14443_CMD_SEL_CLx 0xC2 // PICC->PCD防碰撞帧 + +int picc_main( int argc, char *argv[] ); +int pcd_main( int numofpicc ); + + /*-----------------------------------------------------------------*\ + * VSPR中,采用UDP协议仿真空口通讯。 + * 其中数据格式如下: + * 1B: Header, 取值为:0x50 + * 1B: direction, + * 1B: command/response + * 1B: reserved, 0x00 + * 4B: bit length of payload + * xx: payload + *-----------------------------------------------------------------*/ + typedef struct tag_HeaderOfVSPRCOM + { + UCHAR ucHeaderMark; + UCHAR ucDirection; + UCHAR ucCmd; + UCHAR ucRsvd; + int nBitLen; + }HeaderOfVSPRCOM; + + /*-----------------------------------------------------------------*\ + * Header + *-----------------------------------------------------------------*/ + #define VSPR_HEADER_MARK 0x50 + + /*-----------------------------------------------------------------*\ + * direction + *-----------------------------------------------------------------*/ + #define DIRECTION_UNDEFINED 0xFF + + #define DIRECTION_PCD_TO_PICC 0x51 + #define DIRECTION_PICC_FROM_PCD 0x51 + #define DIRECTION_PICC_TO_PCD 0x52 + #define DIRECTION_PCD_FROM_PICC 0x52 + + #define DIRECTION_VSPR_TO_USP 0x61 + #define DIRECTION_USP_FROM_VSPR 0x61 + #define DIRECTION_USP_TO_VSPR 0x62 + #define DIRECTION_VSPR_FROM_USP 0x62 + + #define HOST_VSPR DIRECTION_VSPR_TO_USP + #define HOST_USP DIRECTION_USP_TO_VSPR + #define HOST_PCD DIRECTION_PCD_TO_PICC + #define HOST_PICC DIRECTION_PICC_TO_PCD + + /*-----------------------------------------------------------------*\ + * command/reponse + *-----------------------------------------------------------------*/ + #define VSPR_CMD_UNSED 0x00 + + /** + * 编码:code + */ + #define VSPR_CMD_CODE_1BIT_REQ 0x01 + #define VSPR_CMD_CODE_1BIT_RSP 0x81 + #define VSPR_CMD_CODE_SOF_REQ 0x02 + #define VSPR_CMD_CODE_SOF_RSP 0x82 + #define VSPR_CMD_CODE_EOF_REQ 0x03 + #define VSPR_CMD_CODE_EOF_RSP 0x83 + #define VSPR_CMD_CODE_FRAME_REQ 0x04 + #define VSPR_CMD_CODE_FRAME_RSP 0x84 + /** + * 解码:code + */ + #define VSPR_CMD_DECODE_1BIT_REQ 0x08 + #define VSPR_CMD_DECODE_1BIT_RSP 0x88 + #define VSPR_CMD_DECODE_SOF_REQ 0x09 + #define VSPR_CMD_DECODE_SOF_RSP 0x89 + #define VSPR_CMD_DECODE_EOF_REQ 0x0A + #define VSPR_CMD_DECODE_EOF_RSP 0x8A + #define VSPR_CMD_DECODE_FRAME_REQ 0x0B + #define VSPR_CMD_DECODE_FRAME_RSP 0x8B + + /** + * 教验 + */ + #define VSPR_CMD_ODD_PARITY_REQ 0x10 + #define VSPR_CMD_ODD_PARITY_RSP 0x90 + #define VSPR_CMD_CRC16_REQ 0x11 + #define VSPR_CMD_CRC16_RSP 0x91 + + /** + * 成帧 + */ + #define VSPR_CMD_FRAME_SHORT_REQ 0x20 + #define VSPR_CMD_FRAME_SHORT_RSP 0xA0 + #define VSPR_CMD_FRAME_STD_REQ 0x21 + #define VSPR_CMD_FRAME_STD_RSP 0xA1 + #define VSPR_CMD_FRAME_ANTICOLISSION_REQ 0x22 + #define VSPR_CMD_FRAME_ANTICOLISSION_RSP 0xA2 + /** + * 解帧 + */ + #define VSPR_CMD_UNFRAME_SHORT_REQ 0x28 + #define VSPR_CMD_UNFRAME_SHORT_RSP 0xA8 + #define VSPR_CMD_UNFRAME_STD_REQ 0x29 + #define VSPR_CMD_UNFRAME_STD_RSP 0xA9 + #define VSPR_CMD_UNFRAME_ANTICOLISSION_REQ 0x2A + #define VSPR_CMD_UNFRAME_ANTICOLISSION_RSP 0xAA + + /** + * 命令 + */ + #define VSPR_CMD_REQA_REQ 0x30 + #define VSPR_CMD_REQA_RSP 0xB0 + #define VSPR_CMD_ATRQ_REQ 0x31 + #define VSPR_CMD_ATRQ_RSP 0xB1 + #define VSPR_CMD_ANTICOLLISIONREQ_REQ 0x32 + #define VSPR_CMD_ANTICOLLISIONREQ_RSP 0xB2 + #define VSPR_CMD_ANTICOLLISIONRSP_REQ 0x33 + #define VSPR_CMD_ANTICOLLISIONRSP_RSP 0xB3 + #define VSPR_CMD_SELECT_REQ 0x34 + #define VSPR_CMD_SELECT_RSP 0xB4 + #define VSPR_CMD_SAK_REQ 0x35 + #define VSPR_CMD_SAK_RSP 0xB5 + #define VSPR_CMD_WUPA_REQ 0x36 + #define VSPR_CMD_WUPA_RSP 0xB6 + #define VSPR_CMD_HALT_REQ 0x37 + #define VSPR_CMD_HALT_RSP 0xB7 + + #define VSPR_CMD_UREQA_REQ 0x38 + #define VSPR_CMD_UREQA_RSP 0xB8 + #define VSPR_CMD_UATRQ_REQ 0x39 + #define VSPR_CMD_UATRQ_RSP 0xB9 + #define VSPR_CMD_UANTICOLLISIONREQ_REQ 0x3A + #define VSPR_CMD_UANTICOLLISIONREQ_RSP 0xBA + #define VSPR_CMD_UANTICOLLISIONRSP_REQ 0x3B + #define VSPR_CMD_UANTICOLLISIONRSP_RSP 0xBB + #define VSPR_CMD_USELECT_REQ 0x3C + #define VSPR_CMD_USELECT_RSP 0xBC + #define VSPR_CMD_USAK_REQ 0x3D + #define VSPR_CMD_USAK_RSP 0xBD + #define VSPR_CMD_UWUPA_REQ 0x3E + #define VSPR_CMD_UWUPA_RSP 0xBE + #define VSPR_CMD_UHALT_REQ 0x3F + #define VSPR_CMD_UHALT_RSP 0xBF + +#endif \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_def.h.bak b/Labs/Lab2/requirements/src/rfidsrc/rfid_def.h.bak new file mode 100644 index 0000000..3d4e973 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_def.h.bak @@ -0,0 +1,81 @@ +/** + * \file rfid_def.h + * + * \brief 头文件定义 + */ +#ifndef _RFID_DEF_H_ +#define _RFID_DEF_H_ + +//#include "stdafx.h" +#include +#include +#include + +//#define _RFID_DEBUG_ + +//#define _OS_WINDOWS_ + +#ifdef _OS_WINDOWS_ + #define _RFID_COM_FILE_ + #define PCD_WAIT_TIME 25 +#else + #define PCD_WAIT_TIME 1 +#endif + +typedef unsigned char BYTE; +typedef unsigned char UCHAR; +typedef unsigned short UINT16; +typedef unsigned long ULONG; +typedef unsigned long UINT32; +typedef unsigned short USHORT; +typedef unsigned int BOOL; +#define TRUE 1 +#define FALSE 0 + +/** + * 系统最多仿10个 PICC. + */ + +#define MAX_PICC_NUM 10 + +/** + * 下列宏定义,表示PCD使用broad方式向PICC发送命令 + * PICC需要加入组播组接收数据 + */ +#define PCD_TO_PICC_USE_BROAD + + +/*-----------------------------------------------------------------*\ + * 定义ISO14443A命令和状态 + * + * + *-----------------------------------------------------------------*/ +// 实际上不存在 +#define ISO_14443A_STATE_POWEROFF 0xA0 +// 系统启动,就处于IDLE状态,相当于已经加电. +#define ISO_14443A_STATE_IDLE 0xA1 +#define ISO_14443A_STATE_READY 0xA2 +#define ISO_14443A_STATE_ACTIVE 0xA3 +#define ISO_14443A_STATE_HALT 0xA4 + +// 定义PCD的状态机 +#define ISO_14443A_PCD_STATE_OK 0xA8 // PCD识别出一张卡 +#define ISO_14443A_PCD_STATE_ER 0xA9 // PCD识别卡过程中,错误 + +#define ISO_14443A_PCD_STATE_START 0xAA // 开始。如果没有收到,继续发送REQA +#define ISO_14443A_PCD_STATE_ANTI 0xAB // 收到ATQA,转入READY.开始防冲突循环? +#define ISO_14443A_PCD_STATE_SELECT 0xAC // 收到SAK. + + +#define ISO_14443_CMD_REQA 0x26 +#define ISO_14443_CMD_WUPA 0x52 +#define ISO_14443_CMD_SEL_CL1 0x93 +#define ISO_14443_CMD_SEL_CL2 0x95 +#define ISO_14443_CMD_SEL_CL3 0x97 +#define ISO_14443_CMD_HALT 0x50 + +#define ISO_14443_PCD 0xF0 +#define ISO_14443_PICC 0xF1 + +#endif + diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdrx.cpp b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdrx.cpp new file mode 100644 index 0000000..7c7ab9d --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdrx.cpp @@ -0,0 +1,270 @@ +/** + * \file rfid_iso14443A_cmdrx.c + * + * \brief ISO14443A. + * + * ֱPCD/PICCշõĸ + * + * ͬ״̬£ҪȴͬԿǵȴĸ + */ +//#include "stdafx.h" +#include "rfid_iso14443A_codec.h" +#include "rfid_iso14443A_frm.h" + +#include "rfid_iso14443A_cmdrx.h" +/** + * + * PICC ȴREQA + */ +int ISO14443A_wait_ShortFrame( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *pbyCmd ) +{ + BYTE abyFrmBuf[100]; + UINT16 u16FrmBitLen; + + // REQAı볤ȷΪ: SOF(4)+CMD(28)+EOF(4) = 36 + if( u16BufBitLen != 36 ) + { + return -1; + } + + // ֡ + if( ISO14443A_PICC_Decode( abyRxBuf, u16BufBitLen, abyFrmBuf, &u16FrmBitLen) < 0) + { + return -1; + } + + // ֡ + if( ISO14443A_Un_ShortFraming( abyFrmBuf, u16FrmBitLen, pbyCmd ) < 0 ) + { + return -1; + } + return 1; +} + +int ISO14443A_wait_REQA( BYTE abyRxBuf[], UINT16 u16BufBitLen ) +{ // + BYTE byCmd; + + if( ISO14443A_wait_ShortFrame( abyRxBuf, u16BufBitLen, &byCmd ) < 0 ) + { + return -1; + } + + return byCmd == ISO_14443_CMD_REQA ? 1:-1; +} + + +int ISO14443A_wait_WUPA( BYTE abyRxBuf[], UINT16 u16BufBitLen ) +{ // + BYTE byCmd; + + if( ISO14443A_wait_ShortFrame( abyRxBuf, u16BufBitLen, &byCmd ) < 0 ) + { + return -1; + } + + return byCmd == ISO_14443_CMD_WUPA ? 1:-1; +} + +// PCD/PICCյ׼֡ +// +int ISO14443A_wait_stdFrame( BOOL bPCD, UINT16 u16HopeCmdLen, + BYTE abyRxBuf[], UINT16 u16BufBitLen, + BYTE abyCmdBuf[], UINT16 *pu16CmdBitLen ) +{ + BYTE abyFrmBuf[100]; + UINT16 u16FrmBitLen; + int r; + int k; + + // ׼֡ijȣ(( cmdlen + 2(crc)) * 9(parity) + sof(1) + eof(1)) * 4 + k = (( u16HopeCmdLen + 2 ) * 9 + 2 ) * ISO14443A_BIT_CODEC_LEN; + + // REQAı볤ȷΪ: SOF(4)+CMD(28)+EOF(4) = 36 + if( u16BufBitLen != k ) + { + return -1; + } + + // + if( bPCD ) + { + r = ISO14443A_PCD_Decode( abyRxBuf, u16BufBitLen, abyFrmBuf, &u16FrmBitLen ); + } + else + { + r = ISO14443A_PICC_Decode( abyRxBuf, u16BufBitLen, abyFrmBuf, &u16FrmBitLen ); + } + + + if( r < 0) + { + return -1; + } + + // ֡ + if( ISO14443A_Un_stdFraming( abyFrmBuf, u16FrmBitLen, abyCmdBuf, pu16CmdBitLen ) < 0 ) + { + return -1; + } + + return *pu16CmdBitLen; +} + +// صԶ4ֽڳȵUID. +int ISO14443A_wait_SELECT( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *psel, BYTE abyUID[] ) +{ + BYTE abyCmdBuf[100], byBCC; + UINT16 u16CmdBitLen; + int i; + + if( ISO14443A_wait_stdFrame( false, 7, abyRxBuf, u16BufBitLen, abyCmdBuf, &u16CmdBitLen ) < 0 ) + { + return -1; + } + + // ɹ. + if( abyCmdBuf[0] != ISO_14443_CMD_SEL_CL1 + && abyCmdBuf[0] != ISO_14443_CMD_SEL_CL2 + && abyCmdBuf[0] != ISO_14443_CMD_SEL_CL3 + ) + { + return -1; + } + + // NVB + if( abyCmdBuf[1] != 0x70 ) + { + return -1; + } + + // BCC. + byBCC = 0x00; + for( i = 2; i < 6; i++ ) + { + byBCC = byBCC ^ abyCmdBuf[i]; + } + if( byBCC != abyCmdBuf[6] ) + { + return -1; + } + + *psel = abyCmdBuf[0]; + memcpy( abyUID, &abyCmdBuf[2], 4 ); + + return 1; +} + +int ISO14443A_wait_HALT( BYTE abyRxBuf[], UINT16 u16BufBitLen ) +{ + BYTE abyCmdBuf[100]; + UINT16 u16CmdBitLen; + + if( ISO14443A_wait_stdFrame( false, 2, abyRxBuf, u16BufBitLen, abyCmdBuf, &u16CmdBitLen ) < 0 ) + { + return -1; + } + + if( abyCmdBuf[0] != 0x50 || abyCmdBuf[1] != 0x00 ) + { + return -1; + } + + return 1; +} + +int ISO14443A_wait_SAK( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *pByCmd ) +{ + BYTE abyCmdBuf[100]; + UINT16 u16CmdBitLen; + + if( ISO14443A_wait_stdFrame( true, 1, abyRxBuf, u16BufBitLen, abyCmdBuf, &u16CmdBitLen ) < 0 ) + { + return -1; + } + + *pByCmd = abyCmdBuf[0]; + + return 1; +} + +int ISO14443A_wait_ATQA( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *pByCLn, BYTE aByCmd[] ) +{ + BYTE abyCmdBuf[100]; + UINT16 u16CmdBitLen; + + if( ISO14443A_wait_stdFrame( true, 2, abyRxBuf, u16BufBitLen, abyCmdBuf, &u16CmdBitLen ) < 0 ) + { + return -1; + } + + if( aByCmd ) + { + aByCmd[0] = abyCmdBuf[0]; + aByCmd[1] = abyCmdBuf[1]; + } + + *pByCLn = ( abyCmdBuf[1] >> 6 ) & 0x03; + + return 1; +} + +// ײ֡. +int ISO14443A_wait_anticollisionFrame( + BOOL bPCD, + BYTE byFirstByteLen, BYTE *pFirstByte, + BYTE abyRxBuf[], UINT16 u16BufBitLen, + BYTE abyCmdBuf[], UINT16 *pu16CmdBitLen ) +{ + BYTE abyFrmBuf[100]; + UINT16 u16FrmBitLen; + int r; + + // + if( bPCD ) + { + r = ISO14443A_PCD_Decode( abyRxBuf, u16BufBitLen, abyFrmBuf, &u16FrmBitLen ); + } + else + { + r = ISO14443A_PICC_Decode( abyRxBuf, u16BufBitLen, abyFrmBuf, &u16FrmBitLen ); + } + + + if( r < 0) + { + return -1; + } + + // ֡ + if( ISO14443A_Un_AnticollisionFraming( byFirstByteLen, pFirstByte, + abyFrmBuf, u16FrmBitLen, abyCmdBuf, pu16CmdBitLen ) < 0 ) + { + return -1; + } + + return *pu16CmdBitLen; +} + +// req: PICC˵ȴ +int ISO14443A_wait_anticollisionFrame_req( + BYTE abyRxBuf[], UINT16 u16BufBitLen, + BYTE abyCmdBuf[], UINT16 *pu16CmdBitLen ) +{ + return ISO14443A_wait_anticollisionFrame( false, 0, NULL, + abyRxBuf, u16BufBitLen, + abyCmdBuf, pu16CmdBitLen ); +} + +// rsp: PCDȴ +int ISO14443A_wait_anticollisionFrame_rsp( + BYTE byFirstByteLen, BYTE *pFirstByte, + BYTE abyRxBuf[], UINT16 u16BufBitLen, + BYTE abyCmdBuf[], UINT16 *pu16CmdBitLen ) +{ + return ISO14443A_wait_anticollisionFrame( true, byFirstByteLen, pFirstByte, + abyRxBuf, u16BufBitLen, + abyCmdBuf, pu16CmdBitLen ); +} + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdrx.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdrx.h new file mode 100644 index 0000000..40265fa --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdrx.h @@ -0,0 +1,48 @@ +/** + * \file rfid_iso14443A_cmdrx.h + * + * \brief ISO14443A. + * + * ֱPCD/PICCշõĸ + * + * ͬ״̬£ҪȴͬԿǵȴĸ + */ + +#ifndef _RFID_ISO14443A_CMDRX_H_ +#define _RFID_ISO14443A_CMDRX_H_ + +#include "rfid_def.h" +#include "rfid_iso14443A_codec.h" +#include "rfid_iso14443A_frm.h" +#include "rfid_com.h" + +//PCD +int ISO14443A_wait_ATQA( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *pByCLn ); +int ISO14443A_wait_ATQA( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *pByCLn, BYTE aByCmd[2] ); +int ISO14443A_wait_SAK( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *pbyCmd ); +int ISO14443A_wait_anticollisionFrame_rsp( + BYTE byFirstByteLen, BYTE *pFirstByte, + BYTE abyRxBuf[], UINT16 u16BufBitLen, + BYTE abyCmdBuf[], UINT16 *pu16CmdBitLen ); + +//PICC +int ISO14443A_wait_REQA( BYTE abyRxBuf[], UINT16 u16BufBitLen ); +int ISO14443A_wait_WUPA( BYTE abyRxBuf[], UINT16 u16BufBitLen ); +int ISO14443A_wait_SELECT( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *psel, BYTE abyUID[] ); +int ISO14443A_wait_HALT( BYTE abyRxBuf[], UINT16 u16BufBitLen ); +int ISO14443A_wait_anticollisionFrame_req( + BYTE abyRxBuf[], UINT16 u16BufBitLen, + BYTE abyCmdBuf[], UINT16 *pu16CmdBitLen ); + +// +int ISO14443A_wait_ShortFrame( BYTE abyRxBuf[], UINT16 u16BufBitLen, BYTE *pbyCmd ); +int ISO14443A_wait_stdFrame( BOOL bPCD, UINT16 u16HopeCmdLen, + BYTE abyRxBuf[], UINT16 u16BufBitLen, + BYTE abyCmdBuf[], UINT16 *pu16CmdBitLen ); +int ISO14443A_wait_anticollisionFrame( + BOOL bPCD, + BYTE byFirstByteLen, BYTE *pFirstByte, + BYTE abyRxBuf[], UINT16 u16BufBitLen, + BYTE abyCmdBuf[], UINT16 *pu16CmdBitLen ); + +#endif diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdtx.cpp b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdtx.cpp new file mode 100644 index 0000000..2857248 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdtx.cpp @@ -0,0 +1,335 @@ +/** + * \file rfid_iso14443A_cmdtx.c + * + * \brief ISO14443A. + * + */ + +/*-------------------------------------------------------------*\ + * ISO14443A + * 1. ֡REQA(PCD) & WUPA(PCD) + * 2. ׼֡SELECT(PCD), HALT(PCD), ATQA(PICC), SAK(PICC) + * 3. ײ֡ANTICOLLISION_req(PCD)/rsp(PICC) + *-------------------------------------------------------------*/ + +#include "rfid_iso14443A_cmdtx.h" +#include "memory.h" +#include "picc_thread.h" +#include "pcd_thread.h" + +/*--------------------------------------------------------------*\ + * ֡ +\*---------------------------------------------------------------*/ +/** + * \fun ISO14443A_REQA_req() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_REQA() +{ + /** + * REQA + * 7bitֵ֡0x26. + */ + { + UCHAR cmd; + cmd = ISO_14443_CMD_REQA; + pcd_postMessage( &cmd, 7, ISO_14443_CMD_REQA, "wait ATRQ" ); + } + return ISO14443A_ShortFrame_req( ISO_14443_CMD_REQA ); +} + +/** + * \fun ISO14443A_WUPA_req() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_WUPA() +{ + /** + * WUPA + * 7bitֵ֡0x52. + */ + { + UCHAR cmd; + cmd = ISO_14443_CMD_WUPA; + pcd_postMessage( &cmd, 7, ISO_14443_CMD_WUPA, "wait ATRQ" ); + } + + return ISO14443A_ShortFrame_req( ISO_14443_CMD_WUPA ); +} + +// ֡ +// 롢֡͡ +// PCD/PICC˶ͬ +int ISO14443A_ShortFrame_req( BYTE byCmd ) +{ + BYTE abyTxBuf[100], abyFrmBuf[100]; + UINT16 u16CodedLen,u16FrmLen; + + /** + * 1. ֡ + */ + if( ISO14443A_ShortFraming( byCmd, abyFrmBuf, &u16FrmLen ) < 0 ) + { + return -1; + } + + /** + * 2. + * ֡һSOFEOF + */ + if( ISO14443A_PCD_Code( abyFrmBuf, u16FrmLen, abyTxBuf, &u16CodedLen ) < 0 ) + { + return -1; + } + + return RFID_Reader_Tx( u16CodedLen, abyTxBuf ); +} + +/*--------------------------------------------------------------*\ + * ׼֡ + *---------------------------------------------------------------*/ + +/** + * \fun ISO14443A_SELECT() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_SELECT( BYTE sel, BYTE abyUID[] ) +{ + /** + * SELECTCRC16. + */ + BYTE abyCmd[7]; + int i; + + abyCmd[0] = sel; // SELECT: 0x93,0x95,0x97 + abyCmd[1] = 0x70; // SELECT + abyCmd[6] = 0x00; + for( i = 0; i < 4; i++ ) + { + abyCmd[i+2] = abyUID[i]; + abyCmd[6] = abyCmd[6] ^ abyUID[i]; + } + + pcd_postMessage( abyCmd, 56, sel, "wait SAK" ); + return ISO14443A_stdFrame_req( abyCmd, 56 ); +} + + +/** + * \fun ISO14443A_HALT() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_HALT() +{ + BYTE abyCmd[]={0x50, 0x00}; + + pcd_postMessage( abyCmd, 16, ISO_14443_CMD_HALT, NULL ); + return ISO14443A_stdFrame_req( abyCmd, 16 ); +} + +/** + * \fun ISO14443A_ATQA() + * \brief PICC->PCD + * REQA/WUKAӦ + * ׼֡. + * \input + * \return 0ɹʧ; + */ +int ISO14443A_ATQA( BYTE byCLn ) +{ + BYTE abyCmd[2]; + + byCLn = byCLn & 0x03; // 3λЧ + abyCmd[1] = (byCLn << 6) + 0x01; + abyCmd[0] = 0x00; + + picc_postMessage( (UCHAR *)abyCmd, 16, ISO_14443_CMD_ATQA ); + + return ISO14443A_stdFrame_rsp( abyCmd, 16 ); +} + +/** + * \fun ISO14443A_SAK() + * \brief PICC->PCD + * SELECT/ANTICOLLISIONӦ + * + * \input cascade: 0/1. + * \return 0ɹʧ; + */ +int ISO14443A_SAK( BYTE cascade ) +{ + return ISO14443A_stdFrame_rsp( &cascade, 8 ); +} + + +// ׼֡ǷCRCУ +// PCDʹ +int ISO14443A_stdFrame_req( BYTE abyBuf[], UINT16 u16BitLen ) +{ + BYTE abyCodeBuf[1024], abyFrmBuf[1024]; + UINT16 u16CodedLen,u16FrmLen; + + /** + * 1. ֡ + */ + if( ISO14443A_stdFraming( abyBuf, u16BitLen, abyFrmBuf, &u16FrmLen ) < 0 ) + { + return -1; + } + + /** + * 2. + * ׼֡һSOFEOF + */ + if( ISO14443A_PCD_Code( abyFrmBuf, u16FrmLen, abyCodeBuf, &u16CodedLen ) < 0 ) + { + return -1; + } + + /** + * 3. + */ + return RFID_Reader_Tx( u16CodedLen, abyCodeBuf ); +} + +// ׼֡ǷCRCУ +// PICCʹ +int ISO14443A_stdFrame_rsp( BYTE abyBuf[], UINT16 u16BitLen ) +{ + BYTE abyCodeBuf[1024], abyFrmBuf[1024]; + UINT16 u16CodedLen,u16FrmLen; + + /** + * 1. ֡ + */ + if( ISO14443A_stdFraming( abyBuf, u16BitLen, abyFrmBuf, &u16FrmLen ) < 0 ) + { + return -1; + } + + /** + * 2. + * ׼֡һSOFEOF + */ + if( ISO14443A_PICC_Code( abyFrmBuf, u16FrmLen, abyCodeBuf, &u16CodedLen ) < 0 ) + { + return -1; + } + + /** + * 3. + */ + return RFID_Card_Tx( u16CodedLen, abyCodeBuf ); +} +/*--------------------------------------------------------------*\ + * ײ֡ + *---------------------------------------------------------------*/ + +/** + * ײ֡PCDPICC˲ͬ + */ +int ISO14443A_AnticollisionFrame_req( + BYTE bySEL, BYTE abyUID[], UINT16 u16BitLen ) +{ + BYTE abyCmd[7]; + BYTE abyCodeBuf[1024], abyFrmBuf[1024]; + UINT16 u16CodedLen,u16FrmLen, u16CmdBitLen; + int m,n,k,i; + + abyCmd[0] = bySEL; + + n = u16BitLen % 8; + k = u16BitLen/8 + ((n != 0 )? 1:0); + m = 2 + k; + abyCmd[1] = ((m & 0x0F) << 4 )+(n & 0x0F); + + for( i = 0; i < k; i++ ) + { + abyCmd[i+2] = abyUID[i]; + } + u16CmdBitLen = 16 + u16BitLen; + + { + pcd_postMessage( abyCmd, u16CmdBitLen, bySEL, "wait ANTI" ); + } + + /** + * 1. ֡ + */ + if( ISO14443A_AnticollisionFraming( 0, 0, abyCmd, u16CmdBitLen, abyFrmBuf, &u16FrmLen ) < 0 ) + { + return -1; + } + + /** + * 2. + * ײ֡һSOFûEOF + */ + if( ISO14443A_PCD_Code( abyFrmBuf, u16FrmLen, abyCodeBuf, &u16CodedLen ) < 0 ) + { + return -1; + } + + /** + * 3. + */ + return RFID_Reader_Tx( u16CodedLen, abyCodeBuf ); + + return 0; +} + +// PICCһRSP. +// BCCҪϲ +int ISO14443A_AnticollisionFrame_rsp( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE byFirstByte, + BYTE abyUID[], UINT16 u16UIDBitLen, + BYTE byBCC + ) +{ + BYTE abyCmd[7]; + BYTE abyCodeBuf[1024], abyFrmBuf[1024]; + UINT16 u16CodedLen,u16FrmLen; + int k; + + /** + * 1. ֡ + */ + k = u16UIDBitLen / 8; + memcpy( abyCmd, abyUID, k ); + abyCmd[k] = byBCC; + + if( ISO14443A_AnticollisionFraming( byBitLenofFirstByte, byFirstByte, + abyCmd, (k+1)*8, abyFrmBuf, &u16FrmLen ) < 0 ) + { + return -1; + } + + /** + * 2. + * ׼֡һSOFEOF + */ + if( ISO14443A_PICC_Code( abyFrmBuf, u16FrmLen, abyCodeBuf, &u16CodedLen ) < 0 ) + { + return -1; + } + + /** + * 3. + */ + return RFID_Card_Tx( u16CodedLen, abyCodeBuf ); +} + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdtx.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdtx.h new file mode 100644 index 0000000..bf5dd36 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_cmdtx.h @@ -0,0 +1,109 @@ +/** + * \file rfid_iso14443A_cmdtx.h + * + * \brief ISO14443A. + * + */ +#ifndef _RFID_ISO14443A_CMD_H_ +#define _RFID_ISO14443A_CMD_H_ + +#include "rfid_iso14443A_codec.h" +#include "rfid_iso14443A_frm.h" +#include "rfid_com.h" + +/*-------------------------------------------------------------*\ + * ISO14443A + * PCD + *-------------------------------------------------------------*/ + +/** + * \fun ISO14443A_REQA_req() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_REQA(); +/** + * \fun ISO14443A_WUPA_req() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_WUPA(); +/** + * \fun ISO14443A_SELECT() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_SELECT( BYTE sel, BYTE abyUID[] ); + +/** + * \fun ISO14443A_ANTICOLLISION() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_AnticollisionFrame_req( BYTE bySEL, BYTE abyUID[], UINT16 u16BitLen ); + +/** + * \fun ISO14443A_HALT() + * \brief PCD->PICC + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_HALT(); + +/*-------------------------------------------------------------*\ + * ISO14443A + * PICC + *-------------------------------------------------------------*/ + +/** + * \fun ISO14443A_ATQA() + * \brief PCD->PICC + * REQA/WUKAӦ + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_ATQA( BYTE uidCLn ); + + +/** + * \fun ISO14443A_SAK() + * \brief PCD->PICC + * SELECTӦ + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_SAK( BYTE cascade ); + + +/** + * \fun ISO14443A_ANTICOLLISION() + * \brief PCD->PICC + * ANTICOLLISIONӦ + * + * \input . + * \return 0ɹʧ; + */ +int ISO14443A_AnticollisionFrame_rsp( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE byFirstByte, + BYTE abyUID[], UINT16 u16UIDBitLen, + BYTE byBCC + ); + + +int ISO14443A_ShortFrame_req( BYTE byCmd ); +int ISO14443A_stdFrame_req( BYTE abyBuf[], UINT16 u16BitLen ); +int ISO14443A_stdFrame_rsp( BYTE abyBuf[], UINT16 u16BitLen ); + +#endif \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_codec.cpp b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_codec.cpp new file mode 100644 index 0000000..34f534c --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_codec.cpp @@ -0,0 +1,387 @@ +/** + * rfid_iso14443A_codec.c + * + * ISO14443 + * 1. /ȥ SOF/EOF + * 2. Buf: bit7 ͳ. + * 3. ˳bit7,6,...0. + */ + +//#include "stdafx.h" +#include "rfid_iso14443A_codec.h" + +int ISO14443A_PCD_Code( + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ) +{ + return ISO14443A_Code( + TRUE, + aInBuf, u16InBitLen, aoutBuf, pu16OutBitLen + ); +} + +int ISO14443A_PCD_Decode( + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aOutBuf[], UINT16 *pu16OutBitLen + ) +{ + return ISO14443A_Decode( + true, + aInBuf, u16InBitLen, aOutBuf, pu16OutBitLen + ); +} + +int ISO14443A_PICC_Code( + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ) +{ + return ISO14443A_Code( + FALSE, + aInBuf, u16InBitLen, aoutBuf, pu16OutBitLen + ); +} + +int ISO14443A_PICC_Decode( + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aOutBuf[], UINT16 *pu16OutBitLen + ) +{ + return ISO14443A_Decode( + FALSE, + aInBuf, u16InBitLen, aOutBuf, pu16OutBitLen + ); +} + + + +// 룺 +// ˳ÿֽڣأ߱bit7ʼ +// +// BYTE1 BYTE2 ...BYTEn +// bit: 7,6,5,4,3,2,1,0 7,... 7,6,5. +// +// ѾУ飬CRCȡ +// +// رȳ. +int ISO14443A_Code( + BOOL bPCD, // PCD + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aOutBuf[], UINT16 *pu16OutBitLen + ) +{ + // SOF + int bitLen, byLen, ibitLen; + int i, j, k; + int prebit,curbit; + BYTE code; + + // SOF + bitLen = 0; + byLen = 0; + aOutBuf[byLen] = 0x00; + + // SOF + { + if( bPCD ) + { + aOutBuf[byLen] = ISO14443A_PCD_SOF << 4; + } + else + { + aOutBuf[byLen] = ISO14443A_PICC_SOF << 4; + } + + bitLen++; + } + + // ÿbit. + prebit = 0; // һΪ0, ֻPCDЧ + i = 0; + ibitLen = 0; + while( ibitLen < u16InBitLen ) + { + // ÿBYTEλʼ. + if( (u16InBitLen - ibitLen) >= 8 ) + { + k = 0; + } + else + { + k = 8 - u16InBitLen % 8; + } + + // ȱbit + for( j = 7; j >=k ; j-- ) + { + curbit = ( aInBuf[i] >> j ) & 0x01; + if( bPCD ) + { + code = RFID_Code_Miller( prebit, curbit ) & 0x0F; + } + else + { + code = RFID_Code_Manchester( curbit ); + } + + if( bitLen % 2 == 0 ) + { + aOutBuf[byLen] |= code << 4; + } + else + { + aOutBuf[byLen] |= code; + byLen++; + aOutBuf[byLen] = 0x00; + } + bitLen++; + ibitLen++; + prebit = curbit; + } + i++; + } + + // EOF: EOFΪ߼0. + // EOF + { + if( bPCD ) + { + curbit = 0; + code = RFID_Code_Miller( prebit, curbit ) & 0x0F; + } + else + { + code = ISO14443A_PICC_EOF; + } + + if( bitLen % 2 == 0 ) + { + aOutBuf[byLen] |= code << 4; + } + else + { + aOutBuf[byLen] |= code; + } + bitLen++; + } + *pu16OutBitLen = bitLen * ISO14443A_BIT_CODEC_LEN; + + return *pu16OutBitLen; +} + +// PICC˵. +// ȥSOF/EOF. +// ɹؽسȣ-1ʧܡ +int ISO14443A_Decode( + BOOL bPCD, // PCD + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aOutBuf[], UINT16 *pu16OutBitLen ) +{ + int i, k; + int bitLen, ibitLen; + BYTE coded; + int byoffset, btoffset; + + if( u16InBitLen % 4 != 0 ) + { + return -1; + } + + // ʼ + i = 0; + + // SOF; + ibitLen = 0; + // SOF + if( u16InBitLen > 4 ) + { + BYTE bySOF; + bySOF = bPCD ? ISO14443A_PICC_SOF : ISO14443A_PCD_SOF; + + coded = ( aInBuf[i] >> 4 ) & 0x0F; + if( coded != bySOF ) + { + return -1; + } + ibitLen++; + u16InBitLen -= ISO14443A_BIT_CODEC_LEN; + } + + bitLen = 0; + // 󳤶-2; + while( u16InBitLen > ISO14443A_BIT_CODEC_LEN) + { + if( ibitLen % 2 == 1 ) + { + coded = aInBuf[i] & 0x0F; + i++; + } + else + { + coded = ( aInBuf[i] >> 4 ) & 0x0F; + } + + // PCD࣬Manchester. + if( !bPCD ) + { + k = RFID_Decode_Miller( coded ); + } + else + { + k = RFID_Decode_Manchester( coded ); + } + + if( k == -1 ) + { + return -1; + } + byoffset = bitLen / 8; + btoffset = bitLen % 8; + + if( btoffset == 0 ) + { + aOutBuf[byoffset] = 0x00; + } + aOutBuf[byoffset] |= k << ( 7 - btoffset); + + bitLen++; + ibitLen++; + u16InBitLen -= ISO14443A_BIT_CODEC_LEN; + } + + // EOF + if( u16InBitLen >= 4 ) + { + BOOL bEOFResult; + if( ibitLen % 2 == 1) + { + coded = aInBuf[i] & 0x0F; + i++; + } + else + { + coded = ( aInBuf[i] >> 4 ) & 0x0F; + } + + if( bPCD ) + { + // PCD뷽 + bEOFResult = ( coded == ISO14443A_PICC_EOF)?TRUE:FALSE; + } + else + { + bEOFResult = ( (coded == ISO14443A_PCD_0P0) || ( coded == ISO14443A_PCD_0P1) ) ? TRUE:FALSE; + } + if( !bEOFResult ) + { + return -1; + } + u16InBitLen -= ISO14443A_BIT_CODEC_LEN; + } + *pu16OutBitLen = bitLen; + return bitLen; +} + +/*-------------------------------------------------------------*\ + * Miller + * ISO14443A PCD->PICC + *-------------------------------------------------------------*/ +/** + * ĽMiller,4ر + * + * \input 룺BYTE prebit: 0/1ǰصǰһ + * 룺BYTE bitDat: 0/1ǰ + * \ouput + * \return bitDat=1, 1101 + * prebit=1,bitDat=0أ1111 + * prebit=0,bitDat=0أ0111 + */ + +int RFID_Code_Miller( BYTE prebit, BYTE bitDat ) +{ + bitDat &= 0x01; + prebit &= 0x01; + if( bitDat == 0 ) + { + if( prebit == 0 ) + { + return RFID_CODE_MILLER_0_p0; // 0111 + } + else + { + return RFID_CODE_MILLER_0_p1; // 1111 + } + } + else + { + return RFID_CODE_MILLER_1; // 1101 + } +} + +/** + * ĽMiller룺01.ʧ + * + * \input 룺BYTE codedDat: 1101 for 1, 1111/0111 for 0 + * \ouput + * \return 0/1 + * -1 ,Ƿ + */ +int RFID_Decode_Miller( BYTE codedDat ) +{ + codedDat &= 0x0F; + if( codedDat == RFID_CODE_MILLER_1 ) + { + return 1; + } + else if( codedDat == RFID_CODE_MILLER_0_p1 || codedDat == RFID_CODE_MILLER_0_p0 ) + { + return 0; + } + else + { + return -1; + } +} + +/*-------------------------------------------------------------*\ + * Manchester + * ISO14443A PICC->PCD & ISO15693 VICC->VCD + *-------------------------------------------------------------*/ + +/** + * Manchester룬4ر + * + * \input 룺BYTE bitDat: 0/1ǰ + * \ouput + * \return bitDat=1, أ1100 + * bitDat=0أ0011 + */ +int RFID_Code_Manchester( BYTE bitDat ) +{ + return bitDat ? RFID_CODE_MANCHESTER_1:RFID_CODE_MANCHESTER_0; +} + +/** + * Manchester룺01.ʧ + * + * \input 룺BYTE codedDat: 1100 for 1, 0011 for 0 + * \ouput + * \return 0/1 + * -1 ,Ƿ + */ +int RFID_Decode_Manchester( BYTE codedDat ) +{ + if( codedDat == RFID_CODE_MANCHESTER_1 ) + { + return 1; + } + else if( codedDat == RFID_CODE_MANCHESTER_0 ) + { + return 0; + } + else + { + return -1; + } +} diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_codec.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_codec.h new file mode 100644 index 0000000..fcf78f2 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_codec.h @@ -0,0 +1,137 @@ +/** + * rfid_iso14443A_codec.h + * + */ + +#ifndef _RFID_ISO14443A_CODEC_H_ +#define _RFID_ISO14443A_CODEC_H_ + +#include "rfid_def.h" + +#define ISO14443A_PCD_X 0xD // 1101, '1' +#define ISO14443A_PCD_Y 0xF // 1111, '0' EOF +#define ISO14443A_PCD_Z 0x7 // 0111, '0', SOF + +#define ISO14443A_PCD_SOF ISO14443A_PCD_Z +// EOFΪ0, #define ISO14443A_PCD_EOF +#define ISO14443A_PCD_1 ISO14443A_PCD_X +#define ISO14443A_PCD_0P1 ISO14443A_PCD_Y // 0ǰһΪ1 +#define ISO14443A_PCD_0P0 ISO14443A_PCD_Z // 0ǰһΪ0 +#define ISO14443A_BIT_CODEC_LEN 4 // ÿر볤Ϊ4 + +#define ISO14443A_PICC_D 0xC // 1100'1', SOF +#define ISO14443A_PICC_E 0x3 // 0011, '0' +#define ISO14443A_PICC_F 0x0 // 0000, EOF + +#define ISO14443A_PICC_SOF ISO14443A_PICC_D +#define ISO14443A_PICC_EOF ISO14443A_PICC_F +#define ISO14443A_PICC_1 ISO14443A_PICC_D +#define ISO14443A_PICC_0 ISO14443A_PICC_E + +// ISO/IEC 14443A, PCD->PICCʹ +#define RFID_CODE_MILLER_1 13 // 1101 +#define RFID_CODE_MILLER_0_p1 15 // 1111 +#define RFID_CODE_MILLER_0_p0 7 // 0111 + +// ISO/IEC 14443A, PICC->PCDʹ +#define RFID_CODE_MANCHESTER_1 12 // 1100 +#define RFID_CODE_MANCHESTER_0 3 // 0011 + + +/** + * \function + * + * \input BYTE aInBuf[], 뻺 + * UINT16 u16InBitLen س + * \ouput BYTE aoutBuf + * BYTE *pu16OutBitLen ݳ + * + * \return -1ʧܣ ؽس + */ + +int ISO14443A_PCD_Code( + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aOutBuf[], UINT16 *pu16OutBitLen + ); + +int ISO14443A_PCD_Decode( + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aOutBuf[], UINT16 *pu16OutBitLen + ); + +int ISO14443A_PICC_Code( + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ); + +int ISO14443A_PICC_Decode( + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aOutBuf[], UINT16 *pu16OutBitLen + ); + +/** + * 1. bPCD: PCD/PICC֡뷽ʽ/SOFEOFͬ + * ˸; + */ +int ISO14443A_Code( + BOOL bPCD, // PCD + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ); + +int ISO14443A_Decode( + BOOL bPCD, // PCD + BYTE aInBuf[], UINT16 u16InBitLen, + BYTE aOutBuf[], UINT16 *pu16OutBitLen + ); + +/*-------------------------------------------------------------*\ + * Miller + * ISO14443A PCD->PICC + *-------------------------------------------------------------*/ +/** + * ĽMiller,4ر + * + * \input 룺BYTE prebit: 0/1ǰصǰһ + * 룺BYTE bitDat: 0/1ǰ + * \ouput + * \return bitDat=1, 1101 + * prebit=1,bitDat=0أ1111 + * prebit=0,bitDat=0أ0111 + */ +int RFID_Code_Miller( BYTE prebit, BYTE bitDat ); +/** + * ĽMiller룺01.ʧ + * + * \input 룺BYTE codedDat: 1101 for 1, 1111/0111 for 0 + * \ouput + * \return 0/1 + * -1 ,Ƿ + */ +int RFID_Decode_Miller( BYTE codedDat ); + +/*-------------------------------------------------------------*\ + * Manchester + * ISO14443A PICC->PCD + *-------------------------------------------------------------*/ + +/** + * Manchester룬4ر + * + * \input 룺BYTE bitDat: 0/1ǰ + * \ouput + * \return bitDat=1, أ1100 + * bitDat=0أ0011 + */ +int RFID_Code_Manchester( BYTE bitDat ); // bitDat=1 or 0 +/** + * Manchester룺01.ʧ + * + * \input 룺BYTE codedDat: 1100 for 1, 0011 for 0 + * \ouput + * \return 0/1 + * -1 ,Ƿ + */ +int RFID_Decode_Manchester( BYTE codedDat ); + +#endif diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_frm.cpp b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_frm.cpp new file mode 100644 index 0000000..ae0408c --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_frm.cpp @@ -0,0 +1,307 @@ +/** + * \file rfid_frm.c + * + * \brief ʵrfidе/֡ + * + * CRC֮ǰ㣬Ϊڷײ֡УҪȫֽڲ㣬ֻвֽڳ֡ + */ + +//#include "StdAfx.h" + +#include "rfid_chk.h" +#include "rfid_iso14443A_frm.h" +#include "memory.h" + +/** + * ׼ + * + * һֽڵı˳ + * УPУ. + * SOF/EOF + */ + +int ISO14443A_Framing( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE byFirstByte, // һֽڡu16BitLenofFirstByte=0Բ + BYTE ainBuf[], UINT16 u16inBitLen, // ֽ + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ) +{ + int i, j, k, curbit; + int byoffset, bitoffset; + int bitLen = 0; + + // 0ʾײ֡ + byoffset = 0; + aoutBuf[byoffset] = 0x00; + bitoffset = 0; + if( byBitLenofFirstByte ) + { + for( i = 0; i < byBitLenofFirstByte; i++ ) + { + curbit = ( byFirstByte >> i ) & 0x01; + + byoffset = bitLen / 8; + bitoffset = bitLen % 8; + aoutBuf[byoffset] |= curbit << ( 7-bitoffset); + bitLen++; + } + // OldParity. + byoffset = bitLen / 8; + bitoffset = bitLen % 8; + aoutBuf[byoffset] |= 0 << ( 7-bitoffset); + bitLen++; + } + + // ʼе + i = 0; + while( u16inBitLen ) + { + // bitLenֽ. + if( u16inBitLen > 8 ) + { + k = 8; + } + else + { + k = u16inBitLen; + } + + for( j = 0; j < k; j++ ) + { + // bitLenֽ. + curbit = ( ainBuf[i] >> j ) & 0x01; + + // 㵱ǰֽ/. + byoffset = bitLen / 8; + bitoffset = bitLen % 8; + if( bitoffset == 0 ) + { + aoutBuf[byoffset] = 0x00; + } + aoutBuf[byoffset] |= curbit << ( 7-bitoffset); + bitLen++; + } + + if( k == 8 ) + { + // ֽں󣬲мУ + curbit = OldParity( ainBuf[i] ); + byoffset = bitLen / 8; + bitoffset = bitLen % 8; + if( bitoffset == 0 ) + { + aoutBuf[byoffset] = 0x00; + } + aoutBuf[byoffset] |= curbit << ( 7-bitoffset); + bitLen++; + } + i++; + u16inBitLen -= k; + } + *pu16OutBitLen = bitLen; + + return bitLen; +} + +// ӿ֡ +// Ҫ +// CRCCRCڵøóǰѾȥ. +// أ-1ʾ +int ISO14443A_unFraming( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE *byFirstByte, // һֽڡu16BitLenofFirstByte=0Բ + BYTE ainBuf[], UINT16 u16inBitLen, // ֽ + BYTE aoutBuf[], UINT16 *pu16OutBitLen // ز*byBitLenofFirstByte + ) +{ + // + int i; + int obitLen, obyoffset, obtoffset; // in + int ibitLen, ibyoffset, ibtoffset; // out + int curbit; + + + // ʱû֪ԼǷеһֽ + // ڷײʱPCDݷ֪ͣԼҪ + + ibitLen = 0; + obitLen = 0; + + // ʵu16inBitLen % 9 == byBitLenofFirstByte + if( byBitLenofFirstByte ) + { + *byFirstByte = 0; + for( i = 0; i < byBitLenofFirstByte; i++ ) + { + curbit = ( ainBuf[0] >> (7-i)) & 0x01; + *byFirstByte |= curbit << i; + ibitLen++; + } + // Уλ. + // ˶УλǷȷ + curbit = ainBuf[0] >> (7-byBitLenofFirstByte); + ibitLen++; + } + + // ʼб + obitLen = 0; + obyoffset = 0; + obtoffset = 0; + + i = 0; + while( ibitLen < u16inBitLen ) + { + // ȡһbit + ibyoffset = ibitLen / 8; + ibtoffset = ibitLen % 8; + curbit = ( ainBuf[ibyoffset] >> (7-ibtoffset)) & 0x01; + + if( (i % 9) == 8 ) + { + // У飬bitǷУλ + // + if( curbit != OldParity( aoutBuf[obyoffset])) + { + return -1; + } + } + else + { + // . + obyoffset = obitLen / 8; + obtoffset = obitLen % 8; // + if( obtoffset == 0 ) + { + aoutBuf[obyoffset] = 0x00; + } + aoutBuf[obyoffset] |= curbit << obtoffset; + obitLen++; + } + i++; + ibitLen++; + } + + *pu16OutBitLen = obitLen; + + return obitLen; +} + +// ǰӣ0111,ӣ1111 + +/** + * ISO14443A_PCD_stFrame() + * PCD->PICC + * + * رسȡ + */ +int ISO14443A_stdFraming( BYTE aInBuf[], UINT16 u16InBitLen, BYTE aoutBuf[], UINT16 *pu16OutBitLen ) +{ + // ׼֡һCRCУ飡 + BYTE abyBuf[100]; + int k; + + k = u16InBitLen/8; + + memcpy( abyBuf, aInBuf, k ); + // CRCУ + ISO14443A_CRC( aInBuf, k, &abyBuf[k+1], &abyBuf[k]); + + k += 2; + + return ISO14443A_Framing( 0, 0, // ׼ֽ֡ڿʼ + abyBuf, k*8, + aoutBuf, pu16OutBitLen + ); +} + +// ̶֡γȣ7ûżУCRCУ +int ISO14443A_ShortFraming( BYTE byCmd, BYTE aoutBuf[], UINT16 *pu16OutBitLen ) +{ + int i; + int curbit; + byCmd = byCmd & 0x7F; + + aoutBuf[0] = 0x00; + for( i = 0; i < 7; i++ ) + { + curbit = ( byCmd >> i ) & 0x01; + aoutBuf[0] |= curbit << (7-i); + } + *pu16OutBitLen = 7; + + return 7; +} + +int ISO14443A_AnticollisionFraming( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE byFirstByte, + BYTE ainBuf[], UINT16 u16InBitLen, + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ) +{ + // ײ֡ûCRC. + return ISO14443A_Framing( + byBitLenofFirstByte, byFirstByte, // ׼ֽ֡ڿʼ + ainBuf, u16InBitLen, + aoutBuf, pu16OutBitLen + ); +} + +// ׼֡ +// 룺سȣֽڳȣ +int ISO14443A_Un_stdFraming(BYTE ainBuf[], UINT16 u16inBitLen, BYTE aoutBuf[], UINT16 *pu16OutBufLen ) +{ + BYTE abyCRC[2]; + BYTE abyBuf[1000]; + int k; + + if( ISO14443A_unFraming( 0,0,ainBuf, u16inBitLen, abyBuf, pu16OutBufLen ) < 0 ) + { + return -1; + } + + k = (*pu16OutBufLen)/8; + k -= 2; + *pu16OutBufLen -= 16; + + // CRC. + ISO14443A_CRC( abyBuf, k, &abyCRC[1], &abyCRC[0] ); + if( abyBuf[k] != abyCRC[0] || abyBuf[k+1] != abyCRC[1] ) + { + return -1; + } + memcpy( aoutBuf, abyBuf, k ); + + return k; // ֽڳ +} + +// ֻ7. +int ISO14443A_Un_ShortFraming( BYTE aInBuf[], UINT16 u16InBitLen, BYTE *pbyCmd ) +{ + int i; + int curbit; + + *pbyCmd = 0x00; + for( i = 0; i < 7; i++ ) + { + curbit = ( aInBuf[0] >> i ) & 0x01; + *pbyCmd |= curbit << (7-i); + } + + return 7; +} + +int ISO14443A_Un_AnticollisionFraming( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE *pbyFirstByte, + BYTE aInBuf[], UINT16 u16inBitLen, + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ) +{ + return ISO14443A_unFraming( byBitLenofFirstByte, pbyFirstByte, + aInBuf, u16inBitLen, aoutBuf, pu16OutBitLen ); +} + + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_frm.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_frm.h new file mode 100644 index 0000000..9ace318 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_frm.h @@ -0,0 +1,61 @@ +/** + * rfid_iso14443A_frm.h + * + * + * ڱ׼֡ײ֡У飻 + * ڱ׼֡CRC; + * ڷײ֡PICC->PCD򣬿ֽڲȫij + * Уֽڣͱأ߱أ + */ + +#ifndef _RFID_ISO14443A_FRM_H_ +#define _RFID_ISO14443A_FRM_H_ + +#include "rfid_def.h" +#include "rfid_chk.h" + + +int ISO14443A_stdFraming( BYTE aInBuf[], UINT16 u16InBitLen, BYTE aoutBuf[], UINT16 *pu16OutBitLen ); +int ISO14443A_ShortFraming( BYTE byCmd, BYTE aoutBuf[], UINT16 *pu16OutBitLen ); +int ISO14443A_AnticollisionFraming( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE byFirstByte, + BYTE ainBuf[], UINT16 u16inBitLen, + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ); + +int ISO14443A_Un_stdFraming(BYTE ainBuf[], UINT16 u16inBitLen, BYTE aoutBuf[], UINT16 *pu16OutbyLen ); +int ISO14443A_Un_ShortFraming( BYTE ainBuf[], UINT16 u16InBitLen, BYTE *pbyCmd ); +int ISO14443A_Un_AnticollisionFraming( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE *pbyFirstByte, + BYTE ainBuf[], UINT16 u16inBitLen, + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ); + +/** + * ISO14443A Frame + * ׼ + * + * һֽڵı˳ + * УPУ. + * SOF/EOF + */ + +int ISO14443A_Framing( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE byFirstByte, // һֽڡu16BitLenofFirstByte=0Բ + BYTE ainBuf[], UINT16 u16inBitLen, // ֽ + BYTE aoutBuf[], UINT16 *pu16OutBitLen + ); + +int ISO14443A_unFraming( + BYTE byBitLenofFirstByte, // һֽеbit Lenڷײ֡Ҫ + BYTE *byFirstByte, // һֽڡu16BitLenofFirstByte=0Բ + BYTE ainBuf[], UINT16 u16inBitLen, // ֽ + BYTE aoutBuf[], UINT16 *pu16OutBitLen // ز*byBitLenofFirstByte + ); +#endif + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.cpp b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.cpp new file mode 100644 index 0000000..cf32938 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.cpp @@ -0,0 +1,779 @@ +/** + * \file rfid_iso14443A_pcd.cpp + * + * + * + */ + +//#include "stdafx.h" +#include + +#include "rfid_def.h" +#include "memory.h" +#include "rfid_iso14443A_cmdtx.h" +#include "rfid_iso14443A_cmdrx.h" + +#include "rfid_iso14443A_pcd.h" +#include "pcd_thread.h" + +void PCD_ISO14443A_SetSELECT( ISO_14443A_PCD *pstPCD, BYTE cmd ); +FILE *g_fpDebug = NULL; +int g_firstBitValue = 0; + +#if 0 +int main( int argc, char* argv[] ) +{ + return pcd_main( 10 ); +} +#endif + +int pcd_main( int numofpicc ) +{ + ISO_14443A_PCD stPCD; + int i, k; + + g_fpDebug = fopen("d:\\rfid\\pcddebug.txt", "w"); + + k = 0; + while( k < numofpicc ) + { + PCD_ISO14443A_run( &stPCD ); + if( stPCD.ucStatus == ISO_14443A_PCD_STATE_OK ) + { + FILE *fp = fopen("d:\\rfid\\picc.txt", "a+"); + if( !fp ) + { + fp = fopen( "d:\\rfid\\picc.txt", "w" ); + } + if( k == 0 ) + { + fprintf(fp, "\n--------------new test. " ); + } + printf("\nUID[%d]: ", ++k ); + fprintf(fp, "\nUID[%d]: ", k ); + for( i = 0; i < stPCD.ucCmpBits/8; i++ ) + { + if( stPCD.aucUID[i] != 0x88 ) + { + printf("0x%02X.", stPCD.aucUID[i]); + fprintf(fp, "0x%02X.", stPCD.aucUID[i]); + } + } + fclose( fp ); + } + } + fclose( g_fpDebug ); + return 1; +} + +// һֻʶһſ +int PCD_ISO14443A_run( ISO_14443A_PCD *pstPCD ) +{ + UCHAR aucRxBuf[256]; + UINT16 u16BufLen = 256; + int len, r, k; + + pstPCD->ucStatus = ISO_14443A_PCD_STATE_START; + pstPCD->ucCmpBits = 0; + pstPCD->ucCLn = 3; // ûյCLn: 0,1,2. + pstPCD->ucAntiBit = 2; // ͻУȷ0 + pstPCD->u16WaitTime = PCD_WAIT_TIME; // ȴʱ䡣 + + if( !g_fpDebug ) + { + g_fpDebug = fopen("d:\\rfid\\pcddebug.txt", "w"); + } + + memset( pstPCD->aucUID, 0x00, 12 ); + len = 0; + while( ( pstPCD->ucStatus != ISO_14443A_PCD_STATE_ER ) + && ( pstPCD->ucStatus != ISO_14443A_PCD_STATE_OK ) ) + { + // ݲ + + // lenΪ0. + r = PCD_ISO14443A_process( pstPCD, aucRxBuf, len ); + if( r < 0 ) + { + break; + } + + if( pstPCD->ucStatus == ISO_14443A_PCD_STATE_OK ) + { + // ˣ + break; + } + + // ȴ + k = 1; + while(k--) + { + len = RFID_Reader_Rx( u16BufLen, aucRxBuf ); + if( len > 0 ) + { + break; + } + } + } + + fclose( g_fpDebug ); + return r; +} + +// cmd: sel = 0, anti = 1; +void PCD_ISO14443A_SetSELECT( ISO_14443A_PCD *pstPCD, BYTE cmd ) +{ + if( pstPCD->ucCmpBits < 32 ) + { + pstPCD->ucSEL = ISO_14443_CMD_SEL_CL1; + } + else if( pstPCD->ucCmpBits == 32 ) + { + pstPCD->ucSEL = ( cmd == 0 ) ? ISO_14443_CMD_SEL_CL1:ISO_14443_CMD_SEL_CL2; + } + else if( pstPCD->ucCmpBits < 64 ) + { + pstPCD->ucSEL = ISO_14443_CMD_SEL_CL2; + } + else if( pstPCD->ucCmpBits == 64 ) + { + pstPCD->ucSEL = ( cmd == 0 ) ? ISO_14443_CMD_SEL_CL2:ISO_14443_CMD_SEL_CL3; + } + else + { + pstPCD->ucSEL = ISO_14443_CMD_SEL_CL3; + } +} + +// ͻģ⣺ +// յıʵյı +int PCD_ISO14443A_CollisionEmu( ISO_14443A_PCD *pstPCD, + BYTE byBitLenofFirstByte, BYTE firstByte, + UCHAR aucCmdBuf[], UINT16 u16CmdBitLen ) +{ + BYTE bcc; + int i, j, k, m, n; + + BYTE abyRxUID[4]={0x00,0x00,0x00,0x00}; // 4ˣ + int rxUIDbitLen; + + int ibyoffset, ibtoffset; + int obyoffset, obtoffset; + int curbit, bitlen; + + // ͻģ: PCDֻյbits. + // ʵյUID + bitlen = byBitLenofFirstByte + u16CmdBitLen - 8; // + + // 00ʾȫײ. + // . + if( bitlen > 1 ) + { + rxUIDbitLen = rand() % bitlen; + } + else + { + rxUIDbitLen = 1; + } + // ѽյbitlenصݣrxUIDbitLenabyRxUID[] + // + + // abyRxUIDֽƫƺbit + obyoffset = 0; + obtoffset = 0; + // FirstByte. + n = 0; // ʾѾbit. + if( byBitLenofFirstByte > 0 ) + { + // вbit. + if( byBitLenofFirstByte <= rxUIDbitLen ) + { + // ȫFirstByte. + n = byBitLenofFirstByte; + } + else + { + // FirstByte߲Ҫdrop. + n = rxUIDbitLen; + } + + // nأfirstByten. + i = n - 1; + while( i >= 0 ) + { + curbit = (firstByte >> i)&0x01; + abyRxUID[obyoffset] |= curbit << ( 7 - obtoffset ); + i--; + obtoffset++; + } + } + + // : ֽ. + // + if( rxUIDbitLen > byBitLenofFirstByte ) + { + // aucCmdBufһֽƶ8-kؾͺ. + k = 8-((rxUIDbitLen - byBitLenofFirstByte)%8); // + + // һֽ. + m = (rxUIDbitLen - byBitLenofFirstByte)/8; // һֽڣBCC. + aucCmdBuf[m] = aucCmdBuf[m] << k; + + j = n; + i = 0; + while( j < rxUIDbitLen ) + { + ibyoffset = i / 8; + ibtoffset = i % 8; + curbit = ( aucCmdBuf[ibyoffset] >> ( 7-ibtoffset)) & 0x01; + + obyoffset = j / 8; + obtoffset = j % 8; + abyRxUID[obyoffset] |= curbit << ( 7 - obtoffset ); + i++; + j++; + } + // һֽ. + } + + // ѾabyRxUID[]ڣrxUIDbitLenء + + // һƴUIDڡ + bitlen = rxUIDbitLen; // bitlenʾҪı. + i = 0; // ǰ + if( bitlen > 0 ) + { + // Ȳϴεȱ + if( pstPCD->ucCmpBits % 8) + { + // ȱ: + k = byBitLenofFirstByte; // Ҫkأճһֽ + if( k > rxUIDbitLen ) + { + k = rxUIDbitLen; // ಹk. + } + + // k + obyoffset = pstPCD->ucCmpBits/8; + obtoffset = pstPCD->ucCmpBits%8; + j = obtoffset + k - 1; + ibyoffset = 0; + ibtoffset = 0; + + while( j >= obtoffset ) + { + curbit = ( abyRxUID[ibyoffset] >> ( 7-ibtoffset)) & 0x01; + + pstPCD->aucUID[obyoffset] |= curbit << j; + ibtoffset++; + j--; + } + bitlen -= k; + i += k; + pstPCD->ucCmpBits += k; + } + } + + // ʼkֽ + if( bitlen > 0 ) + { + // bit. + n = ( bitlen / 8 )*8; + + j = pstPCD->ucCmpBits; + k = n; // k. + while( k-- ) + { + ibyoffset = i / 8; + ibtoffset = i % 8; + curbit = ( abyRxUID[ibyoffset] >> ( 7-ibtoffset)) & 0x01; + + obyoffset = j / 8; + obtoffset = j % 8; + pstPCD->aucUID[obyoffset] |= curbit << ( 7 - obtoffset ); + i++; + j++; + } + bitlen -= n; + pstPCD->ucCmpBits += n; + } + + // мʣbitӵͱλ. + if( bitlen > 0 ) + { + // UIDһλֽڽ. + obyoffset = pstPCD->ucCmpBits / 8; + obtoffset = 0; + + pstPCD->ucCmpBits += bitlen; + i = rxUIDbitLen-1; // ʼ. + while( bitlen-- ) + { + ibyoffset = i / 8; + ibtoffset = i % 8; + curbit = ( abyRxUID[ibyoffset] >> ( 7-ibtoffset)) & 0x01; + + pstPCD->aucUID[obyoffset] |= curbit << obtoffset; + obtoffset++; + i--; + } + } + + + // ȷյ32أ鿴BCCǷȷ + if( (pstPCD->ucCmpBits != 0) && (pstPCD->ucCmpBits % 32 == 0) ) + { + bcc = 0x00; + k = pstPCD->ucCmpBits / 8 - 4; + for( i = k; i < 4+k; i++ ) + { + bcc = bcc ^ pstPCD->aucUID[i]; + } + if( bcc != aucCmdBuf[u16CmdBitLen/8-1] ) + { + return -1; + } + } + return 1; +} + +int PCD_ISO14443A_SendSELECT( ISO_14443A_PCD *pstPCD ) +{ + int r; + int i, byoffset, btoffset, k; + + PCD_ISO14443A_SetSELECT( pstPCD, 0 ); + pstPCD->ucStatus = ISO_14443A_PCD_STATE_SELECT; + pcd_updateStatus( pstPCD->ucStatus - ISO_14443A_PCD_STATE_BEGIN ); + + // SELECT. + r = (pstPCD->ucCmpBits - 32 )/8; + r = ISO14443A_SELECT( pstPCD->ucSEL, &(pstPCD->aucUID[r]) ); + + + printf("\n\nTx SELECT, waiting SAK"); + fprintf(g_fpDebug, "\n\nTx SELECT, waiting SAK"); + + printf("\nUID[0x%02x]:", pstPCD->ucSEL); + fprintf(g_fpDebug, "\nUID[0x%02x]:", pstPCD->ucSEL); + k = (pstPCD->ucSEL-0x93)/2; + for( i = k*32; i < pstPCD->ucCmpBits; i++ ) + { + byoffset = i/8; + btoffset = i%8; + printf("%d", ( pstPCD->aucUID[byoffset] >> btoffset)&0x01); + fprintf(g_fpDebug, "%d", (pstPCD->aucUID[byoffset] >> btoffset)&0x01); + if( i%4 == 3 ) + { + printf("."); + fprintf(g_fpDebug,"."); + } + } + printf("\nwait[0x%02x]", pstPCD->ucSEL); + fprintf(g_fpDebug, "\nwait[0x%02x]", pstPCD->ucSEL); + return r; +} + +// úһûյеıأ +// newbit = 0/1. һȡ0. +int PCD_ISO14443A_SendANTICOLLISION( ISO_14443A_PCD *pstPCD ) +{ + int r; + int k; + int i, byoffset, btoffset; + + // 1 bit. Ϊһȡ0ȡ1ʱһȡ0ûзء + // ȡʱһǿԷصģûзأͽˡ + + if( pstPCD->ucAntiBit == g_firstBitValue ) + { + pstPCD->ucCmpBits ++; // һμ1; + } + + // ucCmpBitsΪnewbit. + byoffset = (pstPCD->ucCmpBits-1) / 8; + btoffset = (pstPCD->ucCmpBits-1) % 8; + + pstPCD->aucUID[byoffset] &= ~(1 << btoffset); // Ϊ0. + pstPCD->aucUID[byoffset] |= pstPCD->ucAntiBit << btoffset; + + // UID. + if( pstPCD->ucCmpBits == 32 || pstPCD->ucCmpBits == 64 || pstPCD->ucCmpBits == 96 ) + { + // һغ󣬳32bitʱҪSELECT. + r = PCD_ISO14443A_SendSELECT( pstPCD ); + } + else + { + // anticollision. + PCD_ISO14443A_SetSELECT( pstPCD, 1 ); + k = ( pstPCD->ucCmpBits / 32 ) * 4; + + r = ISO14443A_AnticollisionFrame_req( pstPCD->ucSEL, &(pstPCD->aucUID[k]), pstPCD->ucCmpBits % 32 ); + printf("\n\nTx anticollision(new bit=%d), waiting anticollision.", pstPCD->ucAntiBit); + fprintf( g_fpDebug, "\n\nTx anticollision(new bit=%d), waiting anticollision.", pstPCD->ucAntiBit ); + + printf("\nUID[0x%02x]:", pstPCD->ucSEL); + fprintf(g_fpDebug, "\nUID[0x%02x]: ", pstPCD->ucSEL); + k = (pstPCD->ucSEL-0x93)/2; + for( i = k * 32; i < pstPCD->ucCmpBits; i++ ) + { + byoffset = i/8; + btoffset = i%8; + printf("%d", ( pstPCD->aucUID[byoffset] >> btoffset)&0x01); + fprintf(g_fpDebug, "%d", (pstPCD->aucUID[byoffset] >> btoffset)&0x01); + if( i % 4 == 3 ) + { + printf("."); + fprintf(g_fpDebug, "."); + } + } + printf("\nwait[0x%02x]", pstPCD->ucSEL ); + fprintf(g_fpDebug, "\nwait[0x%02x]", pstPCD->ucSEL); + } + return r; +} + +// ״̬ +int PCD_ISO14443A_process( ISO_14443A_PCD *pstPCD, UCHAR aucRxBuf[], UINT16 u16RxBufBitLen ) +{ + int r = 1; + + switch( pstPCD->ucStatus ) + { + case ISO_14443A_PCD_STATE_START: + // REQAյATRQתΪ + if( pstPCD->ucCLn == 3 ) + { + // REQA(). + pcd_updateStatus( pstPCD->ucStatus - ISO_14443A_PCD_STATE_BEGIN ); + ISO14443A_REQA(); + printf("\n\nTx REQA. waiting ATQA."); + fprintf(g_fpDebug, "\n\nTx REQA. waiting ATQA."); + pstPCD->u16WaitTime = PCD_WAIT_TIME; + pstPCD->ucCLn = 0; + } + else + { + // + BYTE CL; + BYTE rxBuf[2]; + r = ISO14443A_wait_ATQA( aucRxBuf, u16RxBufBitLen, &CL, rxBuf ); + if( r > 0 ) + { + pcd_postMessage( rxBuf, 16, ISO_14443_CMD_ATQA, "send ANTI" ); + + pstPCD->ucStatus = ISO_14443A_PCD_STATE_ANTI; + pstPCD->ucCLn = CL; // 0.1.2 + pstPCD->ucSEL = ISO_14443_CMD_SEL_CL1; + pstPCD->ucCmpBits= 0; + pstPCD->ucAntiBit = 2; // տʼ + pstPCD->u16WaitTime = PCD_WAIT_TIME; + + pcd_updateStatus( pstPCD->ucStatus - ISO_14443A_PCD_STATE_BEGIN ); + r = ISO14443A_AnticollisionFrame_req( ISO_14443_CMD_SEL_CL1, NULL, 0 ); + + printf("\nRx ATQA."); + fprintf(g_fpDebug, "\nRx ATQA."); + printf("\n\nTx SELECT(anticollision), waiting anticollision.\nwait"); + fprintf( g_fpDebug,"\n\nTx SELECT(anticollision), waiting anticollision.\nwait"); + } + } + break; + case ISO_14443A_PCD_STATE_ANTI: + // ִзͻѭ. + if( u16RxBufBitLen == 0 ) + { +// if( pstPCD->ucAntiBit == 2 || pstPCD->ucAntiBit == 1 ) + if( pstPCD->ucAntiBit == 2 || pstPCD->ucAntiBit == !g_firstBitValue ) + { + if( pstPCD->u16WaitTime ) + { + pstPCD->u16WaitTime--; +#ifdef _RFID_DEBUG_ + printf("\nwaitTime = %d", pstPCD->u16WaitTime ); +#else + printf("."); +#endif + return 0; + } + else + { +#ifdef _RFID_DEBUG_ + printf("\nwaitTime = %d. not wait.", pstPCD->u16WaitTime ); +#endif + printf("\nTimeout. not wait." ); + return -1; // ˡ + } + } + else + { + // ˵͹Ϊ. + // ȴ + if( pstPCD->u16WaitTime == 1 ) + { + // ˣnewbit = 1; + pstPCD->ucAntiBit = g_firstBitValue == 0 ? 1:0; + pstPCD->u16WaitTime = PCD_WAIT_TIME; + return PCD_ISO14443A_SendANTICOLLISION( pstPCD ); + } + else + { + // ȴbit = 0Ǹ + pstPCD->u16WaitTime--; +#ifdef _RFID_DEBUG_ + printf("\nwaitTime = %d", pstPCD->u16WaitTime ); +#else + printf("."); +#endif + return 0; + } + } + } + else + { + BYTE firstByte; + BYTE byBitLenofFirstByte; + BYTE aucCmdBuf[100]; + UINT16 u16CmdBitLen; + + if( pstPCD->ucCmpBits%8 ) + { + byBitLenofFirstByte = 8 - pstPCD->ucCmpBits%8; + } + else + { + byBitLenofFirstByte = 0; + } + + r = ISO14443A_wait_anticollisionFrame_rsp( byBitLenofFirstByte, &firstByte, + aucRxBuf, u16RxBufBitLen, + aucCmdBuf, &u16CmdBitLen + ); + if( r < 0 ) + { + pstPCD->ucStatus = ISO_14443A_PCD_STATE_ER; + return r; + } + + { + int k = 0; + int txLen = u16CmdBitLen + byBitLenofFirstByte; + UCHAR txBuf[200]; + if( byBitLenofFirstByte ) + { + txBuf[k++] = firstByte; + } + + for( int i = 0; i < u16CmdBitLen/8; i++ ) + { + txBuf[k++] = aucCmdBuf[i]; + } + + pcd_postMessage( txBuf, txLen, ISO_14443_CMD_SEL_CLx, "send ANTI" ); + } + // ӡյUID + + printf("\nRx UID: "); + fprintf(g_fpDebug, "\nRx UID:"); + if( byBitLenofFirstByte ) + { + int i, k; + for( i = 0; i < byBitLenofFirstByte; i++ ) + { + k = ( firstByte >> i ) & 0x01 ; + printf("%d", k); + fprintf(g_fpDebug, "%d", k); + if( i == byBitLenofFirstByte - 5 ) + { + printf("."); + fprintf(g_fpDebug, "."); + } + } + printf("."); + fprintf(g_fpDebug, "."); + } + + if( u16CmdBitLen-8 > 0 ) + { + int i,k; + int btoffset, byoffset; + + for( i = 0; i < u16CmdBitLen-8; i++ ) + { + byoffset = i/8; + btoffset = i%8; + k = ( aucCmdBuf[byoffset] >> btoffset ) & 0x01; + printf("%d", k); + fprintf(g_fpDebug, "%d", k); + if( i % 4 == 3 ) + { + printf("."); + fprintf(g_fpDebug, "."); + } + } + } + + // ͻģ. + PCD_ISO14443A_CollisionEmu( pstPCD, byBitLenofFirstByte, firstByte, aucCmdBuf, u16CmdBitLen); + + // Dzdzͻ. + // + //int k = pstPCD->ucCmpBits / 8; + //BYTE mask[] = {0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF}; + + //if( byBitLenofFirstByte != 0 ) + //{ + // // ǰء + // pstPCD->aucUID[k] &= mask[byBitLenofFirstByte-1]; + // firstByte &= ~mask[byBitLenofFirstByte-1]; + // pstPCD->aucUID[k] |= firstByte; + // k++; // һֽ. + // pstPCD->ucCmpBits += byBitLenofFirstByte; + //} + + //j = 0; + //for( i = k; i < 4+k; i++ ) + //{ + // pstPCD->aucUID[i] = aucCmdBuf[j++]; + // pstPCD->ucCmpBits += 8; + //} + + printf("\nRx anticollision."); + fprintf( g_fpDebug, "\nRx anticollision."); + + if( pstPCD->ucCmpBits == 32 || pstPCD->ucCmpBits == 64 || pstPCD->ucCmpBits == 96 ) + { + // յеUID. + pstPCD->ucAntiBit = 2; // . + r = PCD_ISO14443A_SendSELECT(pstPCD); + } + else + { +// pstPCD->ucAntiBit = 0; // . + pstPCD->ucAntiBit = g_firstBitValue; // һʹõbit. + r = PCD_ISO14443A_SendANTICOLLISION(pstPCD ); + } + pstPCD->u16WaitTime = PCD_WAIT_TIME; + } + // SELECTתΪACTIVE + break; + case ISO_14443A_PCD_STATE_SELECT: + /** + * + * 1. ͻѭУյ32bitsUIDʱSELECTٸ״̬ȴ + * 2. ͻѭУյıС31bitsPCDӱΪ 0Ȼʹʱ + * 2.1ûлӦ + * 2.1.1 ʱȴ ucAntiBit κ󣬰ӱΪ1ͣȻһԵȵ + * 2.1.2 ûлӦΪ + * 2.2лӦ + */ + if( u16RxBufBitLen == 0 ) + { + // ûлӦ +// if( pstPCD->ucAntiBit == 2 || pstPCD->ucAntiBit == 1 ) + if( pstPCD->ucAntiBit == 2 || pstPCD->ucAntiBit == !g_firstBitValue ) + { + // SELECTframe + if( pstPCD->u16WaitTime ) + { + pstPCD->u16WaitTime--; + return 0; + } + else + { + // ȹ + return -1; + } + } + else + { + // һγԣӱΪ0.pstPCD->ucAntiBit == 0 + // SELECTframe + if( pstPCD->u16WaitTime == 1) + { + // ˣnewbit = 1; +// pstPCD->ucAntiBit = 1; + pstPCD->ucAntiBit = g_firstBitValue == 0 ? 1:0; + pstPCD->u16WaitTime = PCD_WAIT_TIME; + return PCD_ISO14443A_SendANTICOLLISION( pstPCD ); + } + else if( pstPCD->u16WaitTime ) + { + pstPCD->u16WaitTime--; +#ifdef _RFID_DEBUG_ + printf("\nwaitTime = %d.", pstPCD->u16WaitTime ); +#endif + return 0; + } + } + } + + // յSAK. + // ȴSAK + r = ISO14443A_wait_SAK( aucRxBuf, u16RxBufBitLen, &pstPCD->ucSAK ); + if( r < 0 ) + { + return r; + } + printf("\nRx SAK[0x%02x].", pstPCD->ucSAK); + fprintf( g_fpDebug, "\nRx SAK[0x%02x].", pstPCD->ucSAK); + + // ǷUID. + if( ( pstPCD->ucSAK >> 2 ) & 0x01 ) + { + // UID. + pcd_postMessage( &pstPCD->ucSAK, 8, ISO_14443_CMD_SAK, "continue anti" ); + pstPCD->ucStatus = ISO_14443A_PCD_STATE_ANTI; + pcd_updateStatus( pstPCD->ucStatus - ISO_14443A_PCD_STATE_BEGIN ); + + // ANTI. + pstPCD->ucSEL = ( pstPCD->ucCmpBits == 32 )?ISO_14443_CMD_SEL_CL2:ISO_14443_CMD_SEL_CL3; + + r = ISO14443A_AnticollisionFrame_req( pstPCD->ucSEL, NULL, 0 ); + if( r < 0 ) + { + return r; + } + printf("\n\nTx SELECT(anticollision), waiting anticollision.\nwait"); + fprintf( g_fpDebug, "\n\nTx SELECT(anticollision), waiting anticollision.\nwait"); + } + else + { + // bit3=0; + // תΪEND + // HALT. + { + char uid[200]={0}; + char t[10]; + + strcpy( uid, "uid=" ); + for( int i = pstPCD->ucCmpBits/8-1; i >=0 ; i-- ) + { + if( pstPCD->aucUID[i] != 0x88 ) + { + sprintf( t, "%02X.", pstPCD->aucUID[i]); + strcat( uid, t ); + } + } + pcd_postMessage( &pstPCD->ucSAK, 8, ISO_14443_CMD_SAK, uid ); + } + pstPCD->ucStatus = ISO_14443A_PCD_STATE_OK; + pcd_updateStatus( pstPCD->ucStatus - ISO_14443A_PCD_STATE_BEGIN ); + + ISO14443A_HALT(); + + printf("\nEnd."); + fprintf( g_fpDebug, "\nEnd." ); + } + break; + } + return r; +} + + + + + + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.h new file mode 100644 index 0000000..cdf99b9 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.h @@ -0,0 +1,43 @@ +/** + * \file rfid_iso14443A_pcd.h + * + * + * + */ + +#ifndef _RFID_ISO14443A_PCD_H_ +#define _RFID_ISO14443A_PCD_H_ + +#include "rfid_def.h" +#include "rfid_iso14443A_cmdtx.h" +#include "rfid_iso14443A_cmdrx.h" + +typedef struct ISO_14443A_PCD_tag +{ + UCHAR ucStatus; + UCHAR ucCmpBits; // ǰѾͳȥٸbitˡ + UCHAR ucCLn; // 0/1/2ֱʾ1/2/3UID. + UCHAR ucSEL; // ǰSELֵ. + UCHAR ucSAK; // SAKֵ + UCHAR ucAntiBit; // ײУӵbitĬ2ʾ/ûдڷײС + UINT16 u16WaitTime; // ȥ󣬵ȴ + UCHAR aucUID[12]; // 10ֽ +}ISO_14443A_PCD; + +int PCD_ISO14443A_run( ISO_14443A_PCD *pstPCD ); +int PCD_ISO14443A_process( ISO_14443A_PCD *pstPCD, UCHAR aucRxBuf[], UINT16 u16RxBufBitLen ); +// ͻģ⣺ +// յıʵյı +int PCD_ISO14443A_CollisionEmu( ISO_14443A_PCD *pstPCD, + BYTE byBitLenofFirstByte, BYTE firstByte, + UCHAR aucCmdBuf[], UINT16 u16CmdBitLen ); +// SELECT֡ +int PCD_ISO14443A_SendSELECT( ISO_14443A_PCD *pstPCD ); +// ͷײ֡ +// 1ء +int PCD_ISO14443A_SendANTICOLLISION( ISO_14443A_PCD *pstPCD ); +#endif + + + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.h.bak b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.h.bak new file mode 100644 index 0000000..17f2781 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_pcd.h.bak @@ -0,0 +1,43 @@ +/** + * \file rfid_iso14443A_pcd.h + * + * + * + */ + +#ifndef _RFID_ISO14443A_PCD_H_ +#define _RFID_ISO14443A_PCD_H_ + +#include "rfid_def.h" +#include "rfid_iso14443A_cmdtx.h" +#include "rfid_iso14443A_cmdrx.h" + +typedef struct ISO_14443A_PCD_tag +{ + UCHAR ucStatus; + UCHAR ucCmpBits; // ǰѾͳȥٸbitˡ + UCHAR ucCLn; // 0/1/2ֱʾ1/2/3UID. + UCHAR ucSEL; // ǰSELֵ. + UCHAR ucSAK; // SAKֵ + UCHAR ucAntiBit; // ײУӵbitĬ2ʾ/ûдڷײС + UINT16 u16WaitTime; // ȥ󣬵ȴ + UCHAR aucUID[12]; // 10ֽ +}ISO_14443A_PCD; + +int PCD_ISO14443A_run( ISO_14443A_PCD *pstPCD ); +int PCD_ISO14443A_process( ISO_14443A_PCD *pstPCD, UCHAR aucRxBuf[], UINT16 u16RxBufBitLen ); +// ͻģ⣺ +// յıʵյı +int PCD_ISO14443A_CollisionEmu( ISO_14443A_PCD *pstPCD, + BYTE byBitLenofFirstByte, BYTE firstByte, + UCHAR aucCmdBuf[], UINT16 u16CmdBitLen ); +// SELECT֡ +int PCD_ISO14443A_SendSELECT( ISO_14443A_PCD *pstPCD ); +// ͷײ֡ +// 1ء +int PCD_ISO14443A_SendANTICOLLISION( ISO_14443A_PCD *pstPCD ); +#endif + + + + diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_picc.cpp b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_picc.cpp new file mode 100644 index 0000000..6c35961 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_picc.cpp @@ -0,0 +1,619 @@ +/** + * \file rfid_iso14443A_picc.c + * + * + * \desp ģһŷISO14443AĿ. + */ + +#include +#include "rfid_def.h" +#include "rfid_iso14443A_picc.h" +#include "picc_thread.h" + +#if 0 +int main( int argc, char *argv[] ) +{ + return picc_main( argc, argv ); +} +#endif + +/** + * : + * picc_14443A n xxx1 xxx2 + * n. 濨(10ſ) + * xxx1/xxx2. ţ + */ + +// иʽISO14443A_PICC uidLen UID +int picc_main(int argc, char *argv[] ) +{ + ISO_14443A_PICC stPICC; + + if( argc == 2 ) + { + // нUID + stPICC.ucStatus = ISO_14443A_STATE_POWEROFF; + stPICC.ucCmpBits = 0; + switch( strlen( argv[1] )) + { + case 8: + stPICC.ucCLn = 0; + break; + case 14: + stPICC.ucCLn = 1; + break; + case 20: + stPICC.ucCLn = 2; + break; + default: + printf("\nuid invalid.\n"); + return -1; + } +// stPICC.ucCLn = strlen( argv[2] ); // atoi(argv[1]); + if( GetUIDFromString( &stPICC, argv[1] ) < 1 ) + { + printf("\nInvalid command line."); + } + } + else + { + printf("input: iso14443A_picc uidLen(0/1/2) uid(HEX).\n" ); + stPICC.ucStatus = ISO_14443A_STATE_POWEROFF; + stPICC.ucCmpBits = 0; + stPICC.ucCLn = 2; //atoi(argv[1]); + stPICC.aucUID[0] = 0x12; + stPICC.aucUID[1] = 0x34; + stPICC.aucUID[2] = 0x56; + stPICC.aucUID[3] = 0x78; + + stPICC.aucUID[4] = 0x88; + stPICC.aucUID[5] = 0x90; + stPICC.aucUID[6] = 0x91; + stPICC.aucUID[7] = 0x92; + + stPICC.aucUID[8] = 0x88; + stPICC.aucUID[9] = 0xA0; + stPICC.aucUID[10] = 0xA1; + stPICC.aucUID[11] = 0xA2; + + //return 0; + } + + /** + * ʼѭ + */ + stPICC.ucStatus = ISO_14443A_STATE_IDLE; + + /** + * ӡPICCϢ. + */ + { + int l1, l2, i; + + switch( stPICC.ucCLn ) + { + case 0: + l1 = 32; + l2 = 4; + break; + case 1: + l1 = 56; + l2 = 8; + break; + case 2: + l1 = 80; + l2 = 12; + break; + } + printf("\nPICC: uid length = %d, UID: ", l1/8 ); + for( i = 0; i < l2; i++ ) + { + if( stPICC.aucUID[i] != 0x88 ) + { + printf("0x%02X.", stPICC.aucUID[i]); + } + } + } + PICC_ISO14443A_run( &stPICC ); + printf("\n\nEnd, press 'q' to end.\n"); + + while(1) + { + char c = getchar(); + if( c == 'q' ) + { + break; + } + } + return 1; +} + +int GetUIDFromString( ISO_14443A_PICC *pstPICC, char *szUID ) +{ + int i, j, k, l; + char c; + + memset( pstPICC->aucUID, 0x00, 12 ); + + switch( pstPICC->ucCLn ) + { + case 0: + l = 4; // 0,1,2,3; + memset( pstPICC->aucUID + 4, 0x88, 8 ); + break; + case 1: + l = 7; + pstPICC->aucUID[0] = 0x88; // x 0,1,2, 3,4,5,6 + memset( pstPICC->aucUID + 8, 0x88, 4 ); + break; + case 2: + // x 0,1,2, x,3,4,5, 6,7,8,9 + l = 10; + pstPICC->aucUID[0] = 0x88; + pstPICC->aucUID[4] = 0x88; + break; + default: + return -1; + } + + k = strlen( szUID ); + if( k != l * 2 ) + { + return -1; + } + + // + j = k-1; + i = 0; + while( j >= 0 ) + { + if( pstPICC->aucUID[i] == 0x88 ) + { + i++; + continue; + } + + c = szUID[j]; + if( c >= 'A' && c <= 'F' ) + { + c = c-'A' + 10; + } + else if( c >= 'a' && c <= 'f' ) + { + c = c - 'a' + 10; + } + else if( c >= '0' && c <= '9' ) + { + c = c - '0'; + } + + if( (j % 2) == 0 ) + { + pstPICC->aucUID[i] |= c << 4; + i++; + } + else + { + pstPICC->aucUID[i] |= c; + } + j--; + } + return 1; +} + +int PICC_ISO14443A_run(ISO_14443A_PICC *pstPICC) +{ + UCHAR aucRxBuf[256]; + UINT16 u16BufLen = 256; + int len, rtn; + + printf("\nIDLE:\n\tWaiting REQA......"); + while( 1 ) + { + // ݲ + len = RFID_Card_Rx( u16BufLen, aucRxBuf ); + if( len > 0 ) + { + rtn = PICC_ISO14443A_process( pstPICC, aucRxBuf, len ); + } + else + { +// sleep( 1000 ); + } + + if( rtn == -100 ) + { + return 1; + } + } + return 1; +} + +/** + * ÿPICC״̬. + * + * ucPICCId: 0ʼ + * + */ + +int PICC_ISO14443A_process( ISO_14443A_PICC *pstPICC, BYTE abyRxBuf[], UINT16 u16BitLen ) +{ + UCHAR aucRxCmd[32]; // ߷ + UINT16 u16RxBitLen; + int r; + + switch( pstPICC->ucStatus ) + { + case ISO_14443A_STATE_POWEROFF: + // ڣ + break; + case ISO_14443A_STATE_IDLE: + /** + * REQA + */ + // printf("\nWaiting REQA..."); + r = ISO14443A_wait_REQA( abyRxBuf, u16BitLen ); + if( r > 0 ) + { + printf("\n\tRx REQA. Tx ATQA. "); + picc_postMessage( abyRxBuf, u16BitLen, ISO_14443_CMD_REQA, "Rx REQA. Tx ATQA." ); + + ISO14443A_ATQA( pstPICC->ucCLn ); + pstPICC->ucStatus = ISO_14443A_STATE_READY; + printf("\n\nREADY:\n\tWaiting SELECT(anticollision)......"); + } + // зREQA. + break; + case ISO_14443A_STATE_READY: + /** + * ANTICOLLISION + */ + //printf("\nWaiting anticollision..."); + r = ISO14443A_wait_anticollisionFrame_req( abyRxBuf, u16BitLen, aucRxCmd, &u16RxBitLen ); + if( r >= 16 ) // 16 + { + BYTE sel, nvb; + int m, n, l; + + sel = aucRxCmd[0]; + // selǷϷѾйˣڴ˾Ͳˡ + if( ( sel != ISO_14443_CMD_SEL_CL1 ) && ( sel != ISO_14443_CMD_SEL_CL2 ) && ( sel != ISO_14443_CMD_SEL_CL3 )) + { + return -1; + } + nvb = aucRxCmd[1]; + + // nvbж֡ + m = ( nvb >> 4 ) & 0x0F; + n = nvb &0x0F; + + l = m * 8; + if( n != 0 ) + { + l -= ( 8 - n ); + } + if( aucRxCmd[1] == 0x70 ) + { + // SELECT. + if( l != u16RxBitLen - 16 ) + { + return -1; + } + } + else + { + if( l != u16RxBitLen ) + { + return -1; + } + } + // ֡û. + printf("\n\tRx %s", (l != u16RxBitLen) ? "SELECT":"anticollision."); + printf("\n\t\tSEL: 0x%02X, NVB = 0x%02x.", sel, nvb ); + + // anticollision֡ + if( aucRxCmd[1] == 0x70 ) // nvb. + { + // SELECT + r = PICC_ISO14443A_PICC_select( pstPICC, aucRxCmd, u16RxBitLen ); + if( r < 0 ) + { + printf(" \n\t\t------It's not my UID. do nothing." ); + picc_postMessage( aucRxCmd, u16RxBitLen, aucRxCmd[0], "Rx SELECT, not my UID. do nothing." ); + } + else + { + printf("\n\t\tSELECT frame. Tx. SAK.[0x%02X]." , pstPICC->ucSAK ); + + picc_postMessage( aucRxCmd, u16RxBitLen, aucRxCmd[0], "Rx SELECT, Tx SAK" ); + picc_postMessage((UCHAR *)&pstPICC->ucSAK, 8, ISO_14443_CMD_SAK); + + if( pstPICC->ucSAK == 0x00 ) + { + printf("\nACTIVE: \n\tWaiting HALT..."); + } + else + { + printf("\n\t\tWaiting anticollision..."); + } + } + } + else + { + printf("\n\t\tAnticollision frame. Tx. anticollision." ); + +// r = PICC_ISO14443A_PICC_anticollision( pstPICC, aucRxCmd, u16RxBitLen ); + BYTE txBuf[200]; + int txBufBitLen; + r = PICC_ISO14443A_PICC_anticollision( pstPICC, aucRxCmd, u16RxBitLen, txBuf, &txBufBitLen ); + + if( r < 0 ) + { + picc_postMessage( aucRxCmd, u16RxBitLen, aucRxCmd[0], "Rx ANTI, not my UID. do nothing." ); + printf(" \n\t:It's not my UID. do nothing." ); + } + else + { + picc_postMessage( aucRxCmd, u16RxBitLen, aucRxCmd[0], "Rx ANTI, Send ANTI." ); + picc_postMessage( txBuf, txBufBitLen, ISO_14443_CMD_SEL_CLx ); + printf("\n\t\tWaiting anticollision..."); + } + } + } + break; + case ISO_14443A_STATE_ACTIVE: + /** + * HALT + * + */ + // printf("\nWaiting halt..."); + r = ISO14443A_wait_HALT( abyRxBuf, u16BitLen ); + if( r > 0 ) + { + // κ + printf("\n\t\tRx HALT. Tx nothing. "); + + picc_postMessage( abyRxBuf, u16BitLen, ISO_14443_CMD_HALT, "Rx HALT. Tx nothing. "); + pstPICC->ucStatus = ISO_14443A_STATE_HALT; + printf("\nHALT. \n\twaiting WUPA..."); + } + else + { + printf("\n\t\tNot HALT cmd, continue waiting."); + } + break; + case ISO_14443A_STATE_HALT: + /** + * WUPA + * + */ + // printf("\nWaiting WUPA..."); + r = ISO14443A_wait_WUPA( abyRxBuf, u16BitLen ); + if( r > 0 ) + { + printf("\n\tRx WUPA, Tx ATQA."); + picc_postMessage( abyRxBuf, u16BitLen, ISO_14443_CMD_WUPA, "Rx WUPA, Tx ATQA." ); + + ISO14443A_ATQA( pstPICC->ucCLn ); + printf("\nREADY. Waiting anticollision"); + pstPICC->ucStatus = ISO_14443A_STATE_READY; + } + else + { + printf("\n\t\tNot WUPA cmd, continue waiting..."); + return -100; + } + break; + } + + picc_updateStatus( pstPICC->ucStatus - ISO_14443A_STATE_POWEROFF ); + + return r; +} + +// piccյSELECT. +int PICC_ISO14443A_PICC_anticollision( ISO_14443A_PICC *pstPICC, BYTE abyRxCmd[], UINT16 u16CmdBitLen, BYTE aTxBuf[], int *pTxButBitLen ) +{ + BYTE sel, CL, bcc; + int uidBitLen; + int m, n; + int i; + int byoffset, btoffset; + + // һֽеbit Lenڷײ֡Ҫ + BYTE byBitLenofFirstByte; + BYTE byFirstByte; + BYTE abyUID[4]; + UINT16 u16UIDBitLen; + BYTE mask[]={0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF}; + + // 򻯷u16CmdBitLen % 8 Ƿ n ȡ + sel = abyRxCmd[0]; + + // ʼ֯ص֡. + + // PCDͳUIDıس. + uidBitLen = u16CmdBitLen - 16; // sel+nvb. + + if( sel == ISO_14443_CMD_SEL_CL1 ) + { + CL = 0; + } + else if( sel == ISO_14443_CMD_SEL_CL2 ) + { + CL = 4; + } + else // ISO_14443_CMD_SEL_CL3. + { + CL = 8; + } + + // ȽǷͬͬʱ鷵ذ + // ȱȽbitȫȷģ + { + printf("\n\t\tMY UID:"); + for( i = 0; i < 32; i++ ) + { + byoffset = i / 8; + btoffset = i % 8; + printf("%d", (pstPICC->aucUID[CL+byoffset] >> btoffset) & 0x01 ); + if( i % 4 == 3 ) + { + printf("."); + } + } + printf("\n\t\tRX UID:"); + for( i = 0; i < uidBitLen; i++ ) + { + byoffset = i / 8; + btoffset = i % 8; + printf("%d", (abyRxCmd[2+byoffset] >> btoffset) & 0x01); + if( i % 4 == 3 ) + { + printf("."); + } + + if( ((abyRxCmd[2+byoffset] >> btoffset) & 0x01) + != (( pstPICC->aucUID[CL+byoffset] >> btoffset) & 0x01) ) + { + return -1; // + } + } + // ǰͬ + // + + // uidBitLenڼ㷢ͷ. + uidBitLen = 32 - uidBitLen; + byBitLenofFirstByte = uidBitLen % 8; + + // · + m = uidBitLen / 8; // ֽ + n = CL+3; + u16UIDBitLen = 0; + for( i = m-1; i >= 0; i-- ) + { + abyUID[i] = pstPICC->aucUID[n--]; + u16UIDBitLen += 8; + } + if( byBitLenofFirstByte != 0 ) + { + byFirstByte = ( pstPICC->aucUID[n] >> (8-byBitLenofFirstByte)) & mask[byBitLenofFirstByte-1]; // ʵѾ. + } + else + { + byFirstByte = 0x00; + } + + // bcc + bcc = 0x00; + for( i = 0; i < 4; i++ ) + { + bcc = bcc ^ pstPICC->aucUID[i+CL]; + } + } + + { + int k = 0; + int txLen = u16UIDBitLen + 8 + byBitLenofFirstByte; + if( byBitLenofFirstByte != 0 ) + { + aTxBuf[k++] = byFirstByte; + } + + for( int i = 0; i < u16UIDBitLen/8; i++ ) + { + aTxBuf[k++] = abyUID[i]; + } + aTxBuf[k] = bcc; + *pTxButBitLen = txLen; +// picc_postMessage( txBuf, txLen, ISO_14443_CMD_SEL_CLx ); + } + return ISO14443A_AnticollisionFrame_rsp(byBitLenofFirstByte, byFirstByte, abyUID, u16UIDBitLen, bcc); +} + +int PICC_ISO14443A_PICC_select( ISO_14443A_PICC *pstPICC, BYTE abyRxCmd[], UINT16 u16CmdBitLen ) +{ + BYTE sel, bcc, sak; + BYTE abyCRC[2]; + int i, CL; + + sel = abyRxCmd[0]; + //nvb = abyRxCmd[1]; // һΪ0x70 + + // SELECT frame ȣSEL + NVB + UID[4] + BCC + CRC[2] + if( u16CmdBitLen != 72 ) + { + return -1; + } + + + // BCCǷȷ + bcc = 0x00; + for( i = 2; i < 6; i++ ) + { + bcc = bcc ^ abyRxCmd[i]; + } + if( bcc != abyRxCmd[6] ) + { + return -1; + } + // CRCǷȷ + ISO14443A_CRC( abyRxCmd, 7, &abyCRC[1], &abyCRC[0] ); + if( abyRxCmd[7] != abyCRC[0] || abyRxCmd[8] != abyCRC[1] ) + { + return -1; + } + + // ȷ + + sak = 0; + switch( sel ) + { + case ISO_14443_CMD_SEL_CL1: + if( pstPICC->ucCLn == 0 ) + { + sak = 0x00; + } + else + { + sak = 1 << 2; + } + CL = 0; + break; + case ISO_14443_CMD_SEL_CL2: + if( pstPICC->ucCLn == 1 ) + { + sak = 0x00; + } + else + { + sak = 1 << 2; + } + CL = 4; + break; + case ISO_14443_CMD_SEL_CL3: + sak = 0x00; + CL = 8; + break; + } + + // UIDǷҵUID. + printf("\n\t\tMY UID[RX UID]: "); + for( i = 0; i < 4; i++ ) + { + printf("%02x[%02x]", pstPICC->aucUID[CL+i], abyRxCmd[2+i] ); + if( abyRxCmd[2+i] != pstPICC->aucUID[CL+i] ) + { + return -1; + } + } + + // SAK + if( sak == 0x00 ) + { + pstPICC->ucStatus = ISO_14443A_STATE_ACTIVE; + } + pstPICC->ucSAK = sak; + + return ISO14443A_SAK(sak); +} diff --git a/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_picc.h b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_picc.h new file mode 100644 index 0000000..60f9d12 --- /dev/null +++ b/Labs/Lab2/requirements/src/rfidsrc/rfid_iso14443A_picc.h @@ -0,0 +1,33 @@ +/** + * \file rfid_iso14443A_picc.h + * + * + * + */ + +#ifndef _RFID_ISO14443A_PICC_H_ +#define _RFID_ISO14443A_PICC_H_ + +#include "rfid_def.h" +#include "rfid_iso14443A_cmdtx.h" +#include "rfid_iso14443A_cmdrx.h" + + +typedef struct ISO_14443A_PICC_tag +{ + UCHAR ucStatus; + UCHAR ucCmpBits; // ǰѾͳȥٸbitˡ + UCHAR ucCLn; // 0/1/2ֱʾ1/2/3UID. + UCHAR ucSAK; // ͵sak + UCHAR aucUID[12]; // 10ֽ +}ISO_14443A_PICC; + +int PICC_ISO14443A_run(ISO_14443A_PICC *pstPICC); +int PICC_ISO14443A_process( ISO_14443A_PICC *pstPICC, BYTE abyRxBuf[], UINT16 u16BitLen ); + +int PICC_ISO14443A_PICC_anticollision( ISO_14443A_PICC *pstPICC, BYTE abyRxCmd[], UINT16 u16CmdBitLen ); +int PICC_ISO14443A_PICC_anticollision( ISO_14443A_PICC *pstPICC, BYTE abyRxCmd[], UINT16 u16CmdBitLen, BYTE aTxBuf[], int *pTxButBitLen ); +int PICC_ISO14443A_PICC_select( ISO_14443A_PICC *pstPICC, BYTE abyRxCmd[], UINT16 u16CmdBitLen ); +int GetUIDFromString( ISO_14443A_PICC *pstPICC, char *szUID ); + +#endif \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/rfidsrc/udp广播与组播.docx b/Labs/Lab2/requirements/src/rfidsrc/udp广播与组播.docx new file mode 100644 index 0000000..5c7578a Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/udp广播与组播.docx differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/~$p广播与组播.docx b/Labs/Lab2/requirements/src/rfidsrc/~$p广播与组播.docx new file mode 100644 index 0000000..14153b8 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/~$p广播与组播.docx differ diff --git a/Labs/Lab2/requirements/src/rfidsrc/新建 Microsoft Word 文档.docx b/Labs/Lab2/requirements/src/rfidsrc/新建 Microsoft Word 文档.docx new file mode 100644 index 0000000..1cc6452 Binary files /dev/null and b/Labs/Lab2/requirements/src/rfidsrc/新建 Microsoft Word 文档.docx differ diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec.sdf b/Labs/Lab2/requirements/src/usp_codec/usp_codec.sdf new file mode 100644 index 0000000..bacfe78 Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_codec/usp_codec.sdf differ diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec.sln b/Labs/Lab2/requirements/src/usp_codec/usp_codec.sln new file mode 100644 index 0000000..d7a2a71 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usp_codec", "usp_codec\usp_codec.vcxproj", "{5A01BFD9-9B0C-4C53-9BA4-63E9DF30A69C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5A01BFD9-9B0C-4C53-9BA4-63E9DF30A69C}.Debug|Win32.ActiveCfg = Debug|Win32 + {5A01BFD9-9B0C-4C53-9BA4-63E9DF30A69C}.Debug|Win32.Build.0 = Debug|Win32 + {5A01BFD9-9B0C-4C53-9BA4-63E9DF30A69C}.Release|Win32.ActiveCfg = Release|Win32 + {5A01BFD9-9B0C-4C53-9BA4-63E9DF30A69C}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec.suo b/Labs/Lab2/requirements/src/usp_codec/usp_codec.suo new file mode 100644 index 0000000..dd703de Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_codec/usp_codec.suo differ diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/Debug/usp_codec.Build.CppClean.log b/Labs/Lab2/requirements/src/usp_codec/usp_codec/Debug/usp_codec.Build.CppClean.log new file mode 100644 index 0000000..897fde9 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/Debug/usp_codec.Build.CppClean.log @@ -0,0 +1,33 @@ +E:\VSRFID\USP_CODEC\DEBUG\USP_CODEC.EXE +E:\VSRFID\USP_CODEC\DEBUG\USP_CODEC.ILK +E:\VSRFID\USP_CODEC\DEBUG\USP_CODEC.PDB +E:\vsrfid\usp_codec\usp_codec\Debug\cl.command.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\CL.read.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\CL.write.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link.7164.read.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link.7164.write.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link.7164-cvtres.read.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link.7164-cvtres.write.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link.command.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link.read.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link.write.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link-cvtres.read.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\link-cvtres.write.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\mt.command.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\mt.read.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\mt.write.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\rc.command.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\rc.read.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\rc.write.1.tlog +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\RFID_ISO14443A_CODEC.OBJ +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\STDAFX.OBJ +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\USP_CODEC.EXE.EMBED.MANIFEST +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\USP_CODEC.EXE.EMBED.MANIFEST.RES +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\USP_CODEC.EXE.INTERMEDIATE.MANIFEST +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\USP_CODEC.OBJ +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\USP_CODEC.PCH +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\USP_CODEC.RES +E:\vsrfid\usp_codec\usp_codec\Debug\usp_codec.write.1.tlog +E:\vsrfid\usp_codec\usp_codec\Debug\usp_codec_manifest.rc +E:\vsrfid\usp_codec\usp_codec\Debug\vc100.idb +E:\VSRFID\USP_CODEC\USP_CODEC\DEBUG\VC100.PDB diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/Debug/usp_codec.log b/Labs/Lab2/requirements/src/usp_codec/usp_codec/Debug/usp_codec.log new file mode 100644 index 0000000..b7791f9 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/Debug/usp_codec.log @@ -0,0 +1,9 @@ +生成启动时间为 2018/11/26 9:57:47。 + 1>项目“E:\vsrfid\usp_codec\usp_codec\usp_codec.vcxproj”在节点 2 上(clean 个目标)。 + 1>_PrepareForClean: + 正在删除文件“Debug\usp_codec.lastbuildstate”。 + 1>已完成生成项目“E:\vsrfid\usp_codec\usp_codec\usp_codec.vcxproj”(clean 个目标)的操作。 + +生成成功。 + +已用时间 00:00:00.23 diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/ReadMe.txt b/Labs/Lab2/requirements/src/usp_codec/usp_codec/ReadMe.txt new file mode 100644 index 0000000..5b91319 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + 控制台应用程序:usp_codec 项目概述 +======================================================================== + +应用程序向导已为您创建了此 usp_codec 应用程序。 + +本文件概要介绍组成 usp_codec 应用程序的每个文件的内容。 + + +usp_codec.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件, + 其中包含生成该文件的 Visual C++ + 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +usp_codec.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 + 它包含有关项目文件与筛选器之间的关联信息。 在 IDE + 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。 + 例如,“.cpp”文件与“源文件”筛选器关联。 + +usp_codec.cpp + 这是主应用程序源文件。 + +///////////////////////////////////////////////////////////////////////////// +应用程序向导创建了下列资源: + +usp_codec.rc + 这是程序使用的所有 Microsoft Windows 资源的列表。 它包括 RES + 子目录中存储的图标、位图和光标。 此文件可以直接在 Microsoft Visual C++ + 中进行编辑。 + +Resource.h + 这是标准头文件,可用于定义新的资源 ID。 + Microsoft Visual C++ 将读取并更新此文件。 + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h,StdAfx.cpp + 这些文件用于生成名为 usp_codec.pch 的预编译头 (PCH) 文件和 + 名为 StdAfx.obj 的预编译类型文件。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/Resource.h b/Labs/Lab2/requirements/src/usp_codec/usp_codec/Resource.h new file mode 100644 index 0000000..4ee6809 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/Resource.h @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by usp_codec.rc +// + +#define IDS_APP_TITLE 103 + +// ¶һĬֵ +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/stdafx.cpp b/Labs/Lab2/requirements/src/usp_codec/usp_codec/stdafx.cpp new file mode 100644 index 0000000..95e17a7 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// usp_codec.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H +// κĸͷļڴļ diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/stdafx.h b/Labs/Lab2/requirements/src/usp_codec/usp_codec/stdafx.h new file mode 100644 index 0000000..4721a60 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/stdafx.h @@ -0,0 +1,32 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +#include +#include +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString 캯ʽ + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Windows ͷļųʹõϢ +#endif + +#include +#include // MFC ͱ׼ +#include // MFC չ +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC Internet Explorer 4 ؼ֧ +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC Windows ؼ֧ +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include + + + +// TODO: ڴ˴óҪͷļ diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/targetver.h b/Labs/Lab2/requirements/src/usp_codec/usp_codec/targetver.h new file mode 100644 index 0000000..7a7d2c8 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.cpp b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.cpp new file mode 100644 index 0000000..9706361 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.cpp @@ -0,0 +1,143 @@ +// usp_codec.cpp : ̨Ӧóڵ㡣 +// + +#include "stdafx.h" +#include "usp_codec.h" +#include "..\..\rfidsrc\class\clUSPTrans.h" +#include "..\..\rfidsrc\rfid_iso14443A_codec.h" + + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// ΨһӦó + +CWinApp theApp; + +using namespace std; +using namespace VSPR_OF_ISO14443A; +int codec_main(); + + +int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) +{ + int nRetCode = 0; + + HMODULE hModule = ::GetModuleHandle(NULL); + + if (hModule != NULL) + { + // ʼ MFC ʧʱʾ + if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0)) + { + // TODO: ĴԷҪ + _tprintf(_T(": MFC ʼʧ\n")); + nRetCode = 1; + } + else + { + // TODO: ڴ˴ΪӦóΪд롣 + codec_main(); + } + } + else + { + // TODO: ĴԷҪ + _tprintf(_T(": GetModuleHandle ʧ\n")); + nRetCode = 1; + } + + return nRetCode; +} + +using namespace VSPR_OF_ISO14443A; +int codec_main() +{ + clUSPTransceiver uspTrans; // ͨŶ + UCHAR rxbuf[100], rxcmd; //  + UCHAR txbuf[100], txcmd; //  + int len, txbitLen; + UINT16 u16rxbitlen, u16txbitlen; + + uspTrans.Init( "127.0.0.1" ); + int stop = 0; + + while(!stop) + { + // + len = uspTrans.Recv( rxbuf, 100, &rxcmd ); + + // д룬֯ + switch( rxcmd ) + { + case VSPR_CMD_CODE_1BIT_REQ: + txcmd = VSPR_CMD_CODE_1BIT_RSP; + txbuf[0]= rxbuf[0]; + if( rxbuf[0] == 1 ) + { + txbuf[1] = RFID_Code_Miller( rxbuf[1], rxbuf[2]); + } + else + { + txbuf[1] = RFID_Code_Manchester( rxbuf[2] ); + } + txbuf[1] = txbuf[1] << 4; + txbitLen = 12; + break; + case VSPR_CMD_CODE_SOF_REQ: + txcmd = VSPR_CMD_CODE_SOF_RSP; + txbuf[0]= rxbuf[0]; + if( rxbuf[0] == 1 ) + { + // pcd + txbuf[1] = 0x70; // ISO14443A_PCD_SOF; + } + else + { + // picc + txbuf[1] = 0xc0; // ISO14443A_PICC_SOF; + } + txbitLen = 12; + break; + case VSPR_CMD_CODE_EOF_REQ: + txcmd = VSPR_CMD_CODE_EOF_RSP; + txbuf[0]= rxbuf[0]; + if( rxbuf[0] == 1 ) + { + txbuf[1] = RFID_Code_Miller( rxbuf[1], 0 ); + } + else + { + txbuf[1] = ISO14443A_PICC_EOF; + } + txbuf[1] = txbuf[1] << 4; + txbitLen = 12; + break; + case VSPR_CMD_CODE_FRAME_REQ: + txcmd = VSPR_CMD_CODE_FRAME_RSP; + txbuf[0]= rxbuf[0]; + if( rxbuf[0] == 1 ) + { + ISO14443A_PCD_Code( rxbuf+1, len-8, txbuf+1, &u16txbitlen ); + } + else + { + ISO14443A_PICC_Code( rxbuf+1, len-8, txbuf+1, &u16txbitlen ); + } + txbitLen = u16txbitlen + 8; + break; + default: + stop = 1; + break; + } + + // Ѿִؽ. + if( stop == 0 ) + { + uspTrans.Send( txbuf, txbitLen, txcmd ); + } + } + return 0; +} diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.h b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.h new file mode 100644 index 0000000..d00d47e --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.h @@ -0,0 +1,3 @@ +#pragma once + +#include "resource.h" diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.rc b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.rc new file mode 100644 index 0000000..eb7d198 Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.rc differ diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj new file mode 100644 index 0000000..ae3f5bd --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj @@ -0,0 +1,105 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {5A01BFD9-9B0C-4C53-9BA4-63E9DF30A69C} + Win32Proj + usp_codec + + + + Application + true + Unicode + Dynamic + + + Application + false + true + Unicode + Dynamic + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + + NotUsing + + + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj.filters b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj.filters new file mode 100644 index 0000000..5205e43 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj.filters @@ -0,0 +1,62 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj.user b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_codec/usp_codec/usp_codec.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame.sdf b/Labs/Lab2/requirements/src/usp_frame/usp_frame.sdf new file mode 100644 index 0000000..39e2e2d Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_frame/usp_frame.sdf differ diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame.sln b/Labs/Lab2/requirements/src/usp_frame/usp_frame.sln new file mode 100644 index 0000000..8533999 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usp_frame", "usp_frame\usp_frame.vcxproj", "{961AC1D0-19E4-4398-B1D2-2BA98D5C8395}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {961AC1D0-19E4-4398-B1D2-2BA98D5C8395}.Debug|Win32.ActiveCfg = Debug|Win32 + {961AC1D0-19E4-4398-B1D2-2BA98D5C8395}.Debug|Win32.Build.0 = Debug|Win32 + {961AC1D0-19E4-4398-B1D2-2BA98D5C8395}.Release|Win32.ActiveCfg = Release|Win32 + {961AC1D0-19E4-4398-B1D2-2BA98D5C8395}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame.suo b/Labs/Lab2/requirements/src/usp_frame/usp_frame.suo new file mode 100644 index 0000000..8e29295 Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_frame/usp_frame.suo differ diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/Debug/usp_frame.log b/Labs/Lab2/requirements/src/usp_frame/usp_frame/Debug/usp_frame.log new file mode 100644 index 0000000..2705fa8 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/Debug/usp_frame.log @@ -0,0 +1,5 @@ +生成启动时间为 2018/11/26 9:58:05。 + +生成成功。 + +已用时间 00:00:00.01 diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/ReadMe.txt b/Labs/Lab2/requirements/src/usp_frame/usp_frame/ReadMe.txt new file mode 100644 index 0000000..a99b85a --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + 控制台应用程序:usp_frame 项目概述 +======================================================================== + +应用程序向导已为您创建了此 usp_frame 应用程序。 + +本文件概要介绍组成 usp_frame 应用程序的每个文件的内容。 + + +usp_frame.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件, + 其中包含生成该文件的 Visual C++ + 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +usp_frame.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 + 它包含有关项目文件与筛选器之间的关联信息。 在 IDE + 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。 + 例如,“.cpp”文件与“源文件”筛选器关联。 + +usp_frame.cpp + 这是主应用程序源文件。 + +///////////////////////////////////////////////////////////////////////////// +应用程序向导创建了下列资源: + +usp_frame.rc + 这是程序使用的所有 Microsoft Windows 资源的列表。 它包括 RES + 子目录中存储的图标、位图和光标。 此文件可以直接在 Microsoft Visual C++ + 中进行编辑。 + +Resource.h + 这是标准头文件,可用于定义新的资源 ID。 + Microsoft Visual C++ 将读取并更新此文件。 + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h,StdAfx.cpp + 这些文件用于生成名为 usp_frame.pch 的预编译头 (PCH) 文件和 + 名为 StdAfx.obj 的预编译类型文件。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/Resource.h b/Labs/Lab2/requirements/src/usp_frame/usp_frame/Resource.h new file mode 100644 index 0000000..d15ebea --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/Resource.h @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by usp_frame.rc +// + +#define IDS_APP_TITLE 103 + +// ¶һĬֵ +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/stdafx.cpp b/Labs/Lab2/requirements/src/usp_frame/usp_frame/stdafx.cpp new file mode 100644 index 0000000..fb3a53e --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// usp_frame.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H +// κĸͷļڴļ diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/stdafx.h b/Labs/Lab2/requirements/src/usp_frame/usp_frame/stdafx.h new file mode 100644 index 0000000..4721a60 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/stdafx.h @@ -0,0 +1,32 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +#include +#include +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString 캯ʽ + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Windows ͷļųʹõϢ +#endif + +#include +#include // MFC ͱ׼ +#include // MFC չ +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC Internet Explorer 4 ؼ֧ +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC Windows ؼ֧ +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include + + + +// TODO: ڴ˴óҪͷļ diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/targetver.h b/Labs/Lab2/requirements/src/usp_frame/usp_frame/targetver.h new file mode 100644 index 0000000..7a7d2c8 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.cpp b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.cpp new file mode 100644 index 0000000..8b24a87 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.cpp @@ -0,0 +1,46 @@ +// usp_frame.cpp : ̨Ӧóڵ㡣 +// + +#include "stdafx.h" +#include "usp_frame.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// ΨһӦó + +CWinApp theApp; + +using namespace std; + +int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) +{ + int nRetCode = 0; + + HMODULE hModule = ::GetModuleHandle(NULL); + + if (hModule != NULL) + { + // ʼ MFC ʧʱʾ + if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0)) + { + // TODO: ĴԷҪ + _tprintf(_T(": MFC ʼʧ\n")); + nRetCode = 1; + } + else + { + // TODO: ڴ˴ΪӦóΪд롣 + } + } + else + { + // TODO: ĴԷҪ + _tprintf(_T(": GetModuleHandle ʧ\n")); + nRetCode = 1; + } + + return nRetCode; +} diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.h b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.h new file mode 100644 index 0000000..d00d47e --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.h @@ -0,0 +1,3 @@ +#pragma once + +#include "resource.h" diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.rc b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.rc new file mode 100644 index 0000000..e9aa00a Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.rc differ diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj new file mode 100644 index 0000000..f3d13bb --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj @@ -0,0 +1,98 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {961AC1D0-19E4-4398-B1D2-2BA98D5C8395} + Win32Proj + usp_frame + + + + Application + true + Unicode + Dynamic + + + Application + false + true + Unicode + Dynamic + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + + + + + + + + + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj.filters b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj.filters new file mode 100644 index 0000000..d80bedc --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj.filters @@ -0,0 +1,47 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj.user b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_frame/usp_frame/usp_frame.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity.sdf b/Labs/Lab2/requirements/src/usp_parity/usp_parity.sdf new file mode 100644 index 0000000..af6a49c Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_parity/usp_parity.sdf differ diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity.sln b/Labs/Lab2/requirements/src/usp_parity/usp_parity.sln new file mode 100644 index 0000000..c5e3dcc --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usp_parity", "usp_parity\usp_parity.vcxproj", "{8D067B0A-6D75-4003-A637-3FBDFE3E270C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8D067B0A-6D75-4003-A637-3FBDFE3E270C}.Debug|Win32.ActiveCfg = Debug|Win32 + {8D067B0A-6D75-4003-A637-3FBDFE3E270C}.Debug|Win32.Build.0 = Debug|Win32 + {8D067B0A-6D75-4003-A637-3FBDFE3E270C}.Release|Win32.ActiveCfg = Release|Win32 + {8D067B0A-6D75-4003-A637-3FBDFE3E270C}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity.suo b/Labs/Lab2/requirements/src/usp_parity/usp_parity.suo new file mode 100644 index 0000000..e37827e Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_parity/usp_parity.suo differ diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/Debug/usp_parity.Build.CppClean.log b/Labs/Lab2/requirements/src/usp_parity/usp_parity/Debug/usp_parity.Build.CppClean.log new file mode 100644 index 0000000..6fed17d --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/Debug/usp_parity.Build.CppClean.log @@ -0,0 +1,51 @@ +E:\VSRFID\USP_PARITY\DEBUG\USP_PARITY.EXE +E:\VSRFID\USP_PARITY\DEBUG\USP_PARITY.ILK +E:\VSRFID\USP_PARITY\DEBUG\USP_PARITY.PDB +E:\vsrfid\usp_parity\usp_parity\Debug\cl.command.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\CL.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\CL.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.1544.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.1544.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.1544-cvtres.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.1544-cvtres.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.17196.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.17196.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.17196-cvtres.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.17196-cvtres.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.17628.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.17628.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.17628-cvtres.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.17628-cvtres.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.18088.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.18088.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.18088-cvtres.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.18088-cvtres.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.3932.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.3932.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.3932-cvtres.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.3932-cvtres.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.command.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link-cvtres.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\link-cvtres.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\mt.command.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\mt.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\mt.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\rc.command.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\rc.read.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\rc.write.1.tlog +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\RFID_CHK.OBJ +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\RFID_ISO14443A_CODEC.OBJ +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\STDAFX.OBJ +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\USP_PARITY.EXE.EMBED.MANIFEST +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\USP_PARITY.EXE.EMBED.MANIFEST.RES +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\USP_PARITY.EXE.INTERMEDIATE.MANIFEST +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\USP_PARITY.OBJ +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\USP_PARITY.PCH +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\USP_PARITY.RES +E:\vsrfid\usp_parity\usp_parity\Debug\usp_parity.vcxprojResolveAssemblyReference.cache +E:\vsrfid\usp_parity\usp_parity\Debug\usp_parity.write.1.tlog +E:\vsrfid\usp_parity\usp_parity\Debug\usp_parity_manifest.rc +E:\vsrfid\usp_parity\usp_parity\Debug\vc100.idb +E:\VSRFID\USP_PARITY\USP_PARITY\DEBUG\VC100.PDB diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/Debug/usp_parity.log b/Labs/Lab2/requirements/src/usp_parity/usp_parity/Debug/usp_parity.log new file mode 100644 index 0000000..2e61abc --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/Debug/usp_parity.log @@ -0,0 +1,9 @@ +生成启动时间为 2018/11/26 9:58:27。 + 1>项目“E:\vsrfid\usp_parity\usp_parity\usp_parity.vcxproj”在节点 2 上(clean 个目标)。 + 1>_PrepareForClean: + 正在删除文件“Debug\usp_parity.lastbuildstate”。 + 1>已完成生成项目“E:\vsrfid\usp_parity\usp_parity\usp_parity.vcxproj”(clean 个目标)的操作。 + +生成成功。 + +已用时间 00:00:00.20 diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/ReadMe.txt b/Labs/Lab2/requirements/src/usp_parity/usp_parity/ReadMe.txt new file mode 100644 index 0000000..189f8d5 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + 控制台应用程序:usp_parity 项目概述 +======================================================================== + +应用程序向导已为您创建了此 usp_parity 应用程序。 + +本文件概要介绍组成 usp_parity 应用程序的每个文件的内容。 + + +usp_parity.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件, + 其中包含生成该文件的 Visual C++ + 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +usp_parity.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 + 它包含有关项目文件与筛选器之间的关联信息。 在 IDE + 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。 + 例如,“.cpp”文件与“源文件”筛选器关联。 + +usp_parity.cpp + 这是主应用程序源文件。 + +///////////////////////////////////////////////////////////////////////////// +应用程序向导创建了下列资源: + +usp_parity.rc + 这是程序使用的所有 Microsoft Windows 资源的列表。 它包括 RES + 子目录中存储的图标、位图和光标。 此文件可以直接在 Microsoft Visual C++ + 中进行编辑。 + +Resource.h + 这是标准头文件,可用于定义新的资源 ID。 + Microsoft Visual C++ 将读取并更新此文件。 + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h,StdAfx.cpp + 这些文件用于生成名为 usp_parity.pch 的预编译头 (PCH) 文件和 + 名为 StdAfx.obj 的预编译类型文件。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/Resource.h b/Labs/Lab2/requirements/src/usp_parity/usp_parity/Resource.h new file mode 100644 index 0000000..0e13abb --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/Resource.h @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by usp_parity.rc +// + +#define IDS_APP_TITLE 103 + +// ¶һĬֵ +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/stdafx.cpp b/Labs/Lab2/requirements/src/usp_parity/usp_parity/stdafx.cpp new file mode 100644 index 0000000..ed30401 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// usp_parity.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H +// κĸͷļڴļ diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/stdafx.h b/Labs/Lab2/requirements/src/usp_parity/usp_parity/stdafx.h new file mode 100644 index 0000000..4721a60 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/stdafx.h @@ -0,0 +1,32 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +#include +#include +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString 캯ʽ + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Windows ͷļųʹõϢ +#endif + +#include +#include // MFC ͱ׼ +#include // MFC չ +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC Internet Explorer 4 ؼ֧ +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC Windows ؼ֧ +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include + + + +// TODO: ڴ˴óҪͷļ diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/targetver.h b/Labs/Lab2/requirements/src/usp_parity/usp_parity/targetver.h new file mode 100644 index 0000000..7a7d2c8 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.cpp b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.cpp new file mode 100644 index 0000000..8a1b6da --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.cpp @@ -0,0 +1,90 @@ +// usp_parity.cpp : ̨Ӧóڵ㡣 +// + +#include "stdafx.h" +#include "usp_parity.h" +#include "..\..\rfidsrc\class\clUSPTrans.h" +#include "..\..\rfidsrc\rfid_chk.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// ΨһӦó + +CWinApp theApp; + +using namespace std; +using namespace VSPR_OF_ISO14443A; +int usp_main(); +int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) +{ + int nRetCode = 0; + + HMODULE hModule = ::GetModuleHandle(NULL); + + if (hModule != NULL) + { + // ʼ MFC ʧʱʾ + if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0)) + { + // TODO: ĴԷҪ + _tprintf(_T(": MFC ʼʧ\n")); + nRetCode = 1; + } + else + { + // TODO: ڴ˴ΪӦóΪд롣 + usp_main(); + } + } + else + { + // TODO: ĴԷҪ + _tprintf(_T(": GetModuleHandle ʧ\n")); + nRetCode = 1; + } + + return nRetCode; +} + + +using namespace VSPR_OF_ISO14443A; +int usp_main() +{ + clUSPTransceiver uspTrans; + UCHAR rxbuf[100], rxcmd; + UCHAR txbuf[100], txcmd; + int len, txbitLen; + UINT16 u16rxbitlen, u16txbitlen; + + uspTrans.Init( "127.0.0.1" ); + int stop = 0; + + while(!stop) + { + len = uspTrans.Recv( rxbuf, 100, &rxcmd ); + switch( rxcmd ) + { + case VSPR_CMD_ODD_PARITY_REQ: + txcmd = VSPR_CMD_ODD_PARITY_RSP; + txbuf[0] = OldParity( rxbuf[0]); + txbitLen = 8; + break; + case VSPR_CMD_CRC16_REQ: + txcmd = VSPR_CMD_CRC16_RSP; + ISO14443A_CRC( rxbuf, len/8, &txbuf[1], &txbuf[0] ); + txbitLen = 16; + break; + default: + stop = 1; + break; + } + if( stop == 0 ) + { + uspTrans.Send( txbuf, txbitLen, txcmd ); + } + } + return 0; +} diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.h b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.h new file mode 100644 index 0000000..d00d47e --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.h @@ -0,0 +1,3 @@ +#pragma once + +#include "resource.h" diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.rc b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.rc new file mode 100644 index 0000000..fb8ae66 Binary files /dev/null and b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.rc differ diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj new file mode 100644 index 0000000..9688098 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj @@ -0,0 +1,105 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {8D067B0A-6D75-4003-A637-3FBDFE3E270C} + Win32Proj + usp_parity + + + + Application + true + Unicode + Dynamic + + + Application + false + true + Unicode + Dynamic + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + + NotUsing + + + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj.filters b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj.filters new file mode 100644 index 0000000..66ce96f --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj.filters @@ -0,0 +1,62 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj.user b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/Labs/Lab2/requirements/src/usp_parity/usp_parity/usp_parity.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr.sdf b/Labs/Lab2/requirements/src/vspr/vspr.sdf new file mode 100644 index 0000000..6d17e9a Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr.sdf differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr.sln b/Labs/Lab2/requirements/src/vspr/vspr.sln new file mode 100644 index 0000000..58a8568 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vspr", "vspr\vspr.vcxproj", "{52B64FA8-32A0-49D7-BDF5-26AE8BD35E87}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {52B64FA8-32A0-49D7-BDF5-26AE8BD35E87}.Debug|Win32.ActiveCfg = Debug|Win32 + {52B64FA8-32A0-49D7-BDF5-26AE8BD35E87}.Debug|Win32.Build.0 = Debug|Win32 + {52B64FA8-32A0-49D7-BDF5-26AE8BD35E87}.Release|Win32.ActiveCfg = Release|Win32 + {52B64FA8-32A0-49D7-BDF5-26AE8BD35E87}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Labs/Lab2/requirements/src/vspr/vspr.suo b/Labs/Lab2/requirements/src/vspr/vspr.suo new file mode 100644 index 0000000..85da289 Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr.suo differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/CRC16Dlg.cpp b/Labs/Lab2/requirements/src/vspr/vspr/CRC16Dlg.cpp new file mode 100644 index 0000000..d7d47bc --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/CRC16Dlg.cpp @@ -0,0 +1,122 @@ +// CRC16Dlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "CRC16Dlg.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\class\CRC16.h" +#include "..\..\rfidsrc\class\clUSPTrans.h" +#include "mainfrm.h" + +// CCRC16Dlg Ի +using namespace VSPR_OF_ISO14443A; + +IMPLEMENT_DYNAMIC(CCRC16Dlg, CDialogEx) + +CCRC16Dlg::CCRC16Dlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CCRC16Dlg::IDD, pParent) +{ + + m_sFile = _T(""); + m_nLen = 10; + m_btLocalCRCH = 0; + m_btLocalCRCL = 0; + m_btRemoteCRCH = 0; + m_btRemoteCRCL = 0; + m_sLocalCRCH = _T(""); + m_sLocalCRCL = _T(""); + m_sRemoteCRCH = _T(""); + m_sRemoteCRCL = _T(""); +} + +CCRC16Dlg::~CCRC16Dlg() +{ +} + +void CCRC16Dlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_FILE, m_sFile); + DDX_Text(pDX, IDC_EDIT_LEN, m_nLen); + DDV_MinMaxInt(pDX, m_nLen, 1, 100); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_EDIT_LOCAL_CRC_H, m_sLocalCRCH); + DDX_Text(pDX, IDC_EDIT_LOCAL_CRC_L, m_sLocalCRCL); + DDX_Text(pDX, IDC_EDIT_REMOTE_CRC_H, m_sRemoteCRCH); + DDX_Text(pDX, IDC_EDIT_REMOTE_CRC_L, m_sRemoteCRCL); +} + + +BEGIN_MESSAGE_MAP(CCRC16Dlg, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_CAL, &CCRC16Dlg::OnClickedButtonCal) + ON_BN_CLICKED(IDC_BUTTON_FILE, &CCRC16Dlg::OnClickedButtonFile) +END_MESSAGE_MAP() + + +// CCRC16Dlg Ϣ + + +void CCRC16Dlg::OnClickedButtonCal() +{ + // TODO: ڴӿؼ֪ͨ + UpdateData( ); + + if( !m_sFile.IsEmpty( ) ) + { + BYTE abtBuf[200]; + CFile file; + + if( file.Open( m_sFile,CFile::modeRead )) + { + file.Read( abtBuf, m_nLen ); + + CCRC16of14443A crc; + crc.GetCRC16( abtBuf, (UINT16)m_nLen, &m_btLocalCRCH, &m_btLocalCRCL ); + + char str[50]; + sprintf_s(str, "0x%02x[%3d]", m_btLocalCRCH, m_btLocalCRCH ); + m_sLocalCRCH = str; + sprintf_s(str, "0x%02x[%3d]", m_btLocalCRCL, m_btLocalCRCL ); + m_sLocalCRCL = str; + } + if( m_bRemote ) + { + clVSPRTransceiver* pTransceiver = ((CMainFrame *)AfxGetMainWnd())->GetTransceiver(); + if( pTransceiver ) + { + pTransceiver->Send( abtBuf, m_nLen * 8, VSPR_CMD_CRC16_REQ ); + + // ȴ1s. + Sleep(1000 ); + + UCHAR ucCmd; + UINT16 u16BitLen; + u16BitLen = pTransceiver->Recv( abtBuf, 200, &ucCmd ); + if( ( u16BitLen > 0 ) && ( ucCmd == VSPR_CMD_CRC16_RSP ) ) + { + // ʾCRC_H/CRC_L + char str[50]; + sprintf_s(str, "0x%02x[%3d]", abtBuf[1], abtBuf[1] ); + m_sRemoteCRCH = str; + sprintf_s(str, "0x%02x[%3d]", abtBuf[0], abtBuf[0] ); + m_sRemoteCRCL = str; + } + } + } + UpdateData( false ); + } +} + + +void CCRC16Dlg::OnClickedButtonFile() +{ + // TODO: ڴӿؼ֪ͨ + CFileDialog opdlg( true ); + + if( opdlg.DoModal( ) == IDOK ) + { + m_sFile = opdlg.GetPathName( ); + UpdateData( false ); + } +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/CRC16Dlg.h b/Labs/Lab2/requirements/src/vspr/vspr/CRC16Dlg.h new file mode 100644 index 0000000..ecbaf75 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/CRC16Dlg.h @@ -0,0 +1,35 @@ +#pragma once + + +// CCRC16Dlg Ի + +class CCRC16Dlg : public CDialogEx +{ + DECLARE_DYNAMIC(CCRC16Dlg) + +public: + CCRC16Dlg(CWnd* pParent = NULL); // ׼캯 + virtual ~CCRC16Dlg(); + +// Ի + enum { IDD = IDD_DLG_PARITY_CRC }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CString m_sFile; + int m_nLen; + BYTE m_btLocalCRCH; + BYTE m_btLocalCRCL; + BYTE m_btRemoteCRCH; + BYTE m_btRemoteCRCL; + BOOL m_bRemote; + afx_msg void OnClickedButtonCal(); + afx_msg void OnClickedButtonFile(); + CString m_sLocalCRCH; + CString m_sLocalCRCL; + CString m_sRemoteCRCH; + CString m_sRemoteCRCL; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram1.cd b/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram1.cd new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram1.cd @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram2.cd b/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram2.cd new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram2.cd @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram3.cd b/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram3.cd new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/ClassDiagram3.cd @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/Debug/vspr.Build.CppClean.log b/Labs/Lab2/requirements/src/vspr/vspr/Debug/vspr.Build.CppClean.log new file mode 100644 index 0000000..63ab148 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/Debug/vspr.Build.CppClean.log @@ -0,0 +1,171 @@ +E:\VSRFID\VSPR\DEBUG\VSPR.CHM +E:\VSRFID\VSPR\DEBUG\VSPR.EXE +E:\VSRFID\VSPR\DEBUG\VSPR.ILK +E:\VSRFID\VSPR\DEBUG\VSPR.PDB +E:\vsrfid\vspr\vspr\Debug\cl.command.1.tlog +E:\vsrfid\vspr\vspr\Debug\CL.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\CL.write.1.tlog +E:\VSRFID\VSPR\VSPR\DEBUG\CLVSPRCMD.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\CRC16.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\CRC16DLG.OBJ +E:\vsrfid\vspr\vspr\Debug\custombuild.command.1.tlog +E:\vsrfid\vspr\vspr\Debug\custombuild.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\custombuild.write.1.tlog +E:\VSRFID\VSPR\VSPR\DEBUG\DLGANTIFRAMING.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGCMD_SF.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGCMDANTI.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGCMDANTIRSP.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGCMDATQA.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGCMDHALT.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGCMDSAK.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGCODE.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGSHORTFRM.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGSHOWWAVE.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\DLGSTDFRAME.OBJ +E:\vsrfid\vspr\vspr\Debug\link.10284.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10284.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10284-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10284-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10460.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10460.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10460-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10460-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10508.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10508.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10508-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10508-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10564.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10564.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10564-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10564-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10816.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10816.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10816-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10816-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10996.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10996.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10996-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.10996-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11556.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11556.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11556-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11556-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11628.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11628.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11628-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11628-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11924.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11924.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11924-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11924-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11948.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11948.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11948-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.11948-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.12092.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.12092.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.12092-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.12092-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.16768.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.16768.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.16768-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.16768-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.17576.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.17576.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.17576-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.17576-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18556.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18556.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18556-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18556-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18680.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18680.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18680-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18680-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18980.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18980.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18980-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.18980-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.19084.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.19084.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.19084-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.19084-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.20008.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.20008.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.20008-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.20008-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.23748.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.23748.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.23748-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.23748-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.2964.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.2964.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.2964-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.2964-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6220.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6220.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6220-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6220-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6292.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6292.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6292-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6292-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6468.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6468.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6468-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6468-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6712.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6712.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6712-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6712-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6912.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6912.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6912-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.6912-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.7340.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.7340.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.7340-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.7340-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8168.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8168.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8268.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8268.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8268-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8268-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8848.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8848.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8848-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.8848-cvtres.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.command.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\link-cvtres.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\link-cvtres.write.1.tlog +E:\VSRFID\VSPR\VSPR\DEBUG\MAINFRM.OBJ +E:\vsrfid\vspr\vspr\Debug\mt.command.1.tlog +E:\vsrfid\vspr\vspr\Debug\mt.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\mt.write.1.tlog +E:\VSRFID\VSPR\VSPR\DEBUG\ODDPARITY.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\ODDPARITYDLG.OBJ +E:\vsrfid\vspr\vspr\Debug\rc.command.1.tlog +E:\vsrfid\vspr\vspr\Debug\rc.read.1.tlog +E:\vsrfid\vspr\vspr\Debug\rc.write.1.tlog +E:\VSRFID\VSPR\VSPR\DEBUG\RFID_CHK.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\RFID_ISO14443A_CODEC.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\RFID_ISO14443A_FRM.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\SETIPOFUSPDLG.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\STDAFX.OBJ +E:\vsrfid\vspr\vspr\Debug\vc100.idb +E:\VSRFID\VSPR\VSPR\DEBUG\VC100.PDB +E:\VSRFID\VSPR\VSPR\DEBUG\VSPR.EXE.EMBED.MANIFEST +E:\VSRFID\VSPR\VSPR\DEBUG\VSPR.EXE.EMBED.MANIFEST.RES +E:\VSRFID\VSPR\VSPR\DEBUG\VSPR.EXE.INTERMEDIATE.MANIFEST +E:\VSRFID\VSPR\VSPR\DEBUG\VSPR.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\VSPR.PCH +E:\VSRFID\VSPR\VSPR\DEBUG\VSPR.RES +E:\vsrfid\vspr\vspr\Debug\vspr.vcxprojResolveAssemblyReference.cache +E:\vsrfid\vspr\vspr\Debug\vspr.write.1.tlog +E:\vsrfid\vspr\vspr\Debug\vspr_manifest.rc +E:\VSRFID\VSPR\VSPR\DEBUG\VSPRDOC.OBJ +E:\VSRFID\VSPR\VSPR\DEBUG\VSPRVIEW.OBJ +E:\VSRFID\VSPR\VSPR\HLP\HTMLDEFINES.H diff --git a/Labs/Lab2/requirements/src/vspr/vspr/Debug/vspr.log b/Labs/Lab2/requirements/src/vspr/vspr/Debug/vspr.log new file mode 100644 index 0000000..66e53df --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/Debug/vspr.log @@ -0,0 +1,9 @@ +生成启动时间为 2018/11/26 9:58:51。 + 1>项目“E:\vsrfid\vspr\vspr\vspr.vcxproj”在节点 2 上(clean 个目标)。 + 1>_PrepareForClean: + 正在删除文件“Debug\vspr.lastbuildstate”。 + 1>已完成生成项目“E:\vsrfid\vspr\vspr\vspr.vcxproj”(clean 个目标)的操作。 + +生成成功。 + +已用时间 00:00:00.76 diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgAntiFraming.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgAntiFraming.cpp new file mode 100644 index 0000000..213cfe9 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgAntiFraming.cpp @@ -0,0 +1,370 @@ +// DlgAntiFraming.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgAntiFraming.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\rfid_iso14443A_frm.h" + + +// CDlgAntiFraming Ի + +IMPLEMENT_DYNAMIC(CDlgAntiFraming, CDialogEx) + +CDlgAntiFraming::CDlgAntiFraming(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgAntiFraming::IDD, pParent) +{ + + m_sCLx = _T(""); + m_sLocalOutput = _T(""); + m_sRemoteResult = _T(""); + m_sRemoteOutput = _T(""); + m_nPCD = 0; + m_nShow16 = 0; + m_nBitNum = 0; + m_sUID = _T(""); + m_nCLx = 0; +} + +CDlgAntiFraming::~CDlgAntiFraming() +{ +} + +void CDlgAntiFraming::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Radio(pDX, IDC_RADIO_16, m_nShow16); + DDV_MaxChars(pDX, m_sCLx, 2); + DDX_Text(pDX, IDC_EDIT_OUTPUT_LOCAL2, m_sLocalOutput); + DDX_Text(pDX, IDC_EDIT_REMOTE_RESULT2, m_sRemoteResult); + DDX_Text(pDX, IDC_EDIT_OUTPUT_REMOTE, m_sRemoteOutput); + DDX_Radio(pDX, IDC_RADIO_PCD, m_nPCD); + DDV_MinMaxInt(pDX, m_nPCD, 0, 1); + DDX_Text(pDX, IDC_EDIT_BITNUM, m_nBitNum); + DDV_MinMaxInt(pDX, m_nBitNum, 0, 32); + DDX_Text(pDX, IDC_EDIT_UID, m_sUID); + DDV_MaxChars(pDX, m_sUID, 20); + DDX_Radio(pDX, IDC_RADIO_CLX, m_nCLx); + DDV_MinMaxInt(pDX, m_nCLx, 0, 2); +} + + +BEGIN_MESSAGE_MAP(CDlgAntiFraming, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_START, &CDlgAntiFraming::OnClickedButtonStart) +END_MESSAGE_MAP() + + +// CDlgAntiFraming Ϣ + + +void CDlgAntiFraming::OnClickedButtonStart() +{ + // TODO: ڴӿؼ֪ͨ + UpdateData(); + + m_sUID.MakeUpper( ); + + int an_lenofuid[]={8,14,20}; + + if( !(m_sUID.GetLength( ) == 8 || m_sUID.GetLength( ) == 14 || m_sUID.GetLength( ) == 20) ) + { + CString s("UIDַ4/7/10ֽ!"); + AfxMessageBox(s); + return; + } + + if( m_nPCD == 1 ) + { + //PICCس != 0, + if( m_nBitNum == 0 ) + { + AfxMessageBox(_T("PICCͷ򣬱سȲΪ0")); + return; + } + } + int k,n=0,m,p=0; + char c; + + if( m_nPCD == 0 ) + { + // PCD. + n = 2; //pcdǰ2Ϊclx + p = 2; + } + memset( m_aucInDat, 0x00, 20 ); + // UIDҪԶӼ־CT:0x88. + k = m_sUID.GetLength( )-1; + while( k >= 0 ) + { + c = m_sUID.GetAt(k); + // k > 7: 4ֽ/4ֽڣҪӼ־ + if( (n%4 == p) && (k>7) ) + { + m_aucInDat[n] = 0x88; + n++; + continue; + } + + if( c >= 'A' && c <= 'F' ) + { + m = m_sUID.GetAt(k) - 'A' + 10; + } + else if( c >= '0' && c <= '9' ) + { + m = m_sUID.GetAt(k) - '0'; + } + else + { + CString s("ַ0-9,A-Fa-f!"); + AfxMessageBox(s); + return; + } + + if( k % 2 == 0 ) + { + m_aucInDat[n] = m_aucInDat[n] + ( m << 4 ); + n++; + } + else + { + m_aucInDat[n] = m; + } + k--; + } + if( m_nPCD == 0 ) + { + UCHAR aucCLX[] = {0x93,0x95,0x97}; + m_aucInDat[0] = aucCLX[m_nCLx]; + + // NVB + m_aucInDat[1] = m_nBitNum/8+2+((m_nBitNum%8 != 0 )? 1:0); + m_aucInDat[1] *= 16; + m_aucInDat[1] |= m_nBitNum%8; + } + else + { + // PICCҪBCC. + m_aucInDat[4] = 0x00; + for( int i = 0; i < 4; i++ ) + { + m_aucInDat[4] ^= m_aucInDat[i]; + } + + k = m_nBitNum/8; + } + + // ʹõuid0-3λ + int index[] = {0,4,8}; + for( int i = 0; i < 4; i++ ) + { + m_aucInDat[i+p] = m_aucInDat[i+p+index[m_nCLx]]; + } + + UCHAR aucBuf[100]; + UINT16 u16OutBitLen; + if( m_nPCD == 0 ) + { + // pcd + if( m_nBitNum == 32 ) + { + // SELECT + // BCCCRC, BCCԼ㣬CRC + m_aucInDat[6] = 0x00; + for( int i = 2; i < 6; i++ ) + { + m_aucInDat[6] ^= m_aucInDat[i]; + } + m_aucInDat[1] = 0x70; + + ISO14443A_stdFraming( m_aucInDat, m_nBitNum+16+8, aucBuf, &u16OutBitLen ); + } + else + { + // ANTI + ISO14443A_AnticollisionFraming( 0, 0, m_aucInDat, m_nBitNum+16, aucBuf, &u16OutBitLen ); + } + m_sLocalOutput = GetFramingDesp( aucBuf, u16OutBitLen ); + } + else + { + // picc,BCC + if( m_nBitNum%8 == 0 ) + { + int s = 4-m_nBitNum/8; + ISO14443A_AnticollisionFraming( 0, 0, m_aucInDat+s, m_nBitNum+8, aucBuf, &u16OutBitLen ); + } + else + { + int s = 4-m_nBitNum/8; + ISO14443A_AnticollisionFraming( m_nBitNum%8, m_aucInDat[s-1]>>(8-m_nBitNum%8), m_aucInDat+s, m_nBitNum-m_nBitNum%8+8, aucBuf, &u16OutBitLen ); + } + m_sLocalOutput = GetAntiFramingDesp_picc( aucBuf, u16OutBitLen ); + } + + + if( m_bRemote ) + { + + } + UpdateData( FALSE ); +} + +CString CDlgAntiFraming::GetAntiFramingDesp_picc( UCHAR *aucBuf, UINT16 u16DatBitLen ) +{ + if( u16DatBitLen % 9 == 0 ) + { + return GetFramingDesp( aucBuf, u16DatBitLen ); + } + + // ǰu16OutBitLen%9 + // k-1+1odd parity; + int n = u16DatBitLen%9; + int k = 0, byoff, btoff; + + CString frmstr=_T(""); + char str[10]; + + // ǰk-1 + if( n-1 <= 4 ) + { + // ֻ4أ + for( int i = 0; i < n-1; i++ ) + { + byoff = k/8; + btoff = k%8; + sprintf_s( str, "%d", (aucBuf[byoff] >> (7-btoff))&1 ); + frmstr += str; + k++; + } + } + else + { + for( int i = 0; i < n-1-4; i++ ) + { + byoff = k/8; + btoff = k%8; + sprintf_s( str, "%d", (aucBuf[byoff] >> (7-btoff))&1 ); + frmstr += str; + k++; + } + frmstr += "."; + for( int i = 0; i < 4; i++ ) + { + byoff = k/8; + btoff = k%8; + sprintf_s( str, "%d", (aucBuf[byoff] >> (7-btoff))&1 ); + frmstr += str; + k++; + } + } + // һodd parity; + frmstr += "["; + byoff = k/8; + btoff = k%5; + sprintf_s( str, "%d", (aucBuf[byoff] >> (7-btoff))&1 ); + frmstr += str; + k++; + frmstr += "]."; + + // ʣµģ + UCHAR buf[100] = {0}; + int m = 0, byoff1, btoff1; + int t; + for( int i = n; i < u16DatBitLen; i++ ) + { + byoff = k/8; + btoff = k%8; + byoff1 = m/8; + btoff1 = m%8; + t = (aucBuf[byoff] >> (7-btoff))&1; + buf[byoff1] |= t << (7-btoff1); + + m++; + k++; + } + + return frmstr + GetFramingDesp( buf, u16DatBitLen-u16DatBitLen%9); +} + +// ֽλʱȷ͵ı +CString CDlgAntiFraming::GetFramingDesp( UCHAR *aucBuf, UINT16 u16DatBitLen ) +{ + int k; + char str[100]; + CString frmstr; + + frmstr = ""; + if( m_nShow16 == 0 ) + { + // 16; + int i; + for( i = 0; i < u16DatBitLen/8; i++ ) + { + if( i == u16DatBitLen/8 - 1 ) + { + sprintf_s( str, "%02x", aucBuf[i] ); + } + else + { + sprintf_s( str, "%02x:", aucBuf[i] ); + } + frmstr += str; + } + + if( u16DatBitLen%8 ) + { + // 0. + k = i; + frmstr += "_"; + for( int i = 0; i < u16DatBitLen%8; i++ ) + { + if( aucBuf[k] & (1<<(7-i))) + { + frmstr += "1"; + } + else + { + frmstr += "0"; + } + } + } + } + else + { + // 2; + int k = 0, i = 0; + int by, bi; + while( k < u16DatBitLen ) + { + by = k/8; + bi = k%8; + if( aucBuf[by] & (1<<(7-bi))) + { + frmstr += "1"; + } + else + { + frmstr += "0"; + } + k++; + i++; + + if( i == 8 ) + { + frmstr += "["; + } + else if( i == 9 ) + { + frmstr += "]."; + i = 0; + } + else if( i == 4 ) + { + frmstr += "."; + } + } + } + + return frmstr; +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgAntiFraming.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgAntiFraming.h new file mode 100644 index 0000000..13b80ee --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgAntiFraming.h @@ -0,0 +1,44 @@ +#pragma once + + +// CDlgAntiFraming Ի + +class CDlgAntiFraming : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgAntiFraming) + +public: + CDlgAntiFraming(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgAntiFraming(); + +// Ի + enum { IDD = IDD_DLG_FRM_ANTI }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() + + CString GetFramingDesp( UCHAR *aucBuf, UINT16 u16DatBitLen ); + CString GetAntiFramingDesp_picc( UCHAR *aucBuf, UINT16 u16DatBitLen ); + +public: + afx_msg void OnClickedButtonStart(); + + int m_nShow16; + CString m_sCLx; + CString m_sLocalOutput; + CString m_sRemoteResult; + CString m_sRemoteOutput; + int m_nPCD; + int m_nBitNum; + CString m_sUID; + int m_nCLx; + + BOOL m_bRemote; + + BYTE m_aucInDat[20]; + BYTE m_aucLocalOutDat[30]; + BYTE m_aucRemoteOutDat[30]; + +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAnti.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAnti.cpp new file mode 100644 index 0000000..b4202bf --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAnti.cpp @@ -0,0 +1,299 @@ +// DlgCmdAnti.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgCmdAnti.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\rfid_chk.h" + +// CDlgCmdAnti Ի + +IMPLEMENT_DYNAMIC(CDlgCmdAnti, CDialogEx) + +CDlgCmdAnti::CDlgCmdAnti(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgCmdAnti::IDD, pParent) +{ + + m_nBitNum = 0; + m_sUID = _T(""); + m_nCLx = 0; + m_sLocal16 = _T(""); + m_sLocal2 = _T(""); + m_sRemote16 = _T(""); + m_sRemote2 = _T(""); +} + +CDlgCmdAnti::~CDlgCmdAnti() +{ +} + +void CDlgCmdAnti::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_EDIT_BITNUM, m_nBitNum); + DDV_MinMaxInt(pDX, m_nBitNum, 0, 32); + DDX_Text(pDX, IDC_EDIT_UID, m_sUID); + DDV_MaxChars(pDX, m_sUID, 20); + DDX_Radio(pDX, IDC_RADIO_CLX, m_nCLx); + DDV_MinMaxInt(pDX, m_nCLx, 0, 2); + DDX_Text(pDX, IDC_STATIC_LOCAL_16, m_sLocal16); + DDX_Text(pDX, IDC_STATIC_LOCAL_2, m_sLocal2); + DDX_Text(pDX, IDC_STATIC_REMOTE_16, m_sRemote16); + DDX_Text(pDX, IDC_STATIC_REMOTE_2, m_sRemote2); +} + + +BEGIN_MESSAGE_MAP(CDlgCmdAnti, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_DO, &CDlgCmdAnti::OnClickedButtonDo) +END_MESSAGE_MAP() + + +// CDlgCmdAnti Ϣ + + +BOOL CDlgCmdAnti::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // TODO: ڴӶijʼ + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + + +void CDlgCmdAnti::OnClickedButtonDo() +{ + // TODO: ڴӿؼ֪ͨ + UpdateData(); + + // жUIDǷϷ + if( !(m_sUID.GetLength( ) == 8 || m_sUID.GetLength( ) == 14 || m_sUID.GetLength( ) == 20) ) + { + CString s("UIDַ4/7/10ֽ!"); + AfxMessageBox(s); + return; + } + + if( ( m_nCLx == 1 && m_sUID.GetLength() < 14) || ( m_nCLx == 2 && m_sUID.GetLength() < 20 ) ) + { + CString s("UIDַȲ!"); + AfxMessageBox(s); + return; + } + + CString sUID, UID; + char str[20]={0}; + + if( m_sUID.GetLength() == 8 ) + { + sUID = m_sUID; + } + else if( m_sUID.GetLength() == 14 ) + { + sUID = m_sUID + _T("88"); + } + else + { + for( int i = 0; i < 14; i++ ) + { + str[0] = m_sUID[i]; + sUID += str; + } + sUID += _T("88"); + for( int i = 14; i < 20; i++ ) + { + str[0] = m_sUID[i]; + sUID += str; + } + sUID += _T("88"); + } + sUID.MakeUpper(); + + int k,n,m; + char c; + + UCHAR aucUID[20]; + memset( aucUID, 0x00, 20 ); + // UIDҪԶӼ־CT:0x88. + k = 0; + n = 0; + while( k < sUID.GetLength( ) ) + { + c = sUID.GetAt(k); + // k > 7: 4ֽ/4ֽڣҪӼ־ + if( c >= 'A' && c <= 'F' ) + { + m = sUID.GetAt(k) - 'A' + 10; + } + else if( c >= '0' && c <= '9' ) + { + m = sUID.GetAt(k) - '0'; + } + else + { + CString s("ַ0-9,A-Fa-f!"); + AfxMessageBox(s); + return; + } + + if( k % 2 == 0 ) + { + aucUID[n] = m << 4; + } + else + { + aucUID[n] = aucUID[n] + m; + n++; + } + k++; + } + + + // m_nCLxȡuid + UID=""; + k = sUID.GetLength()-8*(m_nCLx+1); + + for( int i = k; i < k+8; i++ ) + { + str[0] = sUID[i]; + UID += str; + } + + // ʼ. + UCHAR aucBuf[10]; + UCHAR aucCLX[]={0x93,0x95,0x97}; + + // ȡUID + + aucBuf[0] = aucCLX[m_nCLx]; + // NVB + k = 2+m_nBitNum/8+((m_nBitNum%8)?1:0); + aucBuf[1] = ( k << 4 ) + m_nBitNum%8; + + // aucBuf[2]-[5] UID; + m = sUID.GetLength()/2 - m_nCLx*4-4; + for( int i = 3; i >= 0; i-- ) + { + aucBuf[2+3-i] = aucUID[m+i]; + } + + if( m_nBitNum == 32 ) + { + //SELECT. + // BCCCRC + aucBuf[6] = 0x00; + for( int i = 0; i < 4; i++ ) + { + aucBuf[6] += aucBuf[2+i]; + } + ISO14443A_CRC( aucBuf, 7, &aucBuf[8], &aucBuf[7]); + k += 3; + aucBuf[1] = 0x70; + } + + // local + m_sLocal16=""; + m_sLocal2=""; + int i; + + if( m_nBitNum%8 ) + { + for( i = 0; i < k-1; i++ ) + { + sprintf_s(str,"%02x", aucBuf[i]); + m_sLocal16 += str; + for( int j = 0; j < 8; j++ ) + { + if( j == 4 ) + { + m_sLocal2 += "."; + } + if( (aucBuf[i] >> (7-j) ) & 1) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + } + m_sLocal2 += ","; + } + + sprintf_s(str,"_%02x", aucBuf[i]); + m_sLocal16 += str; + m_sLocal2 += "_"; + int x = 0; + for( int j = 8; j > m_nBitNum%8; j-- ) + { + m_sLocal2 += "x"; + x++; + if( x == 4 ) + { + m_sLocal2 += "."; + } + } + + for( int j = m_nBitNum%8-1; j >=0 ; j-- ) + { + if( x == 4 ) + { + m_sLocal2 += "."; + } + if( (aucBuf[i] >> j ) & 1) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + x++; + } + } + else + { + for( i = 0; i < k; i++ ) + { + sprintf_s(str,"%02x", aucBuf[i]); + m_sLocal16 += str; + if( i != k-1 ) + { + m_sLocal16 += ","; + } + for( int j = 0; j < 8; j++ ) + { + if( j == 4 ) + { + m_sLocal2 += "."; + } + if( (aucBuf[i] >> (7-j) ) & 1) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + } + if( i != k-1 ) + { + m_sLocal2 += ","; + } + } + } + + + + + if( m_bRemote ) + { + } + + UpdateData(false); +} + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAnti.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAnti.h new file mode 100644 index 0000000..a982d6c --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAnti.h @@ -0,0 +1,33 @@ +#pragma once + + +// CDlgCmdAnti Ի + +class CDlgCmdAnti : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgCmdAnti) + +public: + CDlgCmdAnti(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgCmdAnti(); + +// Ի + enum { IDD = IDD_DLG_CMD_SELECT }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() + +public: + virtual BOOL OnInitDialog(); + afx_msg void OnClickedButtonDo(); + BOOL m_bRemote; + int m_nBitNum; + CString m_sUID; + int m_nCLx; + CString m_sLocal16; + CString m_sLocal2; + CString m_sRemote16; + CString m_sRemote2; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAntiRsp.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAntiRsp.cpp new file mode 100644 index 0000000..37fdd2c --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAntiRsp.cpp @@ -0,0 +1,292 @@ +// DlgCmdAntiRsp.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgCmdAntiRsp.h" +#include "afxdialogex.h" + + +// CDlgCmdAntiRsp Ի + +IMPLEMENT_DYNAMIC(CDlgCmdAntiRsp, CDialogEx) + +CDlgCmdAntiRsp::CDlgCmdAntiRsp(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgCmdAntiRsp::IDD, pParent) +{ + m_nBitNum = 0; + m_sUID = _T(""); + m_nCLx = 0; + m_sLocal16 = _T(""); + m_sLocal2 = _T(""); + m_sRemote16 = _T(""); + m_sRemote2 = _T(""); +} + +CDlgCmdAntiRsp::~CDlgCmdAntiRsp() +{ +} + +void CDlgCmdAntiRsp::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_EDIT_BITNUM, m_nBitNum); + DDV_MinMaxInt(pDX, m_nBitNum, 1, 31); + DDX_Text(pDX, IDC_EDIT_UID, m_sUID); + DDV_MaxChars(pDX, m_sUID, 20); + DDX_Radio(pDX, IDC_RADIO_CLX, m_nCLx); + DDV_MinMaxInt(pDX, m_nCLx, 0, 2); + DDX_Text(pDX, IDC_STATIC_LOCAL_16, m_sLocal16); + DDX_Text(pDX, IDC_STATIC_LOCAL_2, m_sLocal2); + DDX_Text(pDX, IDC_STATIC_REMOTE_16, m_sRemote16); + DDX_Text(pDX, IDC_STATIC_REMOTE_2, m_sRemote2); + +} + + +BEGIN_MESSAGE_MAP(CDlgCmdAntiRsp, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_DO, &CDlgCmdAntiRsp::OnClickedButtonDo) + +END_MESSAGE_MAP() + + + +BOOL CDlgCmdAntiRsp::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // TODO: ڴӶijʼ + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + +// CDlgCmdAntiRsp Ϣ +void CDlgCmdAntiRsp::OnClickedButtonDo() +{ + // TODO: ڴӿؼ֪ͨ + UpdateData(); + + // жUIDǷϷ + if( !(m_sUID.GetLength( ) == 8 || m_sUID.GetLength( ) == 14 || m_sUID.GetLength( ) == 20) ) + { + CString s("UIDַ4/7/10ֽ!"); + AfxMessageBox(s); + return; + } + + if( ( m_nCLx == 1 && m_sUID.GetLength() < 14) || ( m_nCLx == 2 && m_sUID.GetLength() < 20 ) ) + { + CString s("UIDַȲ!"); + AfxMessageBox(s); + return; + } + + CString sUID, UID; + char str[20]={0}; + + if( m_sUID.GetLength() == 8 ) + { + sUID = m_sUID; + } + else if( m_sUID.GetLength() == 14 ) + { + sUID = m_sUID + _T("88"); + } + else + { + for( int i = 0; i < 14; i++ ) + { + str[0] = m_sUID[i]; + sUID += str; + } + sUID += _T("88"); + for( int i = 14; i < 20; i++ ) + { + str[0] = m_sUID[i]; + sUID += str; + } + sUID += _T("88"); + } + sUID.MakeUpper(); + + int k,n,m; + char c; + + UCHAR aucUID[20]; + memset( aucUID, 0x00, 20 ); + // UIDҪԶӼ־CT:0x88. + k = 0; + n = 0; + while( k < sUID.GetLength( ) ) + { + c = sUID.GetAt(k); + // k > 7: 4ֽ/4ֽڣҪӼ־ + if( c >= 'A' && c <= 'F' ) + { + m = sUID.GetAt(k) - 'A' + 10; + } + else if( c >= '0' && c <= '9' ) + { + m = sUID.GetAt(k) - '0'; + } + else + { + CString s("ַ0-9,A-Fa-f!"); + AfxMessageBox(s); + return; + } + + if( k % 2 == 0 ) + { + aucUID[n] = m << 4; + } + else + { + aucUID[n] = aucUID[n] + m; + n++; + } + k++; + } + + + // m_nCLxȡuid + UID=""; + k = sUID.GetLength()-8*(m_nCLx+1); + + for( int i = k; i < k+8; i++ ) + { + str[0] = sUID[i]; + UID += str; + } + + // ʼ. + UCHAR aucBuf[10], aucBuf1[10]; + + // ȡUIDBCC + m = sUID.GetLength()/2 - m_nCLx*4-4; + k = m_nBitNum/8+((m_nBitNum%8)?1:0); + + UCHAR bcc = 0x00; + for( int i = 3; i >= 0; i-- ) + { + aucBuf1[3-i] = aucUID[m+i]; + bcc ^= aucBuf1[3-i]; + } + + // ȡʵʷ͵ + for( int i = 0; i < k; i++) + { + aucBuf[i] = aucBuf1[4-k+i]; + } + + // bcc + k++; + aucBuf[k-1] = bcc; + + m_sLocal16=""; + m_sLocal2=""; + int i; + + if( m_nBitNum%8 ) + { + int x = 0; + int j; + for( j = 0; j < m_nBitNum%8 ; j++ ) + { + if( x == 4 ) + { + m_sLocal2 += "."; + } + if( (aucBuf[0] >> (7-j) ) & 1) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + x++; + } + for( ; j < 8; j++ ) + { + m_sLocal2 += "x"; + x++; + if( x == 4 ) + { + m_sLocal2 += "."; + } + } + m_sLocal2 += "_"; + + sprintf_s(str,"%02x_", aucBuf[0]); + m_sLocal16 += str; + + for( i = 1; i < k; i++ ) + { + sprintf_s(str,"%02x", aucBuf[i]); + m_sLocal16 += str; + if( i != k-1 ) + { + m_sLocal16 += ","; + } + for( int j = 0; j < 8; j++ ) + { + if( j == 4 ) + { + m_sLocal2 += "."; + } + if( (aucBuf[i] >> (7-j) ) & 1) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + } + m_sLocal2 += ","; + } + } + else + { + for( i = 0; i < k; i++ ) + { + sprintf_s(str,"%02x", aucBuf[i]); + m_sLocal16 += str; + if( i != k-1 ) + { + m_sLocal16 += ","; + } + for( int j = 0; j < 8; j++ ) + { + if( j == 4 ) + { + m_sLocal2 += "."; + } + if( (aucBuf[i] >> (7-j) ) & 1) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + } + if( i != k-1 ) + { + m_sLocal2 += ","; + } + } + } + + + + + if( m_bRemote ) + { + } + + UpdateData(false); +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAntiRsp.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAntiRsp.h new file mode 100644 index 0000000..99824b0 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAntiRsp.h @@ -0,0 +1,33 @@ +#pragma once + + +// CDlgCmdAntiRsp Ի + +class CDlgCmdAntiRsp : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgCmdAntiRsp) + +public: + CDlgCmdAntiRsp(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgCmdAntiRsp(); + +// Ի + enum { IDD = IDD_DLG_CMD_ANTI }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() + +public: + virtual BOOL OnInitDialog(); + afx_msg void OnClickedButtonDo(); + BOOL m_bRemote; + int m_nBitNum; + CString m_sUID; + int m_nCLx; + CString m_sLocal16; + CString m_sLocal2; + CString m_sRemote16; + CString m_sRemote2; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAtqa.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAtqa.cpp new file mode 100644 index 0000000..5907a19 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAtqa.cpp @@ -0,0 +1,102 @@ +// DlgCmdAtqa.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgCmdAtqa.h" +#include "afxdialogex.h" + + +// CDlgCmdAtqa Ի + +IMPLEMENT_DYNAMIC(CDlgCmdAtqa, CDialogEx) + +CDlgCmdAtqa::CDlgCmdAtqa(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgCmdAtqa::IDD, pParent) +{ + m_bRemote = false; + m_sLocal16 = _T(""); + m_sLocal2 = _T(""); + m_sRemote16 = _T(""); + m_sRemote2 = _T(""); + m_nBit = 0; + m_nUIDLen = 0; +} + +CDlgCmdAtqa::~CDlgCmdAtqa() +{ +} + +void CDlgCmdAtqa::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_STATIC_LOCAL_16, m_sLocal16); + DDX_Text(pDX, IDC_STATIC_LOCAL_2, m_sLocal2); + DDX_Text(pDX, IDC_STATIC_REMOTE_16, m_sRemote16); + DDX_Text(pDX, IDC_STATIC_REMOTE_2, m_sRemote2); + DDX_Radio(pDX, IDC_RADIO_BIT, m_nBit); + DDV_MinMaxInt(pDX, m_nBit, 0, 4); + DDX_Radio(pDX, IDC_RADIO_UIDL, m_nUIDLen); + DDV_MinMaxInt(pDX, m_nUIDLen, 0, 2); +} + + +BEGIN_MESSAGE_MAP(CDlgCmdAtqa, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_DO, &CDlgCmdAtqa::OnClickedButtonDo) +END_MESSAGE_MAP() + + +// CDlgCmdAtqa Ϣ +void CDlgCmdAtqa::OnClickedButtonDo() +{ + // TODO: ڴӿؼ֪ͨ + UpdateData(); + + char str[10]; + UCHAR aInBuf[2]={0x00,0x50}; + + aInBuf[1] = 1 << m_nBit; + aInBuf[1] += m_nUIDLen << 6; + + sprintf_s( str, "%02x%02x", aInBuf[0], aInBuf[1] ); + m_sLocal16 = str; + + m_sLocal2=""; + for( int i = 0; i < 2; i++ ) + { + for( int j = 0; j < 8; j++ ) + { + if( j == 4 ) + { + m_sLocal2 += "."; + } + if( aInBuf[i] & (1<<7-j)) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + } + if( i != 3 ) + { + m_sLocal2 +=","; + } + } + + if( m_bRemote ) + { + } + UpdateData(false); +} + +BOOL CDlgCmdAtqa::OnInitDialog() +{ + // TODO: ڴӶijʼ + CDialogEx::OnInitDialog(); + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAtqa.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAtqa.h new file mode 100644 index 0000000..2624ee6 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdAtqa.h @@ -0,0 +1,32 @@ +#pragma once + + +// CDlgCmdAtqa Ի + +class CDlgCmdAtqa : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgCmdAtqa) + +public: + CDlgCmdAtqa(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgCmdAtqa(); + +// Ի + enum { IDD = IDD_DLG_CMD_ATQA }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnClickedButtonDo(); + + BOOL m_bRemote; + CString m_sLocal16; + CString m_sLocal2; + CString m_sRemote16; + CString m_sRemote2; + virtual BOOL OnInitDialog(); + int m_nBit; + int m_nUIDLen; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdHalt.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdHalt.cpp new file mode 100644 index 0000000..68445b0 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdHalt.cpp @@ -0,0 +1,96 @@ +// DlgCmdHalt.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgCmdHalt.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\rfid_chk.h" + +// CDlgCmdHalt Ի + +IMPLEMENT_DYNAMIC(CDlgCmdHalt, CDialogEx) + +CDlgCmdHalt::CDlgCmdHalt(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgCmdHalt::IDD, pParent) +{ + m_bRemote = false; + m_sCmd = _T(""); + m_sLocal16 = _T(""); + m_sLocal2 = _T(""); + m_sRemote16 = _T(""); + m_sRemote2 = _T(""); +} + +CDlgCmdHalt::~CDlgCmdHalt() +{ +} + +void CDlgCmdHalt::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_STATIC_CMD, m_sCmd); + DDX_Text(pDX, IDC_STATIC_LOCAL_16, m_sLocal16); + DDX_Text(pDX, IDC_STATIC_LOCAL_2, m_sLocal2); + DDX_Text(pDX, IDC_STATIC_REMOTE_16, m_sRemote16); + DDX_Text(pDX, IDC_STATIC_REMOTE_2, m_sRemote2); +} + + +BEGIN_MESSAGE_MAP(CDlgCmdHalt, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_DO, &CDlgCmdHalt::OnClickedButtonDo) +END_MESSAGE_MAP() + + +// CDlgCmdHalt Ϣ +void CDlgCmdHalt::OnClickedButtonDo() +{ + // TODO: ڴӿؼ֪ͨ + char str[10]; + UCHAR aInBuf[4]={0x00,0x50}; + + ISO14443A_CRC( aInBuf, 2, &aInBuf[3], &aInBuf[2]); + + sprintf_s( str, "0050%02x%02x", aInBuf[2], aInBuf[3] ); + m_sLocal16 = str; + + m_sLocal2=""; + for( int i = 0; i < 4; i++ ) + { + for( int j = 0; j < 8; j++ ) + { + if( j == 4 ) + { + m_sLocal2 += "."; + } + if( aInBuf[i] & (1<<7-j)) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + } + if( i != 3 ) + { + m_sLocal2 +=","; + } + } + + if( m_bRemote ) + { + } + UpdateData(false); +} + + +BOOL CDlgCmdHalt::OnInitDialog() +{ + // TODO: ڴӶijʼ + m_sCmd = "HALT(0x0050)"; + CDialogEx::OnInitDialog(); + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdHalt.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdHalt.h new file mode 100644 index 0000000..7af8acf --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdHalt.h @@ -0,0 +1,33 @@ +#pragma once + + +// CDlgCmdHalt Ի + +class CDlgCmdHalt : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgCmdHalt) + +public: + CDlgCmdHalt(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgCmdHalt(); + +// Ի + enum { IDD = IDD_DLG_CMD_HALT }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnClickedButtonDo(); + + UCHAR m_ucCmd; + + BOOL m_bRemote; + CString m_sCmd; + CString m_sLocal16; + CString m_sLocal2; + CString m_sRemote16; + CString m_sRemote2; + virtual BOOL OnInitDialog(); +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdSak.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdSak.cpp new file mode 100644 index 0000000..808044f --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdSak.cpp @@ -0,0 +1,98 @@ +// DlgCmdSak.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgCmdSak.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\rfid_chk.h" + +// CDlgCmdSak Ի + +IMPLEMENT_DYNAMIC(CDlgCmdSak, CDialogEx) + +CDlgCmdSak::CDlgCmdSak(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgCmdSak::IDD, pParent) +{ + +} + +CDlgCmdSak::~CDlgCmdSak() +{ +} + +void CDlgCmdSak::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_STATIC_LOCAL_16, m_sLocal16); + DDX_Text(pDX, IDC_STATIC_LOCAL_2, m_sLocal2); + DDX_Text(pDX, IDC_STATIC_REMOTE_16, m_sRemote16); + DDX_Text(pDX, IDC_STATIC_REMOTE_2, m_sRemote2); + DDX_Radio(pDX, IDC_RADIO_7816, m_n7816); + DDV_MinMaxInt(pDX, m_n7816, 0, 1); + DDX_Radio(pDX, IDC_RADIO_UIDOK, m_nUIDOK); + DDV_MinMaxInt(pDX, m_nUIDOK, 0, 1); +} + + +BEGIN_MESSAGE_MAP(CDlgCmdSak, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_DO, &CDlgCmdSak::OnClickedButtonDo) +END_MESSAGE_MAP() + + +// CDlgCmdSak Ϣ + +void CDlgCmdSak::OnClickedButtonDo() +{ + // TODO: ڴӿؼ֪ͨ + UpdateData(); + + char str[10]; + UCHAR aInBuf[3]={0x00}; + + aInBuf[0] = m_nUIDOK << 2; + aInBuf[0] += m_n7816 << 5; + + ISO14443A_CRC( aInBuf, 2, &aInBuf[2], &aInBuf[1]); + + sprintf_s( str, "%02x%02x%02x", aInBuf[0],aInBuf[1],aInBuf[2] ); + m_sLocal16 = str; + + m_sLocal2=""; + for( int i = 0; i < 3; i++ ) + { + for( int j = 0; j < 8; j++ ) + { + if( j == 4 ) + { + m_sLocal2 += "."; + } + if( aInBuf[i] & (1<<7-j)) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + } + if( i != 2 ) + { + m_sLocal2 +=","; + } + } + + if( m_bRemote ) + { + } + UpdateData(false); +} + +BOOL CDlgCmdSak::OnInitDialog() +{ + // TODO: ڴӶijʼ + CDialogEx::OnInitDialog(); + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdSak.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdSak.h new file mode 100644 index 0000000..a76b8c4 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmdSak.h @@ -0,0 +1,33 @@ +#pragma once + + +// CDlgCmdSak Ի + +class CDlgCmdSak : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgCmdSak) + +public: + CDlgCmdSak(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgCmdSak(); + +// Ի + enum { IDD = IDD_DLG_CMD_SAK }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() + +public: + afx_msg void OnClickedButtonDo(); + + BOOL m_bRemote; + CString m_sLocal16; + CString m_sLocal2; + CString m_sRemote16; + CString m_sRemote2; + virtual BOOL OnInitDialog(); + int m_n7816; + int m_nUIDOK; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmd_SF.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmd_SF.cpp new file mode 100644 index 0000000..28d895a --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmd_SF.cpp @@ -0,0 +1,122 @@ +// DlgCmd_SF.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgCmd_SF.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\rfid_def.h" +#include "mainfrm.h" + +// CCRC16Dlg Ի +using namespace VSPR_OF_ISO14443A; + +// CDlgCmd_SF Ի + +IMPLEMENT_DYNAMIC(CDlgCmd_SF, CDialogEx) + +CDlgCmd_SF::CDlgCmd_SF(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgCmd_SF::IDD, pParent) +{ + m_bRemote = false; + m_sCmd = _T(""); + m_sLocal16 = _T(""); + m_sLocal2 = _T(""); + m_sRemote16 = _T(""); + m_sRemote2 = _T(""); +} + +CDlgCmd_SF::~CDlgCmd_SF() +{ +} + +void CDlgCmd_SF::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_STATIC_CMD, m_sCmd); + DDX_Text(pDX, IDC_STATIC_LOCAL_16, m_sLocal16); + DDX_Text(pDX, IDC_STATIC_LOCAL_2, m_sLocal2); + DDX_Text(pDX, IDC_STATIC_REMOTE_16, m_sRemote16); + DDX_Text(pDX, IDC_STATIC_REMOTE_2, m_sRemote2); +} + + +BEGIN_MESSAGE_MAP(CDlgCmd_SF, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_DO, &CDlgCmd_SF::OnClickedButtonDo) +END_MESSAGE_MAP() + + +// CDlgCmd_SF Ϣ + + +void CDlgCmd_SF::OnClickedButtonDo() +{ + // TODO: ڴӿؼ֪ͨ + char str[10]; + + sprintf_s( str, "%02x", m_ucCmd ); + m_sLocal16 = str; + + m_sLocal2=""; + for( int i = 0; i < 7; i++ ) + { + if( i == 3 ) + { + m_sLocal2 += "."; + } + if( m_ucCmd & (1<<6-i)) + { + m_sLocal2 += "1"; + } + else + { + m_sLocal2 += "0"; + } + } + + if( m_bRemote ) + { +#if 0 + clVSPRTransceiver* pTransceiver = ((CMainFrame *)AfxGetMainWnd())->GetTransceiver(); + if( pTransceiver ) + { + pTransceiver->Send( abtBuf, m_nLen * 8, VSPR_CMD_CRC16_REQ ); + // ȴ1s. + Sleep(1000 ); + + UCHAR ucCmd; + UINT16 u16BitLen; + u16BitLen = pTransceiver->Recv( abtBuf, 200, &ucCmd ); + if( ( u16BitLen > 0 ) && ( ucCmd == VSPR_CMD_CRC16_RSP ) ) + { + // ʾCRC_H/CRC_L + char str[50]; + sprintf_s(str, "0x%02x[%3d]", abtBuf[1], abtBuf[1] ); + m_sRemoteCRCH = str; + sprintf_s(str, "0x%02x[%3d]", abtBuf[0], abtBuf[0] ); + m_sRemoteCRCL = str; + } + } +#endif + } + UpdateData(false); +} + + +BOOL CDlgCmd_SF::OnInitDialog() +{ + + // TODO: ڴӶijʼ + if( m_ucCmd == ISO_14443_CMD_REQA) + { + m_sCmd = "REQA(0x26)"; + } + else if( m_ucCmd == ISO_14443_CMD_WUPA ) + { + m_sCmd = "WUPA(0x52)"; + } + CDialogEx::OnInitDialog(); + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCmd_SF.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmd_SF.h new file mode 100644 index 0000000..66d6a07 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCmd_SF.h @@ -0,0 +1,33 @@ +#pragma once + + +// CDlgCmd_SF Ի + +class CDlgCmd_SF : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgCmd_SF) + +public: + CDlgCmd_SF(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgCmd_SF(); + +// Ի + enum { IDD = IDD_DLG_SF_CMD }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnClickedButtonDo(); + + UCHAR m_ucCmd; + + BOOL m_bRemote; + CString m_sCmd; + CString m_sLocal16; + CString m_sLocal2; + CString m_sRemote16; + CString m_sRemote2; + virtual BOOL OnInitDialog(); +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCode.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgCode.cpp new file mode 100644 index 0000000..2cf05ab --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCode.cpp @@ -0,0 +1,229 @@ +// DlgCode.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgCode.h" +#include "afxdialogex.h" +#include "DlgShowWave.h" +#include "..\..\rfidsrc\rfid_iso14443A_codec.h" +#include "..\..\rfidsrc\class\clVSPRCmd.h" +// CDlgCode Ի + +IMPLEMENT_DYNAMIC(CDlgCode, CDialogEx) + +using namespace VSPR_OF_ISO14443A; +CDlgCode::CDlgCode(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgCode::IDD, pParent) +{ + m_sInput = _T(""); + m_nType = 0; + m_nCode = 0; + m_bRemote = false; + m_pTransceiver = NULL; +} + +CDlgCode::~CDlgCode() +{ +} + +void CDlgCode::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_EDIT_INPUT, m_sInput); + DDX_Radio(pDX, IDC_RADIO_CODE, m_nCode); + DDX_Radio(pDX, IDC_RADIO_TYPE, m_nType); + DDV_MinMaxInt(pDX, m_nType, 0, 3); +} + + +BEGIN_MESSAGE_MAP(CDlgCode, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_DO, &CDlgCode::OnClickedButtonDo) +END_MESSAGE_MAP() + + +// CDlgCode Ϣ + + +void CDlgCode::OnClickedButtonDo() +{ + // TODO: ڴӿؼ֪ͨ + UpdateData( ); + + UCHAR aucBitStream[128]; + int bitStreamLen; + UCHAR aucCodedStream[1024]; + UINT16 CodedStreamLen=0; + UCHAR b1, b0; + int k; + + switch( m_nType ) + { + case 0: // bit + k = (m_nCode == 0) ? 2:1; + if( m_sInput.GetLength() != k || + !( m_sInput[0] == '0' || m_sInput[0] == '1' || m_sInput[1] == '0' || m_sInput[1] == '1' )) + { + AfxMessageBox(_T("Ƿ: 룬Ҫغǰһأ")); + return; + } + if( m_nCode == 1 ) + { + b1 = (m_sInput[0] == '0')?0:1; + aucCodedStream[0] = RFID_Code_Manchester( b1 )<<4; + } + else + { + b0 = (m_sInput[0] == '0')?0:1; + b1 = (m_sInput[1] == '0')?0:1; + aucCodedStream[0] = RFID_Code_Miller(b0, b1)<<4; + } + aucBitStream[0] = b1?0x80:0x00; + bitStreamLen = 1; + CodedStreamLen = 4; + break; + case 1: // sof + if( m_nCode == 0 ) + { + // PCD. + aucBitStream[0] = 0x00; // һ0 + aucCodedStream[0] = ISO14443A_PCD_SOF << 4; + } + else + { + aucBitStream[0] = 0x80; // һ1 + aucCodedStream[0] = ISO14443A_PICC_SOF << 4; + } + bitStreamLen = 1; + CodedStreamLen = 4; + break; + case 2: // eof + if( m_nCode == 0 ) + { + // PCD. + if( m_sInput.GetLength() != 1 ) + { + AfxMessageBox(_T("PCD->PICC룬EOFΪ'0'֡һйأһֵ")); + return; + } + aucBitStream[0] = 0x00; // һ0ǰһй. + b0 = (m_sInput[0] == '0')?0:1; + b1 = 0; + aucCodedStream[0] = RFID_Code_Miller(b0, b1) << 4; + } + else + { + aucBitStream[0] = 0x00; // һ1 + aucCodedStream[0] = ISO14443A_PICC_EOF << 4; + } + bitStreamLen = 1; + CodedStreamLen = 4; + break; + case 3: //frame + bitStreamLen = m_sInput.GetLength() * 4; + m_sInput.MakeLower( ); + k = 0; + for( int i = 0; i < m_sInput.GetLength(); i++ ) + { + if( m_sInput[i] >= '0' && m_sInput[i] <= '9' ) + { + b0=m_sInput[i]-'0'; + } + else if( m_sInput[i] >= 'a' && m_sInput[i] <= 'f' ) + { + b0=m_sInput[i]-'a'+10; + } + if( i%2 ) + { + aucBitStream[k] += b0; + k++; + } + else + { + aucBitStream[k] = b0<<4; + } + } + if( m_nCode == 0 ) + { + ISO14443A_PCD_Code( aucBitStream, bitStreamLen, aucCodedStream, &CodedStreamLen ); + } + else + { + ISO14443A_PICC_Code( aucBitStream, bitStreamLen, aucCodedStream, &CodedStreamLen ); + } + break; + } + + // ʾ + CDlgShowWave dlg; + dlg.m_sCode = m_nCode == 1 ?"˹ر":"ձ"; + dlg.m_sPCD = m_nCode == 0 ?"PCD":"PICC"; + dlg.m_nBitStreamLen = bitStreamLen; + dlg.m_nCodedStreamLen = CodedStreamLen; + + k = bitStreamLen/8+((bitStreamLen%8)?1:0); + memcpy( dlg.m_aucBitStream, aucBitStream, k); + k = CodedStreamLen/8+((CodedStreamLen%8)?1:0); + memcpy( dlg.m_aucCodedStream,aucCodedStream, CodedStreamLen/8+1); + + if( m_nType == 3 ) + { + dlg.m_bShowFirst = false; + } + + // Զ˱. + int nCodedStreamLen = CodedStreamLen; + if( m_bRemote && m_pTransceiver ) + { + clVSPR_VSPR cmd; + UCHAR txBuf[128]={0}; + int txBufBitLen=0, txBufLen=0; + UCHAR rxcmd0, rxcmd1; + + switch( m_nType ) + { + case 0: + txBufLen = cmd.GetStream_CODE_1BIT_REQ( !m_nCode, (m_sInput[0] == '0')?0:1, (m_sInput[1] == '0')?0:1, txBuf, &txBufBitLen ); + rxcmd0 = VSPR_CMD_CODE_1BIT_RSP; + break; + case 1: // sof + txBufLen = cmd.GetStream_CODE_SOF_REQ( !m_nCode, txBuf, &txBufBitLen ); + rxcmd0 = VSPR_CMD_CODE_SOF_RSP; + break; + case 2: // eof + txBufLen = cmd.GetStream_CODE_EOF_REQ( !m_nCode, (m_sInput[0] == '0')?0:1, txBuf, &txBufBitLen ); + rxcmd0 = VSPR_CMD_CODE_EOF_RSP; + break; + case 3: // frame + txBufLen = cmd.GetStream_CODE_FRAME_REQ( !m_nCode, aucBitStream, bitStreamLen, txBuf, &txBufBitLen ); + rxcmd0 = VSPR_CMD_CODE_FRAME_RSP; + break; + } + + // + txBufBitLen -= 64; // 8x8 + m_pTransceiver->Send( txBuf+8, txBufBitLen, txBuf[2]); + + nCodedStreamLen = m_pTransceiver->Recv( aucCodedStream, 1024, &rxcmd1 ); + if( nCodedStreamLen < 0 || rxcmd1 != rxcmd0 || aucCodedStream[0] != !m_nCode ) + { + AfxMessageBox(_T("մ")); + } + else + { + dlg.m_nBitStreamLen_r = bitStreamLen; + k = bitStreamLen/8+((bitStreamLen%8)?1:0); + memcpy( dlg.m_aucBitStream_r, aucBitStream, k); + + // codecһֽpcd/picc. + nCodedStreamLen -= 8; + dlg.m_nCodedStreamLen_r = nCodedStreamLen; + + k = nCodedStreamLen/8+((nCodedStreamLen%8)?1:0); + memcpy( dlg.m_aucCodedStream_r,aucCodedStream+1, k); + } + } + + dlg.DoModal(); +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgCode.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgCode.h new file mode 100644 index 0000000..d307b31 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgCode.h @@ -0,0 +1,31 @@ +#pragma once + +#include "..\..\rfidsrc\class\clUSPTrans.h" + +using namespace VSPR_OF_ISO14443A; +// CDlgCode Ի + +class CDlgCode : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgCode) + +public: + CDlgCode(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgCode(); + +// Ի + enum { IDD = IDD_DLG_CODE }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnClickedButtonDo(); + BOOL m_bRemote; + CString m_sInput; + int m_nCode; // 0/1 for pcd->picc/picc->pcd + int m_nType; // 0/1/2/3 for bit/sof/eof/frame + + clVSPRTransceiver* m_pTransceiver; +}; \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgShortFrm.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgShortFrm.cpp new file mode 100644 index 0000000..a7b646f --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgShortFrm.cpp @@ -0,0 +1,186 @@ +// DlgShortFrm.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgShortFrm.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\rfid_iso14443A_frm.h" + + +// CDlgShortFrm Ի + +IMPLEMENT_DYNAMIC(CDlgShortFrm, CDialogEx) + +CDlgShortFrm::CDlgShortFrm(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgShortFrm::IDD, pParent) +{ + + m_sLocalOutput = _T(""); + m_sRemoteOutput = _T(""); + m_sRemoteResult = _T(""); + m_sInput = _T(""); + m_bShow16 = 0; + m_bRemote = false; +} + +CDlgShortFrm::~CDlgShortFrm() +{ +} + +void CDlgShortFrm::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_OUTPUT_LOCAL, m_sLocalOutput); + DDX_Text(pDX, IDC_EDIT_OUTPUT_REMOTE, m_sRemoteOutput); + DDX_Text(pDX, IDC_EDIT_REMOTE_RESULT, m_sRemoteResult); + DDX_Radio(pDX, IDC_RADIO_16, m_bShow16); + DDX_Text(pDX, IDC_EDIT_INPUT, m_sInput); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); +} + + +BEGIN_MESSAGE_MAP(CDlgShortFrm, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_START, &CDlgShortFrm::OnClickedButtonStart) +END_MESSAGE_MAP() + + +// CDlgShortFrm Ϣ + + +void CDlgShortFrm::OnClickedButtonStart() +{ + // TODO: ڴӿؼ֪ͨ + UpdateData(); + + m_sInput.MakeUpper( ); + if( m_sInput.GetLength( ) != 2 ) + { + CString s("ַ2!"); + AfxMessageBox(s); + return; + } + + int k=0,n=0,m; + char c; + while( c = m_sInput.GetAt(k) ) + { + if( c >= 'A' && c <= 'F' ) + { + m = m_sInput.GetAt(k) - 'A' + 10; + } + else if( c >= '0' && c <= '9' ) + { + m = m_sInput.GetAt(k) - '0'; + } + else + { + CString s("ַ0-9,A-Fa-f!"); + AfxMessageBox(s); + return; + } + + if( k % 2 == 0 ) + { + m_aucInDat[n] = m; + } + else + { + m_aucInDat[n] = ( m_aucInDat[n] << 4 ) + m; + n++; + } + k++; + } + + UCHAR aucBuf[100]; + UINT16 u16OutBitLen; + ISO14443A_ShortFraming( m_aucInDat[0]&0x7F, aucBuf, &u16OutBitLen ); + + m_sLocalOutput = GetFramingDesp( aucBuf, u16OutBitLen ); + if( m_bRemote ) + { + + } + UpdateData( FALSE ); +} + +CString CDlgShortFrm::GetFramingDesp( UCHAR *aucBuf, UINT16 u16DatBitLen ) +{ + int k; + char str[100]; + CString frmstr; + + frmstr = ""; + if( m_bShow16 == 0 ) + { + // 16; + int i; + for( i = 0; i < u16DatBitLen/8; i++ ) + { + if( i == u16DatBitLen/8 - 1 ) + { + sprintf_s( str, "%02x", aucBuf[i] ); + } + else + { + sprintf_s( str, "%02x:", aucBuf[i] ); + } + frmstr += str; + } + + if( u16DatBitLen%8 ) + { + // 0. + k = i; + frmstr += "_"; + for( int i = 0; i < u16DatBitLen%8; i++ ) + { + if( aucBuf[k] & (1<<(7-i))) + { + frmstr += "1"; + } + else + { + frmstr += "0"; + } + } + } + } + else + { + // 2; + int k = 0, i = 0; + int by, bi; + while( k < u16DatBitLen ) + { + by = k/8; + bi = k%8; + if( aucBuf[by] & (1<<(7-bi))) + { + frmstr += "1"; + } + else + { + frmstr += "0"; + } + k++; + i++; + + if( i == 8 ) + { + frmstr += "["; + } + else if( i == 9 ) + { + frmstr += "]."; + i = 0; + } + else if( i == 4 ) + { + frmstr += "."; + } + } + } + + return frmstr; +} \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgShortFrm.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgShortFrm.h new file mode 100644 index 0000000..c787182 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgShortFrm.h @@ -0,0 +1,37 @@ +#pragma once + + +// CDlgShortFrm Ի + +class CDlgShortFrm : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgShortFrm) + +public: + CDlgShortFrm(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgShortFrm(); + +// Ի + enum { IDD = IDD_DLG_FRM_SHORT }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() + + CString GetFramingDesp( UCHAR *aucBuf, UINT16 u16DatBitLen ); + +public: + afx_msg void OnClickedButtonStart(); + CString m_sLocalOutput; + CString m_sRemoteOutput; + CString m_sRemoteResult; + + BOOL m_bShow16; + CString m_sInput; + BOOL m_bRemote; + + BYTE m_aucInDat[20]; + BYTE m_aucLocalOutDat[30]; + BYTE m_aucRemoteOutDat[30]; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgShowWave.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgShowWave.cpp new file mode 100644 index 0000000..4c32ea1 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgShowWave.cpp @@ -0,0 +1,292 @@ +// DlgShowWave.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgShowWave.h" +#include "afxdialogex.h" + + +// CDlgShowWave Ի + +IMPLEMENT_DYNAMIC(CDlgShowWave, CDialogEx) + +CDlgShowWave::CDlgShowWave(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgShowWave::IDD, pParent) +{ + + m_sCode = _T(""); + m_sPCD = _T(""); + m_sBitStream = _T(""); + m_sCodedStream = _T(""); + + m_nBitStreamLen = 0; + m_nCodedStreamLen = 0; + + m_nBitStreamLen_r = 0; + m_nCodedStreamLen_r = 0; + + m_bShowFirst = true; + m_sBitStream_r = _T(""); + m_sCodedStream_r = _T(""); +} + +CDlgShowWave::~CDlgShowWave() +{ +} + +void CDlgShowWave::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_STATIC_CODE, m_sCode); + DDX_Text(pDX, IDC_STATIC_PCD, m_sPCD); + DDX_Text(pDX, IDC_STATIC_BIT_STREAM, m_sBitStream); + DDX_Text(pDX, IDC_STATIC_CODED_STREAM, m_sCodedStream); + DDX_Control(pDX, IDC_STATIC_WAVE, m_cWave); + DDX_Text(pDX, IDC_STATIC_BIT_STREAM_R, m_sBitStream_r); + DDX_Text(pDX, IDC_STATIC_CODED_STREAM_R, m_sCodedStream_r); +} + + +BEGIN_MESSAGE_MAP(CDlgShowWave, CDialogEx) + ON_WM_PAINT() +END_MESSAGE_MAP() + + +// CDlgShowWave Ϣ + + +BOOL CDlgShowWave::OnInitDialog() +{ + // TODO: ڴӶijʼ + int byoff, btoff; + m_nBitStreamLen1 = 0; + for( int i = 0; i < m_nBitStreamLen; i++ ) + { + if( i!=0 && i%8 == 0 ) + { + m_sBitStream += '.'; + m_nBitStreamLen1++; + } + byoff = i/8; + btoff = i%8; + m_sBitStream += (m_aucBitStream[byoff] >> (7-btoff))&1?_T("1"):_T("0"); + } + + for( int i = 0; i < m_nCodedStreamLen; i++ ) + { + if( i != 0 && i%4 == 0 ) + { + m_sCodedStream += '.'; + } + byoff = i/8; + btoff = i%8; + m_sCodedStream += (m_aucCodedStream[byoff] >> (7-btoff))&1?_T("1"):_T("0"); + } + + + m_nBitStreamLen1_r = 0; + for( int i = 0; i < m_nBitStreamLen_r; i++ ) + { + if( i!=0 && i%8 == 0 ) + { + m_sBitStream_r += '.'; + m_nBitStreamLen1_r++; + } + byoff = i/8; + btoff = i%8; + m_sBitStream_r += (m_aucBitStream_r[byoff] >> (7-btoff))&1?_T("1"):_T("0"); + } + + for( int i = 0; i < m_nCodedStreamLen_r; i++ ) + { + if( i != 0 && i%4 == 0 ) + { + m_sCodedStream_r += '.'; + } + byoff = i/8; + btoff = i%8; + m_sCodedStream_r += (m_aucCodedStream_r[byoff] >> (7-btoff))&1?_T("1"):_T("0"); + } + + CDialogEx::OnInitDialog(); + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + + +void CDlgShowWave::OnPaint() +{ + CPaintDC dc(this); // device context for painting + // TODO: ڴ˴Ϣ + // ΪͼϢ CDialogEx::OnPaint() + CWnd *pWnd = GetDlgItem( IDC_STATIC_WAVE ); + CDC *pDC = pWnd->GetDC( ); + + pWnd->Invalidate( ); + pWnd->UpdateWindow( ); + + CRect rect; + + pWnd->GetWindowRect( &rect ); + pDC->SelectStockObject( BLACK_BRUSH ); + int width = rect.Width()-1; + int height = rect.Height()-1; + int mid = height/2+10; + pDC->Rectangle( 0,0,width,height); + + CPen pen(PS_SOLID,1,RGB(200,200,0)); + CPen rpen(PS_SOLID,1,RGB(0,200,0)); + CPen xpen( PS_SOLID, 1, RGB( 200,0,0)); + + CPen *pOldPen = pDC->SelectObject( &xpen ); + + height -= 10; + // 40: 4x5 + int wx = 5; + int x = wx, y; + char s[10]; + + // ʾر߽ʹ͵ı + pDC->SetTextColor( RGB(200,200,0)); + pDC->SetBkMode(TRANSPARENT); + + CString s1; + int j = 0; + m_nBitStreamLen1 += m_nBitStreamLen; + + for( int i = 0; i < width/20; i++ ) + { + if( i == 0 ) + { + if( m_bShowFirst ) + { + if( j < m_nBitStreamLen1 ) + { + if( m_sBitStream[j] == '.' ) + { + j++; + } + sprintf_s(s, "%c", m_sBitStream[j]); + s1 = s; + pDC->TextOutW( x + 5, 10, s1 ); + j++; + } + } + else + { + // frame. + sprintf_s(s, "s"); + s1 = s; + pDC->TextOutW( x + 5, 10, s1 ); + } + } + else if( j < m_nBitStreamLen1 ) + { + if( m_sBitStream[j] == '.' ) + { + j++; + } + sprintf_s(s, "%c", m_sBitStream[j]); + s1 = s; + pDC->TextOutW( x + 5, 10, s1 ); + j++; + } + else if( j == m_nBitStreamLen1 ) + { + // һ + if( !m_bShowFirst ) + { + // frame. + sprintf_s(s, "e"); + s1 = s; + pDC->TextOutW( x + 5, 10, s1 ); + } + j++; + } + + pDC->MoveTo( x, 10 ); + pDC->LineTo( x, height+5 ); + x += wx * 4; + } + + pDC->SelectObject( &pen ); + + int byoff, btoff; + int high, low; + + // local. + low = mid-5; + high = low-40; + x = 5, y = low; + pDC->MoveTo(wx,low); + for( int i = 0; i < m_nCodedStreamLen; i++ ) + { + byoff = i/8; + btoff = i%8; + + if( (m_aucCodedStream[byoff] >> (7-btoff))&1 ) + { + //1 + if( y == low ) + { + pDC->LineTo(x, high ); + y = high; + } + x += wx; + pDC->LineTo( x, y ); + } + else + { + //0 + if( y != low ) + { + pDC->LineTo( x, low ); + y = low; + } + x += wx; + pDC->LineTo( x, y ); + } + } + + // remote + high = mid+5; + low = high+40; + + x = 5, y = low; + pDC->SelectObject( &rpen ); + pDC->MoveTo(wx,low); + for( int i = 0; i < m_nCodedStreamLen_r; i++ ) + { + byoff = i/8; + btoff = i%8; + + if( (m_aucCodedStream_r[byoff] >> (7-btoff))&1 ) + { + //1 + if( y == low ) + { + pDC->LineTo(x, high ); + y = high; + } + x += wx; + pDC->LineTo( x, y ); + } + else + { + //0 + if( y != low ) + { + pDC->LineTo( x, low ); + y = low; + } + x += wx; + pDC->LineTo( x, y ); + } + } + + pDC->SelectObject( pOldPen ); + pWnd->ReleaseDC( pDC ); + +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgShowWave.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgShowWave.h new file mode 100644 index 0000000..79708d3 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgShowWave.h @@ -0,0 +1,53 @@ +#pragma once + + +// CDlgShowWave Ի + +class CDlgShowWave : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgShowWave) + +public: + CDlgShowWave(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgShowWave(); + +// Ի + enum { IDD = IDD_DLG_SHOW_WAVE }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CString m_sCode; // 뷽˹رձ + CString m_sPCD; // PCD or PICC + CStatic m_cWave; + + // ݣʾ + UCHAR m_aucCodedStream[1024]; // 2Kbits->128ֽ + int m_nCodedStreamLen; + CString m_sCodedStream; // + + // ı + UCHAR m_aucBitStream[32]; // 32ֽ x 8 = 256 x 4 = 1024 + int m_nBitStreamLen; + int m_nBitStreamLen1; + CString m_sBitStream; // ԭʼ + + // aucBitStream: + // ʾʾһ + BOOL m_bShowFirst; + + virtual BOOL OnInitDialog(); + afx_msg void OnPaint(); + + + UCHAR m_aucCodedStream_r[1024]; // 2Kbits->128ֽ + int m_nCodedStreamLen_r; + CString m_sCodedStream_r; + + UCHAR m_aucBitStream_r[32]; // 32ֽ x 8 = 256 x 4 = 1024 + int m_nBitStreamLen_r; + int m_nBitStreamLen1_r; + CString m_sBitStream_r; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgStdFrame.cpp b/Labs/Lab2/requirements/src/vspr/vspr/DlgStdFrame.cpp new file mode 100644 index 0000000..614ac60 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgStdFrame.cpp @@ -0,0 +1,187 @@ +// DlgStdFrame.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "DlgStdFrame.h" +#include "afxdialogex.h" +#include "..\..\rfidsrc\class\OddParity.h" +#include "..\..\rfidsrc\class\CRC16.h" +#include "..\..\rfidsrc\rfid_iso14443A_frm.h" + +// CDlgStdFrame Ի +using namespace VSPR_OF_ISO14443A; +IMPLEMENT_DYNAMIC(CDlgStdFrame, CDialogEx) + +CDlgStdFrame::CDlgStdFrame(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgStdFrame::IDD, pParent) +{ + m_sInput = _T(""); + m_sLocalOutput = _T(""); + m_sRemoteOutput = _T(""); + m_sRemoteResult = _T(""); + m_bShow16 = 0; +} + +CDlgStdFrame::~CDlgStdFrame() +{ +} + +void CDlgStdFrame::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_EDIT_INPUT, m_sInput); + DDV_MaxChars(pDX, m_sInput, 40); + DDX_Text(pDX, IDC_EDIT_OUTPUT_LOCAL, m_sLocalOutput); + DDX_Text(pDX, IDC_EDIT_OUTPUT_REMOTE, m_sRemoteOutput); + DDX_Text(pDX, IDC_EDIT_REMOTE_RESULT, m_sRemoteResult); + DDX_Radio(pDX, IDC_RADIO_16, m_bShow16); + DDV_MinMaxInt(pDX, m_bShow16, 0, 1); +} + + +BEGIN_MESSAGE_MAP(CDlgStdFrame, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_START, &CDlgStdFrame::OnClickedButtonStart) +END_MESSAGE_MAP() + + +// CDlgStdFrame Ϣ + + +void CDlgStdFrame::OnClickedButtonStart() +{ + // TODO: ڴӿؼ֪ͨ + + UpdateData(); + + m_sInput.MakeUpper( ); + if( m_sInput.GetLength( ) % 2 != 0 ) + { + CString s("ַ2!"); + AfxMessageBox(s); + return; + } + int k=0,n=0,m; + char c; + while( c = m_sInput.GetAt(k) ) + { + if( c >= 'A' && c <= 'F' ) + { + m = m_sInput.GetAt(k) - 'A' + 10; + } + else if( c >= '0' && c <= '9' ) + { + m = m_sInput.GetAt(k) - '0'; + } + else + { + CString s("ַ0-9,A-Fa-f!"); + AfxMessageBox(s); + return; + } + + if( k % 2 == 0 ) + { + m_aucInDat[n] = m; + } + else + { + m_aucInDat[n] = ( m_aucInDat[n] << 4 ) + m; + n++; + } + k++; + } + + UCHAR aucBuf[100]; + UINT16 u16OutBitLen; + ISO14443A_stdFraming( m_aucInDat, n*8, aucBuf, &u16OutBitLen ); + + m_sLocalOutput = GetFramingDesp( aucBuf, u16OutBitLen ); + if( m_bRemote ) + { + + } + UpdateData( FALSE ); +} + +CString CDlgStdFrame::GetFramingDesp( UCHAR *aucBuf, UINT16 u16DatBitLen ) +{ + int k; + char str[100]; + CString frmstr; + + frmstr = ""; + if( m_bShow16 == 0 ) + { + // 16; + int i; + for( i = 0; i < u16DatBitLen/8; i++ ) + { + if( i == u16DatBitLen/8 - 1 ) + { + sprintf_s( str, "%02x", aucBuf[i] ); + } + else + { + sprintf_s( str, "%02x:", aucBuf[i] ); + } + frmstr += str; + } + + if( u16DatBitLen%8 ) + { + // 0. + k = i; + frmstr += "_"; + for( int i = 0; i < u16DatBitLen%8; i++ ) + { + if( aucBuf[k] & (1<<(7-i))) + { + frmstr += "1"; + } + else + { + frmstr += "0"; + } + } + } + } + else + { + // 2; + int k = 0, i = 0; + int by, bi; + while( k < u16DatBitLen ) + { + by = k/8; + bi = k%8; + if( aucBuf[by] & (1<<(7-bi))) + { + frmstr += "1"; + } + else + { + frmstr += "0"; + } + k++; + i++; + + if( i == 8 ) + { + frmstr += "["; + } + else if( i == 9 ) + { + frmstr += "]."; + i = 0; + } + else if( i == 4 ) + { + frmstr += "."; + } + } + } + + return frmstr; +} \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/DlgStdFrame.h b/Labs/Lab2/requirements/src/vspr/vspr/DlgStdFrame.h new file mode 100644 index 0000000..a52c247 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/DlgStdFrame.h @@ -0,0 +1,34 @@ +#pragma once + + +// CDlgStdFrame Ի + +class CDlgStdFrame : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgStdFrame) + +public: + CDlgStdFrame(CWnd* pParent = NULL); // ׼캯 + virtual ~CDlgStdFrame(); + +// Ի + enum { IDD = IDD_DLG_FRM_STD }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + CString GetFramingDesp( UCHAR *buf, UINT16 u16DatBitLen ); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnClickedButtonStart(); + BOOL m_bRemote; + CString m_sInput; + CString m_sLocalOutput; + CString m_sRemoteOutput; + CString m_sRemoteResult; + + BYTE m_aucInDat[20]; + BYTE m_aucLocalOutDat[30]; + BYTE m_aucRemoteOutDat[30]; + int m_bShow16; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/MainFrm.cpp b/Labs/Lab2/requirements/src/vspr/vspr/MainFrm.cpp new file mode 100644 index 0000000..c3193f0 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/MainFrm.cpp @@ -0,0 +1,492 @@ + +// MainFrm.cpp : CMainFrame ʵ +// + +#include "stdafx.h" +#include "vspr.h" + +#include "MainFrm.h" + +#include "OddParityDlg.h" +#include "CRC16Dlg.h" +#include "SetIpofUSPDlg.h" +#include "DlgStdFrame.h" +#include "DlgShortFrm.h" +#include "DlgAntiFraming.h" +#include "DlgCode.h" +#include "DlgCmd_SF.h" +#include "DlgCmdHalt.h" +#include "DlgCmdAtqa.h" +#include "DlgCmdSak.h" +#include "DlgCmdAnti.h" +#include "DlgCmdAntiRsp.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +// CMainFrame + +IMPLEMENT_DYNCREATE(CMainFrame, CFrameWndEx) + +const int iMaxUserToolbars = 10; +const UINT uiFirstUserToolBarId = AFX_IDW_CONTROLBAR_FIRST + 40; +const UINT uiLastUserToolBarId = uiFirstUserToolBarId + iMaxUserToolbars - 1; + +BEGIN_MESSAGE_MAP(CMainFrame, CFrameWndEx) + ON_WM_CREATE() + // ȫְ + ON_COMMAND(ID_HELP_FINDER, &CFrameWndEx::OnHelpFinder) + ON_COMMAND(ID_HELP, &CFrameWndEx::OnHelp) + ON_COMMAND(ID_CONTEXT_HELP, &CFrameWndEx::OnContextHelp) + ON_COMMAND(ID_DEFAULT_HELP, &CFrameWndEx::OnHelpFinder) + ON_COMMAND(ID_VIEW_CUSTOMIZE, &CMainFrame::OnViewCustomize) + ON_REGISTERED_MESSAGE(AFX_WM_CREATETOOLBAR, &CMainFrame::OnToolbarCreateNew) + ON_COMMAND_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_WINDOWS_7, &CMainFrame::OnApplicationLook) + ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_WINDOWS_7, &CMainFrame::OnUpdateApplicationLook) + ON_COMMAND(ID_MENU_FRAME_ANTICOLLISION, &CMainFrame::OnMenuFrameAnticollision) + ON_COMMAND(ID_MENU_FRAME_SHORT, &CMainFrame::OnMenuFrameShort) + ON_COMMAND(ID_MENU_FRAME_STD, &CMainFrame::OnMenuFrameStd) + ON_COMMAND(ID_MENU_PARITY_CRC16, &CMainFrame::OnMenuParityCrc16) + ON_COMMAND(ID_MENU_PARITY_ODD, &CMainFrame::OnMenuParityOdd) + ON_COMMAND(ID_MENU_CMD_REQA, &CMainFrame::OnMenuCmdReqa) + ON_COMMAND(ID_MENU_CMD_SAK, &CMainFrame::OnMenuCmdSak) + ON_COMMAND(ID_MENU_CMD_WUPA, &CMainFrame::OnMenuCmdWupa) + ON_COMMAND(ID_MENU_CMD_HALT, &CMainFrame::OnMenuCmdHalt) + ON_COMMAND(ID_MENU_CMD_ATQA, &CMainFrame::OnMenuCmdAtqa) + ON_COMMAND(ID_MENU_CMD_ANTICOLLISION_REQ, &CMainFrame::OnMenuCmdAnticollisionReq) + ON_COMMAND(ID_MENU_CMD_ANTICOLLISION_RSP, &CMainFrame::OnMenuCmdAnticollisionRsp) + ON_COMMAND(ID_MENU_SET_USPIP, &CMainFrame::OnMenuSetUspip) + + ON_MESSAGE(WM_DRAW, &CMainFrame::OnDrawMessage) + ON_COMMAND(ID_MENU_CODE_CODE, &CMainFrame::OnMenuCodeCode) +END_MESSAGE_MAP() + +static UINT indicators[] = +{ + ID_SEPARATOR, // ״ָ̬ʾ + ID_INDICATOR_CAPS, + ID_INDICATOR_NUM, + ID_INDICATOR_SCRL, +}; + +// CMainFrame / + +CMainFrame::CMainFrame() +{ + // TODO: ڴӳԱʼ + theApp.m_nAppLook = theApp.GetInt(_T("ApplicationLook"), ID_VIEW_APPLOOK_VS_2008); + + // ʹsocketҪƶԻ򣬶USPipַ + m_pTransceiver = NULL; +} + +CMainFrame::~CMainFrame() +{ +} + +int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CFrameWndEx::OnCreate(lpCreateStruct) == -1) + return -1; + + BOOL bNameValid; + // ڳ־ֵӾʽ + OnApplicationLook(theApp.m_nAppLook); + + if (!m_wndMenuBar.Create(this)) + { + TRACE0("δܴ˵\n"); + return -1; // δܴ + } + + m_wndMenuBar.SetPaneStyle(m_wndMenuBar.GetPaneStyle() | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY); + + // ֹ˵ڼʱý + CMFCPopupMenu::SetForceMenuFocus(FALSE); + + if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || + !m_wndToolBar.LoadToolBar(theApp.m_bHiColorIcons ? IDR_MAINFRAME_256 : IDR_MAINFRAME)) + { + TRACE0("δܴ\n"); + return -1; // δܴ + } + + CString strToolBarName; + bNameValid = strToolBarName.LoadString(IDS_TOOLBAR_STANDARD); + ASSERT(bNameValid); + m_wndToolBar.SetWindowText(strToolBarName); + + CString strCustomize; + bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE); + ASSERT(bNameValid); + m_wndToolBar.EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize); + + // ûĹ: + InitUserToolbars(NULL, uiFirstUserToolBarId, uiLastUserToolBarId); + + if (!m_wndStatusBar.Create(this)) + { + TRACE0("δܴ״̬\n"); + return -1; // δܴ + } + m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT)); + + // TODO: ϣͲ˵ͣɾ + m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY); + m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); + EnableDocking(CBRS_ALIGN_ANY); + DockPane(&m_wndMenuBar); + DockPane(&m_wndToolBar); + + + // Visual Studio 2005 ʽͣΪ + CDockingManager::SetDockingMode(DT_SMART); + // Visual Studio 2005 ʽͣԶΪ + EnableAutoHidePanes(CBRS_ALIGN_ANY); + + // ùͣڲ˵滻 + EnablePaneMenu(TRUE, ID_VIEW_CUSTOMIZE, strCustomize, ID_VIEW_TOOLBAR); + + // ÿ(ס Alt ϶)Զ + CMFCToolBar::EnableQuickCustomization(); + + if (CMFCToolBar::GetUserImages() == NULL) + { + // ûĹͼ + if (m_UserImages.Load(_T(".\\UserImages.bmp"))) + { + CMFCToolBar::SetUserImages(&m_UserImages); + } + } + + // ò˵Ի(ʹõ) + // TODO: ԼĻȷÿ˵һ + CList lstBasicCommands; + + lstBasicCommands.AddTail(ID_FILE_NEW); + lstBasicCommands.AddTail(ID_FILE_OPEN); + lstBasicCommands.AddTail(ID_FILE_SAVE); + lstBasicCommands.AddTail(ID_FILE_PRINT); + lstBasicCommands.AddTail(ID_APP_EXIT); + lstBasicCommands.AddTail(ID_EDIT_CUT); + lstBasicCommands.AddTail(ID_EDIT_PASTE); + lstBasicCommands.AddTail(ID_EDIT_UNDO); + lstBasicCommands.AddTail(ID_APP_ABOUT); + lstBasicCommands.AddTail(ID_VIEW_STATUS_BAR); + lstBasicCommands.AddTail(ID_VIEW_TOOLBAR); + lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2003); + lstBasicCommands.AddTail(ID_VIEW_APPLOOK_VS_2005); + lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLUE); + lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_SILVER); + lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLACK); + lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_AQUA); + lstBasicCommands.AddTail(ID_VIEW_APPLOOK_WINDOWS_7); + + CMFCToolBar::SetBasicCommands(lstBasicCommands); + + return 0; +} + +BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) +{ + if( !CFrameWndEx::PreCreateWindow(cs) ) + return FALSE; + // TODO: ڴ˴ͨ޸ + // CREATESTRUCT cs ޸Ĵʽ + + return TRUE; +} + +// CMainFrame + +#ifdef _DEBUG +void CMainFrame::AssertValid() const +{ + CFrameWndEx::AssertValid(); +} + +void CMainFrame::Dump(CDumpContext& dc) const +{ + CFrameWndEx::Dump(dc); +} +#endif //_DEBUG + + +// CMainFrame Ϣ + +void CMainFrame::OnViewCustomize() +{ + CMFCToolBarsCustomizeDialog* pDlgCust = new CMFCToolBarsCustomizeDialog(this, TRUE /* ɨ˵*/); + pDlgCust->EnableUserDefinedToolbars(); + pDlgCust->Create(); +} + +LRESULT CMainFrame::OnToolbarCreateNew(WPARAM wp,LPARAM lp) +{ + LRESULT lres = CFrameWndEx::OnToolbarCreateNew(wp,lp); + if (lres == 0) + { + return 0; + } + + CMFCToolBar* pUserToolbar = (CMFCToolBar*)lres; + ASSERT_VALID(pUserToolbar); + + BOOL bNameValid; + CString strCustomize; + bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE); + ASSERT(bNameValid); + + pUserToolbar->EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize); + return lres; +} + +void CMainFrame::OnApplicationLook(UINT id) +{ + CWaitCursor wait; + + theApp.m_nAppLook = id; + + switch (theApp.m_nAppLook) + { + case ID_VIEW_APPLOOK_WIN_2000: + CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManager)); + break; + + case ID_VIEW_APPLOOK_OFF_XP: + CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOfficeXP)); + break; + + case ID_VIEW_APPLOOK_WIN_XP: + CMFCVisualManagerWindows::m_b3DTabsXPTheme = TRUE; + CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows)); + break; + + case ID_VIEW_APPLOOK_OFF_2003: + CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2003)); + CDockingManager::SetDockingMode(DT_SMART); + break; + + case ID_VIEW_APPLOOK_VS_2005: + CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerVS2005)); + CDockingManager::SetDockingMode(DT_SMART); + break; + + case ID_VIEW_APPLOOK_VS_2008: + CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerVS2008)); + CDockingManager::SetDockingMode(DT_SMART); + break; + + case ID_VIEW_APPLOOK_WINDOWS_7: + CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows7)); + CDockingManager::SetDockingMode(DT_SMART); + break; + + default: + switch (theApp.m_nAppLook) + { + case ID_VIEW_APPLOOK_OFF_2007_BLUE: + CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_LunaBlue); + break; + + case ID_VIEW_APPLOOK_OFF_2007_BLACK: + CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_ObsidianBlack); + break; + + case ID_VIEW_APPLOOK_OFF_2007_SILVER: + CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_Silver); + break; + + case ID_VIEW_APPLOOK_OFF_2007_AQUA: + CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_Aqua); + break; + } + + CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2007)); + CDockingManager::SetDockingMode(DT_SMART); + } + + RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME | RDW_ERASE); + + theApp.WriteInt(_T("ApplicationLook"), theApp.m_nAppLook); +} + +void CMainFrame::OnUpdateApplicationLook(CCmdUI* pCmdUI) +{ + pCmdUI->SetRadio(theApp.m_nAppLook == pCmdUI->m_nID); +} + +BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext) +{ + // ཫִĹ + + if (!CFrameWndEx::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd, pContext)) + { + return FALSE; + } + + + // ΪûԶ尴ť + BOOL bNameValid; + CString strCustomize; + bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE); + ASSERT(bNameValid); + + for (int i = 0; i < iMaxUserToolbars; i ++) + { + CMFCToolBar* pUserToolbar = GetUserToolBarByIndex(i); + if (pUserToolbar != NULL) + { + pUserToolbar->EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize); + } + } + + return TRUE; +} + + +LRESULT CMainFrame::OnDrawMessage( WPARAM wparam , LPARAM lparam ) +{ + return 0; +} + + +void CMainFrame::OnMenuFrameAnticollision() +{ + // TODO: ڴ + CDlgAntiFraming dlg; + + dlg.DoModal( ); +} + + +void CMainFrame::OnMenuFrameShort() +{ + // TODO: ڴ + CDlgShortFrm dlg; + + dlg.DoModal(); +} + + +void CMainFrame::OnMenuFrameStd() +{ + // TODO: ڴ + CDlgStdFrame dlg; + + dlg.DoModal(); +} + + +void CMainFrame::OnMenuParityCrc16() +{ + // TODO: ڴ + CCRC16Dlg crc16Dlg; + crc16Dlg.DoModal(); +} + + +void CMainFrame::OnMenuParityOdd() +{ + // TODO: ڴ + + COddParityDlg oddparityDlg; + + oddparityDlg.DoModal(); +} + + +void CMainFrame::OnMenuCmdReqa() +{ + // TODO: ڴ + CDlgCmd_SF dlg; + + dlg.m_ucCmd = ISO_14443_CMD_REQA; + dlg.DoModal(); +} + + +void CMainFrame::OnMenuCmdSak() +{ + // TODO: ڴ + CDlgCmdSak dlg; + + dlg.DoModal(); + +} + + +void CMainFrame::OnMenuCmdWupa() +{ + // TODO: ڴ + CDlgCmd_SF dlg; + + dlg.m_ucCmd = ISO_14443_CMD_WUPA; + dlg.DoModal(); +} + + +void CMainFrame::OnMenuCmdHalt() +{ + // TODO: ڴ + CDlgCmdHalt dlg; + + dlg.DoModal(); +} + + +void CMainFrame::OnMenuCmdAtqa() +{ + // TODO: ڴ + CDlgCmdAtqa dlg; + + dlg.DoModal(); +} + + +void CMainFrame::OnMenuCmdAnticollisionReq() +{ + // TODO: ڴ + CDlgCmdAnti dlg; + + dlg.DoModal(); +} + + +void CMainFrame::OnMenuCmdAnticollisionRsp() +{ + // TODO: ڴ + CDlgCmdAntiRsp dlg; + + dlg.DoModal(); +} + + +void CMainFrame::OnMenuSetUspip() +{ + // TODO: ڴ + CSetIpofUSPDlg dlg; + +// dlg.m_ctlIpAddr.SetAddress(127,0,0,1);; + if( dlg.DoModal() == IDOK ) + { + if( m_pTransceiver ) + { + delete m_pTransceiver; + } + m_pTransceiver = new clVSPRTransceiver( dlg.m_szIpAddr ); + m_pTransceiver->Init( ); + } +} + + +void CMainFrame::OnMenuCodeCode() +{ + // TODO: ڴ + + CDlgCode dlg; + + dlg.m_pTransceiver = m_pTransceiver; + dlg.DoModal(); +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/MainFrm.h b/Labs/Lab2/requirements/src/vspr/vspr/MainFrm.h new file mode 100644 index 0000000..9af144f --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/MainFrm.h @@ -0,0 +1,103 @@ + +// MainFrm.h : CMainFrame Ľӿ +// + +#pragma once + +#include "..\..\rfidsrc\class\clUSPTrans.h" + +using namespace VSPR_OF_ISO14443A; +#define WM_DRAW (WM_USER+1) + +#if 0 + һͷļжԼϢID #define WM_MY_FIRST_MESSAGE (WM_USER + 0x001) +ԼϢafx_msg void OnMyFirstMessage(); +CPPļϢӳ꣺ +BEGIN_MESSAGE_MAP END_MESSAGE_MAPϢӳON_MESSAGEӵ//}}棩£ +BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) +//{{AFX_MSG_MAP(CAboutDlg) +// No message handlers +//}}AFX_MSG_MAP +ON_MESSAGE(WM_MY_FIRST_MESSAGE, OnMyFirstMessage) +END_MESSAGE_MAP() +ģϢ +OnMyFirstMessage +{ +// TODO: ڴӿؼ֪ͨ +} +#endif +class CMainFrame : public CFrameWndEx +{ + +protected: // л + CMainFrame(); + DECLARE_DYNCREATE(CMainFrame) + +// +public: + // ȫtransceiver. + +// +public: + +// д +public: + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL); + +// ʵ +public: + virtual ~CMainFrame(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: // ؼǶԱ + CMFCMenuBar m_wndMenuBar; + CMFCToolBar m_wndToolBar; + CMFCStatusBar m_wndStatusBar; + CMFCToolBarImages m_UserImages; + +// ɵϢӳ亯 +protected: + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnViewCustomize(); + afx_msg LRESULT OnToolbarCreateNew(WPARAM wp, LPARAM lp); + afx_msg void OnApplicationLook(UINT id); + afx_msg void OnUpdateApplicationLook(CCmdUI* pCmdUI); + DECLARE_MESSAGE_MAP() + +public: + // ߣ + afx_msg LRESULT OnDrawMessage( WPARAM wparam , LPARAM lparam ); + + // + afx_msg void OnMenuCodeCode(); + // У + afx_msg void OnMenuParityCrc16(); + afx_msg void OnMenuParityOdd(); + // ֡ + afx_msg void OnMenuFrameAnticollision(); + afx_msg void OnMenuFrameShort(); + afx_msg void OnMenuFrameStd(); + // + afx_msg void OnMenuCmdReqa(); + afx_msg void OnMenuCmdSak(); + afx_msg void OnMenuCmdWupa(); + afx_msg void OnMenuCmdHalt(); + afx_msg void OnMenuCmdAtqa(); + afx_msg void OnMenuCmdAnticollisionReq(); + afx_msg void OnMenuCmdAnticollisionRsp(); + + clVSPRTransceiver *GetTransceiver() + { + return m_pTransceiver; + } +protected: + clVSPRTransceiver* m_pTransceiver; +public: + afx_msg void OnMenuSetUspip(); +}; + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/OddParityDlg.cpp b/Labs/Lab2/requirements/src/vspr/vspr/OddParityDlg.cpp new file mode 100644 index 0000000..db1c700 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/OddParityDlg.cpp @@ -0,0 +1,113 @@ +// OddParityDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "OddParityDlg.h" +#include "afxdialogex.h" + +#include "..\..\rfidsrc\class\OddParity.h" +#include "..\..\rfidsrc\class\clUSPTrans.h" +#include "mainfrm.h" + +using namespace VSPR_OF_ISO14443A; +// COddParityDlg Ի + +IMPLEMENT_DYNAMIC(COddParityDlg, CDialogEx) + +COddParityDlg::COddParityDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(COddParityDlg::IDD, pParent) +{ + m_nLocalOddParity = -1; + m_nRemoteOddParity = -1; + m_bRemote = false; + m_sInput = _T(""); +} + +COddParityDlg::~COddParityDlg() +{ +} + +void COddParityDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_LOCAL_ODDPARITY, m_nLocalOddParity); + DDV_MinMaxInt(pDX, m_nLocalOddParity, -1, 1); + DDX_Text(pDX, IDC_EDIT_REMOTE_ODDPARITY, m_nRemoteOddParity); + DDV_MinMaxInt(pDX, m_nRemoteOddParity, -1, 1); + DDX_Check(pDX, IDC_CHECK_REMOTE, m_bRemote); + DDX_Text(pDX, IDC_EDIT_HEX_INPUT, m_sInput); + DDV_MaxChars(pDX, m_sInput, 2); +} + + +BEGIN_MESSAGE_MAP(COddParityDlg, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_CAL, &COddParityDlg::OnClickedButtonCal) +END_MESSAGE_MAP() + + +// COddParityDlg Ϣ +void COddParityDlg::OnClickedButtonCal() +{ + // TODO: ڴӿؼ֪ͨ + + UpdateData( ); + + BYTE bdat = 0; + int k = 0, m; + m_sInput.MakeLower( ); + + while( k < 2 ) + { + if( m_sInput[k] >= '0' && m_sInput[k] <= '9' ) + { + m = m_sInput[k]-'0'; + } + else if ( m_sInput[k] >= 'a' && m_sInput[k] <= 'f' ) + { + m = m_sInput[k]-'a' + 10; + } + else + { + AfxMessageBox( _T("Ƿ1ֽ16") ); + return; + } + + if( k == 0 ) + { + bdat = m << 4; + } + else + { + bdat |= m; + } + k++; + } + + COddParity oddParity; + m_nLocalOddParity = oddParity.GetOddParity( bdat ); + if( m_bRemote ) + { + // ͵Զ + clVSPRTransceiver* pTransceiver = ((CMainFrame *)AfxGetMainWnd())->GetTransceiver(); + if( pTransceiver ) + { + pTransceiver->Send( &bdat, 8, VSPR_CMD_ODD_PARITY_REQ ); + + // ȴ1s. + Sleep(1000 ); + + UCHAR ucCmd; + UINT16 u16BitLen; + UCHAR abtBuf[200]; + u16BitLen = pTransceiver->Recv( abtBuf, 200, &ucCmd ); + if( ( u16BitLen > 0 ) && ( ucCmd == VSPR_CMD_ODD_PARITY_RSP ) ) + { + // ʾCRC_H/CRC_L + m_nRemoteOddParity = abtBuf[0]; + } + } + } + + UpdateData( false ); +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/OddParityDlg.h b/Labs/Lab2/requirements/src/vspr/vspr/OddParityDlg.h new file mode 100644 index 0000000..e629ca3 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/OddParityDlg.h @@ -0,0 +1,27 @@ +#pragma once + + +// COddParity Ի + +class COddParityDlg : public CDialogEx +{ + DECLARE_DYNAMIC(COddParityDlg) + +public: + COddParityDlg(CWnd* pParent = NULL); // ׼캯 + virtual ~COddParityDlg(); + +// Ի + enum { IDD = IDD_DLG_ODDPARITY }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + int m_nLocalOddParity; + int m_nRemoteOddParity; + BOOL m_bRemote; + afx_msg void OnClickedButtonCal(); + CString m_sInput; +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/ReadMe.txt b/Labs/Lab2/requirements/src/vspr/vspr/ReadMe.txt new file mode 100644 index 0000000..9cbb2a6 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/ReadMe.txt @@ -0,0 +1,111 @@ +================================================================================ +MICROSOFT : vspr Ŀ +=============================================================================== + +ӦóΪ vspr Ӧó򡣴Ӧó򲻽ʾ Microsoft Ļʹ÷ΪдӦó㡣 + +ļҪ vspr Ӧóÿļݡ + +vspr.vcxproj +ʹӦóɵ VC++ ĿĿļ +ɸļ Visual C++ İ汾ϢԼйʹӦóѡƽ̨úĿܵϢ + +vspr.vcxproj.filters + ʹáӦó򵼡ɵ VC++ Ŀɸѡļ + йĿļɸѡ֮ĹϢ IDE УֹͨضڵԷʽʾչļ磬.cppļ롰Դļɸѡ + +vspr.h +ӦóҪͷļĿضͷļ( Resource.h) CvsprApp Ӧóࡣ + +vspr.cpp +ǰӦó CvsprApp ҪӦóԴļ + +vspr.rc +dzʹõ Microsoft Windows Դб RES Ŀ¼д洢ͼꡢλͼ͹ꡣļֱ Microsoft Visual C++ нб༭ĿԴλ 2052 С + +res\vspr.ico +ӦóͼͼļͼҪԴļ vspr.rc С + +res\vspr.rc2 +ļ Microsoft Visual C++ нб༭ԴӦýԴ༭༭ԴڴļС + +///////////////////////////////////////////////////////////////////////////// + +ܴ: +Ŀ׼ MFC 档 + +MainFrm.h, MainFrm.cpp +Щļ CMainFrame +CFrameWnd SDI ܹܡ + +///////////////////////////////////////////////////////////////////////////// + +Ӧó򵼴һĵͺһͼ: + +vsprDoc.hvsprDoc.cpp - ĵ +Щļ CvsprDoc ࡣ༭Щļĵݲʵļͼ(ͨ CvsprDoc::Serialize) + +vsprView.hvsprView.cpp - ĵͼ +Щļ CvsprView ࡣ +CvsprView ڲ鿴 CvsprDoc + + + + +///////////////////////////////////////////////////////////////////////////// + +֧: + +hlp\vspr.hhp +ļǰĿļļΪ .chm ļݡ + +hlp\vspr.hhc +ļгĿݡ + +hlp\vspr.hhk +ļ + +hlp\afxcore.htm +ļ׼ MFC Ļı׼⡣ԼİӵļС + +makehtmlhelp.bat +ļϵͳļ + +hlp\Images\*.gif +Щ Microsoft ׼ı׼ļλͼļ + + +///////////////////////////////////////////////////////////////////////////// + +: + +ActiveX ؼ +Ӧóʹ ActiveX ؼ֧֡ + +///////////////////////////////////////////////////////////////////////////// + +׼ļ: + +StdAfx.hStdAfx.cpp +ЩļΪ vspr.pch Ԥͷ (PCH) ļΪ StdAfx.obj Ԥļ + +Resource.h +DZ׼ͷļµԴ ID +Microsoft Visual C++ ȡ´ļ + +vspr.manifest + Ӧó嵥ļ Windows XP Ӧó + ض汾г򼯵ԡسʹô + Ϣӳ򼯻ʵij򼯻 + Ӧó˽ϢӦó嵥Ϊ·ַΪ + Ӧóִļװͬļеⲿ .manifest ļ + ҲԴʽڸÿִļС +///////////////////////////////////////////////////////////////////////////// + +ע: + +ӦóʹáTODO:ָʾӦӻԶԴ벿֡ + +Ӧóڹ DLL ʹ MFCҪ·Щ MFC DLLӦóõϵͳĵǰòͬҪ·ӦıػԴ MFC100XXX.DLLйĸϢμ MSDN ĵй Redistributing Visual C++ applications (· Visual C++ Ӧó)½ڡ + +///////////////////////////////////////////////////////////////////////////// diff --git a/Labs/Lab2/requirements/src/vspr/vspr/SetIpofUSPDlg.cpp b/Labs/Lab2/requirements/src/vspr/vspr/SetIpofUSPDlg.cpp new file mode 100644 index 0000000..4247dd7 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/SetIpofUSPDlg.cpp @@ -0,0 +1,48 @@ +// SetIpofUSPDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "vspr.h" +#include "SetIpofUSPDlg.h" +#include "afxdialogex.h" + + +// CSetIpofUSPDlg Ի + +IMPLEMENT_DYNAMIC(CSetIpofUSPDlg, CDialogEx) + +CSetIpofUSPDlg::CSetIpofUSPDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CSetIpofUSPDlg::IDD, pParent) +{ + +} + +CSetIpofUSPDlg::~CSetIpofUSPDlg() +{ +} + +void CSetIpofUSPDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_IPADDRESS, m_ctlIpAddr); +} + + +BEGIN_MESSAGE_MAP(CSetIpofUSPDlg, CDialogEx) + ON_BN_CLICKED(IDOK, &CSetIpofUSPDlg::OnBnClickedOk) +END_MESSAGE_MAP() + + +// CSetIpofUSPDlg Ϣ + + +void CSetIpofUSPDlg::OnBnClickedOk() +{ + // TODO: ڴӿؼ֪ͨ + CDialogEx::OnOK(); + + BYTE b1,b2,b3,b4; + m_ctlIpAddr.GetAddress( b1, b2, b3, b4 ); + + sprintf_s(m_szIpAddr, "%d.%d.%d.%d", b1, b2, b3, b4 ); +} diff --git a/Labs/Lab2/requirements/src/vspr/vspr/SetIpofUSPDlg.h b/Labs/Lab2/requirements/src/vspr/vspr/SetIpofUSPDlg.h new file mode 100644 index 0000000..4b1e11e --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/SetIpofUSPDlg.h @@ -0,0 +1,25 @@ +#pragma once + + +// CSetIpofUSPDlg Ի + +class CSetIpofUSPDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CSetIpofUSPDlg) + +public: + CSetIpofUSPDlg(CWnd* pParent = NULL); // ׼캯 + virtual ~CSetIpofUSPDlg(); + +// Ի + enum { IDD = IDD_DLG_USP }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CIPAddressCtrl m_ctlIpAddr; + char m_szIpAddr[20]; + afx_msg void OnBnClickedOk(); +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/UserImages.bmp b/Labs/Lab2/requirements/src/vspr/vspr/UserImages.bmp new file mode 100644 index 0000000..affe657 Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/UserImages.bmp differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/Images/Bullet.gif b/Labs/Lab2/requirements/src/vspr/vspr/hlp/Images/Bullet.gif new file mode 100644 index 0000000..090f96c Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/hlp/Images/Bullet.gif differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_color.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_color.htm new file mode 100644 index 0000000..2143ee7 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_color.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ѡɫԻ) + + + + + + + + + + + +

ѡɫԻ

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_fileopen.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_fileopen.htm new file mode 100644 index 0000000..cf86fb9 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_fileopen.htm @@ -0,0 +1,78 @@ + + + + + + + + +(ļ->򿪡Ի) + + + + + + + + + + + +

ļ->򿪡Ի

+ + + +

ѡʹָҪ򿪵ļ:

+ + + +

ļ

+ + + +

ָҪ򿪵ļ˿г˴ + +гļֶ͡ѡչļ

+ + + +

гļ

+ + + +

ָҪ򿪵ļ:

+ + + +

<< ڴгӦóļ͡>>

+ + + +

+ + + +

ָ <<Ӧó>> д洢ļ

+ + + +

Ŀ¼

+ + + +

ָ <<Ӧó>> д洢ļĿ¼

+ + + +

+ + + +

˰ťӵijλãһµš

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_filesave.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_filesave.htm new file mode 100644 index 0000000..92d6eeb --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_filesave.htm @@ -0,0 +1,72 @@ + + + + + + + + +(ļ->ΪԻ) + + + + + + + + + + + +

ļ->ΪԻ

+ + + +

ѡʹָļƺλ:

+ + + +

ļ

+ + + +

ָһļòͬƱĵ<<Ӧó>> + +ļָ͡չ

+ + + +

+ + + +

ָҪд洢ĵ

+ + + +

Ŀ¼

+ + + +

ָҪд洢ĵĿ¼

+ + + +

+ + + +

˰ťӵijλãһµš

+ + + +

<<ļ->ΪԻѡ + +ȡӦóͨ CFileDialog ʹõ OPENFILENAME ṹ OFN_ ־ѡѡ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_find.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_find.htm new file mode 100644 index 0000000..c7f82e9 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_find.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ҡԻ) + + + + + + + + + + + +

ҡԻ

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_font.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_font.htm new file mode 100644 index 0000000..0ed2362 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_font.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ѡ塱Ի) + + + + + + + + + + + +

ѡ塱Ի

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_newtypedlg.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_newtypedlg.htm new file mode 100644 index 0000000..fb76c06 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_newtypedlg.htm @@ -0,0 +1,40 @@ + + + + + + + + +(ļ->½Ի) + + + + + + + + + + + +

½ļԻ

+ + + +

<<Ӧóֻ֧һĵͣɾ˰⡣>>

+ + + +

ָҪĵ:

+ + + +

<<ڴгӦóĵ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_replace.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_replace.htm new file mode 100644 index 0000000..afeb59b --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidd_replace.htm @@ -0,0 +1,32 @@ + + + + + + + + +(滻Ի) + + + + + + + + + + + +

滻Ի

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidp_default.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidp_default.htm new file mode 100644 index 0000000..9373b82 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidp_default.htm @@ -0,0 +1,40 @@ + + + + + + + + +(ûа) + + + + + + + + + + + +

ûа

+ + + +

ûдϢİá

+ + + +

<<ҪдضÿϢʾϢİ + +.hpj ļ [ALIAS] Ƴ AFX_HIDP_xxx ֵΪÿ AFX_HIDP_xxx ֵһ⡣磬AFX_HIDP_INVALID_FILENAME + +ЧļϢİ⡣>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_dockbar_top.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_dockbar_top.htm new file mode 100644 index 0000000..fe64d64 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_dockbar_top.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ͣ) + + + + + + + + + + + +

ͣ

+ + + +

ṩΪ˷ÿͣĹΪӦó򴴽ĬϹɽͣϳ˹ݿõĿռǡ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_status_bar.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_status_bar.htm new file mode 100644 index 0000000..0a3fdc1 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_status_bar.htm @@ -0,0 +1,68 @@ + + + + + + + + +(״̬) + + + + + + + + + + + + + + + + + + + +

״̬

+ + + +

״̬ʾ <<Ӧó>> ڵĵײҪʾ״̬ʹ + +ͼ˵еġ״̬

+ + + +

ʹüͷڸ˵еʱ״̬Բ˵IJ¹ťûͷ֮ǰͬʾðťϢ + +鿴˹ť˵ִиָӸùťƿȻͷ갴ť

+ + + +

״̬ҲָʾЩ:

+ + + +

ָʾ   ˵

+ + + +

CAP           Caps Lock ״̬

+ + + +

NUM         Num Lock ״̬

+ + + +

SCRL         Scroll Lock ״̬

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_toolbar.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_toolbar.htm new file mode 100644 index 0000000..a6c875b --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/afx_hidw_toolbar.htm @@ -0,0 +1,46 @@ + + + + + + + + +() + + + + + + + + + + + + + + + + + + + +

+ + + + + +

Ӧó򴰿ڵĶʾλڲ˵档ṩ˶ <<Ӧó>> öֹߵĿʡ

+ + + +

Ҫػʾ뵥ͼ˵еġ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_app_about.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_app_about.htm new file mode 100644 index 0000000..a36ee51 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_app_about.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ڡ(˵)) + + + + + + + + + + + +

ڡ(˵)

+ + + +

ʹôʾ <<Ӧó>> İȨͰ汾š

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_app_exit.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_app_exit.htm new file mode 100644 index 0000000..e735e8b --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_app_exit.htm @@ -0,0 +1,44 @@ + + + + + + + + +(ļ->˳) + + + + + + + + + + + + + + + + + + + +

˳(ļ˵)

+ + + +

ʹôԽ <<Ӧó>> Ựʹ + +Ӧó򡰿ơ˵еġرա<<Ӧó>> ʾиδĵ

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_context_help.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_context_help.htm new file mode 100644 index 0000000..5b01831 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_context_help.htm @@ -0,0 +1,40 @@ + + + + + + + + +(->ʹð) + + + + + + + + + + + +

İ

+ + + + + +

ʹôԻȡй <<Ӧó>> ijЩֵİѡ + +ġİťʱָ뽫ΪһʺŵļͷȻ󵥻 <<Ӧó>> еijλ(һť) + +йİ⽫ʾ

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_clear.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_clear.htm new file mode 100644 index 0000000..f1d8fe8 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_clear.htm @@ -0,0 +1,32 @@ + + + + + + + + +(༭->) + + + + + + + + + + + +

(༭˵)

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_clear_all.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_clear_all.htm new file mode 100644 index 0000000..8a848c2 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_clear_all.htm @@ -0,0 +1,32 @@ + + + + + + + + +(༭->ȫ) + + + + + + + + + + + +

ȫ(༭˵)

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_copy.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_copy.htm new file mode 100644 index 0000000..0103f12 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_copy.htm @@ -0,0 +1,38 @@ + + + + + + + + +(ơ(༭˵)) + + + + + + + + + + + +

ơ(༭˵)

+ + + +

ʹôԽѡݸƵϡǰδѡݣá

+ + + +

ݸƵ彫滻ǰ洢ڼݡ

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_cut.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_cut.htm new file mode 100644 index 0000000..8442b5d --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_cut.htm @@ -0,0 +1,38 @@ + + + + + + + + +(С(༭˵)) + + + + + + + + + + + +

С(༭˵)

+ + + +

ʹôԴĵƳѡݣ䷽ڼϡǰδѡݣá

+ + + +

ݼе彫滻ǰ洢ڼݡ

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_find.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_find.htm new file mode 100644 index 0000000..ba97b24 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_find.htm @@ -0,0 +1,32 @@ + + + + + + + + +(༭->ҡ) + + + + + + + + + + + +

ҡ(༭˵)

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_paste.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_paste.htm new file mode 100644 index 0000000..c1d24e0 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_paste.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ճ(༭˵)) + + + + + + + + + + + +

ճ(༭˵)

+ + + +

ʹôڲݵĸΪá

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_redo.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_redo.htm new file mode 100644 index 0000000..8b6e64d --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_redo.htm @@ -0,0 +1,32 @@ + + + + + + + + +((༭˵)) + + + + + + + + + + + +

(༭˵)

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_repeat.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_repeat.htm new file mode 100644 index 0000000..34ad928 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_repeat.htm @@ -0,0 +1,34 @@ + + + + + + + + +(༭->ظ) + + + + + + + + + + + +

ظ(༭˵)

+ + + +

ʹôظϴִеı༭޷ظһظ˵ + +޷ظ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_replace.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_replace.htm new file mode 100644 index 0000000..32848db --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_replace.htm @@ -0,0 +1,32 @@ + + + + + + + + +(༭->滻) + + + + + + + + + + + +

滻(༭˵)

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_undo.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_undo.htm new file mode 100644 index 0000000..198de67 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_edit_undo.htm @@ -0,0 +1,38 @@ + + + + + + + + +(/޷(༭˵)) + + + + + + + + + + + +

/޷(༭˵)

+ + + +

<<ӦóġûIJͬӦ޸Ĵ˰ı>>

+ + + +

ʹôԳһ༭(п)һľݶ仯 + +޷һ˵ϵġɡ޷

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_close.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_close.htm new file mode 100644 index 0000000..de2d2d7 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_close.htm @@ -0,0 +1,44 @@ + + + + + + + + +(ļ->رա) + + + + + + + + + + + + + + + + + + + +

رա(ļ˵)

+ + + +

ڹرհĵдڡ<<Ӧó>> ڹرĵ֮ǰĵеĸġδ漴رĵʧϴα + +иġڹرδĵ֮ǰ<<Ӧó>> ʾΪԻͱĵ

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_mru_file1.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_mru_file1.htm new file mode 100644 index 0000000..9c709cd --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_mru_file1.htm @@ -0,0 +1,40 @@ + + + + + + + + +(ļ 1234) + + + + + + + + + + + + + + + + + + + +

1, 2, 3, 4 (ļ˵)

+ + + +

ʹáļ˵ײгֺļرյĸĵѡҪ򿪵ĵӦ֡

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_new.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_new.htm new file mode 100644 index 0000000..805cf30 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_new.htm @@ -0,0 +1,46 @@ + + + + + + + + +(ļ->½) + + + + + + + + + + + + + + + + + + + +

½(ļ˵)

+ + + +

ʹô <<Ӧó>> дĵļ->½ԻѡҪļ͡<<Ӧó֧ + +һĵͣƳǰһӡ>>

+ + + +

򿪡ĵ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_open.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_open.htm new file mode 100644 index 0000000..213953b --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_open.htm @@ -0,0 +1,48 @@ + + + + + + + + +(ļ->򿪡) + + + + + + + + + + + + + + + + + + + +

򿪡(ļ˵)

+ + + +

ʹô´деĵһοɴ򿪶ĵʹ + +ڡ˵ڶ򿪵ĵ֮л 12...

+ + + +

ʹ½ĵ

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_save.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_save.htm new file mode 100644 index 0000000..5163aba --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_save.htm @@ -0,0 +1,44 @@ + + + + + + + + +(ļ->桱) + + + + + + + + + + + + + + + + + + + +

桱(ļ˵)

+ + + +

ʹôԽĵǰƺĿ¼档һαĵʱ<<Ӧó>> ʾΪԻԱĵ + +Ҫڱĵ֮ǰƺĿ¼ѡΪ

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_save_as.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_save_as.htm new file mode 100644 index 0000000..d77930a --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_save_as.htm @@ -0,0 +1,44 @@ + + + + + + + + +(ļ->Ϊ) + + + + + + + + + + + + + + + + + + + +

Ϊ(ļ˵)

+ + + +

ʹôԱĵ<<Ӧó>> ʾΪԻпĵ

+ + + +

ҪƺĿ¼ĵʹ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_send_mail.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_send_mail.htm new file mode 100644 index 0000000..ba065bd --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_file_send_mail.htm @@ -0,0 +1,36 @@ + + + + + + + + +(͡(ļ˵)) + + + + + + + + + + + +

͡(ļ˵)

+ + + +

ʹôͨʼͻĵʾ˻ĵʼڡȻд + +ռˡֶΡ⡱ֶεȣʼıɺ + +Ե͡ť͸ʼ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_help_index.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_help_index.htm new file mode 100644 index 0000000..6e64e13 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_help_index.htm @@ -0,0 +1,36 @@ + + + + + + + + +((˵)) + + + + + + + + + + + +

(˵)

+ + + +

ʹôʾʼĻʼĻУתʹ <<Ӧó>> ˵͸οϢ

+ + + +

򿪰֮󣬵Ŀ¼ťɷصʼĻ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_help_using.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_help_using.htm new file mode 100644 index 0000000..f7cba50 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_help_using.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ʹð(˵)) + + + + + + + + + + + +

ʹð(˵)

+ + + +

ʹôԻùʹð˵

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_ht_caption.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_ht_caption.htm new file mode 100644 index 0000000..90a3144 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_ht_caption.htm @@ -0,0 +1,72 @@ + + + + + + + + +() + + + + + + + + + + + +

+ + + +

<<ڴʾӦóı>>

+ + + +

λڴڵĶӦóĵơ

+ + + +

Ҫƶڣ϶ע: ͨ϶ԻıƶԻ

+ + + +

԰Ԫ:

+ + + +

Ӧóơ˵ť

+ + + +

ĵơ˵ť

+ + + +

󻯡ť

+ + + +

Сť

+ + + +

Ӧó

+ + + +

ĵ

+ + + +

ԭť

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_ht_nowhere.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_ht_nowhere.htm new file mode 100644 index 0000000..97df7e7 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_ht_nowhere.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ûа) + + + + + + + + + + + +

ûа

+ + + +

ûд˴İá

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_next_pane.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_next_pane.htm new file mode 100644 index 0000000..90ed107 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_next_pane.htm @@ -0,0 +1,32 @@ + + + + + + + + +(һ) + + + + + + + + + + + +

һ

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_prev_pane.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_prev_pane.htm new file mode 100644 index 0000000..9be20c0 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_prev_pane.htm @@ -0,0 +1,32 @@ + + + + + + + + +(һ) + + + + + + + + + + + +

һ

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_close.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_close.htm new file mode 100644 index 0000000..b16e490 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_close.htm @@ -0,0 +1 @@ +(رա(ơ˵))

رա(ơ˵)

ʹôԹرջڻԻ

˫ơ˵ͬѡ񡰹رա

ע: Ϊĵ˶ڣĵơ˵ϵġرաһνرһڡʹáļ˵ϵġرաͬʱرдڡ

diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_maximize.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_maximize.htm new file mode 100644 index 0000000..b5f37eb --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_maximize.htm @@ -0,0 +1,34 @@ + + + + + + + + +(󻯡(ϵͳ˵)) + + + + + + + + + + + +

󻯡(ϵͳ˵)

+ + + +

ʹôԷŴռÿռ䡣

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_minimize.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_minimize.htm new file mode 100644 index 0000000..c34ba8f --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_minimize.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ϵͳС) + + + + + + + + + + + +

С(Ӧó򡰿ơ˵)

+ + + +

ʹôԽ <<Ӧó>> СΪͼꡣ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_move.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_move.htm new file mode 100644 index 0000000..bc6df84 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_move.htm @@ -0,0 +1,36 @@ + + + + + + + + +(ƶ(ơ˵)) + + + + + + + + + + + +

ƶ(ơ˵)

+ + + +

ʹôʾһͷԱʹøüͷƶڻԻ

+ + + +

ע: 󻯣á

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_nextwindow.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_nextwindow.htm new file mode 100644 index 0000000..d4b784c --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_nextwindow.htm @@ -0,0 +1,34 @@ + + + + + + + + +(һڡ(ĵؼ˵)) + + + + + + + + + + + +

һڡ(ĵơ˵)

+ + + +

ʹôлһ򿪵ĵڡ<<Ӧó>> ݴ򿪴ڵ˳ȷһڡ

+ + + + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_prevwindow.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_prevwindow.htm new file mode 100644 index 0000000..f1bea21 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_prevwindow.htm @@ -0,0 +1,32 @@ + + + + + + + + +(һڡ(ĵơ˵)) + + + + + + + + + + + +

һڡ(ĵơ˵)

+ + + +

ʹôлһ򿪵ĵڡ<<Ӧó>> ݴ򿪴ڵ˳ȷһڡ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_restore.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_restore.htm new file mode 100644 index 0000000..df41799 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_restore.htm @@ -0,0 +1,34 @@ + + + + + + + + +(ԭ(ơ˵)) + + + + + + + + + + + +

ԭ(ơ˵)

+ + + +

ʹôԽڻԭΪѡ + +󻯡С֮ǰĴСλá

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_size.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_size.htm new file mode 100644 index 0000000..02c8f73 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_size.htm @@ -0,0 +1,52 @@ + + + + + + + + +(С(ϵͳ˵)) + + + + + + + + + + + +

С(ϵͳ˵)

+ + + +

ʹôʾһͷԱʹøüͷڵĴС

+ + + +

ָΪͷ֮:

+ + + +

1. һ(ͷҼͷϼͷ¼ͷ)ָƶҪƶı߿

+ + + +

2. ƶñ߿

+ + + +

3. ΪҪĴСʱ ENTER

+ + + +

ע: 󻯣á

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_tasklist.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_tasklist.htm new file mode 100644 index 0000000..47bb6d4 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_sc_tasklist.htm @@ -0,0 +1,100 @@ + + + + + + + + +(л(Ӧó򡰿ơ˵)) + + + + + + + + + + + +

л(Ӧó򡰿ơ˵)

+ + + +

ʹôʾдӦóбʹô + +блرбϵӦó

+ + + + + +

Իѡ

+ + + +

ѡлʱʾһѡĶԻ:

+ + + +

б

+ + + +

ָҪлرյӦó

+ + + +

л

+ + + +

ʹѡӦó

+ + + +

+ + + +

رѡӦó

+ + + +

ȡ

+ + + +

رб

+ + + +

+ + + +

д򿪵Ӧóʹ֮صҿԿÿһѡӰСΪͼӦó

+ + + +

ƽ

+ + + +

򿪵ӦóгɲصĴڡѡӰСΪͼӦó

+ + + +

ͼ

+ + + +

ĻĵײСӦóͼꡣ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_ruler.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_ruler.htm new file mode 100644 index 0000000..3b32aca --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_ruler.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ͼ->ߡ) + + + + + + + + + + + +

ߡ(ͼ˵)

+ + + +

<<ڴ˴дӦóضİ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_status_bar.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_status_bar.htm new file mode 100644 index 0000000..c5e1e34 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_status_bar.htm @@ -0,0 +1,48 @@ + + + + + + + + +(ͼ->״̬) + + + + + + + + + + + + + + + + + + + +

״̬(ͼ˵)

+ + + +

ʹôʾ״̬״̬ѡIJ˵ + +µĹťִеIJԼ̵״̬ʾ + +״̬ʱò˵Ա߻ʾһѡбǡ

+ + + +

йʹ״̬İϢ״̬

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_toolbar.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_toolbar.htm new file mode 100644 index 0000000..44d9123 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_view_toolbar.htm @@ -0,0 +1,46 @@ + + + + + + + + +(ͼ->) + + + + + + + + + + + + + + + + + + + +

(ͼ˵)

+ + + +

ʹôʾع <<Ӧó>> еijЩ( + +ļ->򿪡)İťʾʱò˵Ա߻ʾһѡбǡ

+ + + +

йʹùİϢ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_all.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_all.htm new file mode 100644 index 0000000..0407a6c --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_all.htm @@ -0,0 +1,34 @@ + + + + + + + + +(12...(ڡ˵)) + + + + + + + + + + + +

1, 2, ... (ڡ˵)

+ + + +

<<Ӧó>> ڡڡ˵ĵײ + +ʾǰ򿪵ĵбڵĵǰʾһѡбǡӴбѡһĵʹ䴰ڳΪġ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_arrange.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_arrange.htm new file mode 100644 index 0000000..db36361 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_arrange.htm @@ -0,0 +1,34 @@ + + + + + + + + +(ڡ->ͼꡱ) + + + + + + + + + + + +

ڡ->ͼꡱ

+ + + +

ʹôڵĵײСڵͼꡣڵĵײһ򿪵ĵڣֻܿȫͼ꣬ΪЩͼ걻 + +ĵڵסˡ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_cascade.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_cascade.htm new file mode 100644 index 0000000..f1a3155 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_cascade.htm @@ -0,0 +1,32 @@ + + + + + + + + +((ڡ˵)) + + + + + + + + + + + +

(ڡ˵)

+ + + +

ʹôصʽж򿪵Ĵڡ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_new.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_new.htm new file mode 100644 index 0000000..6475524 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_new.htm @@ -0,0 +1,34 @@ + + + + + + + + +(½(ڡ˵)) + + + + + + + + + + + +

½(ڡ˵)

+ + + +

ʹôԴͬ´ڡɴ򿪶ĵͬʱʾĵIJֻͬͼһеݣ + +ͬһĵĴڶᷴӳЩġ´ʱ´ڽΪڣʾд򿪴ڵĶ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_split.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_split.htm new file mode 100644 index 0000000..051ebf6 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_split.htm @@ -0,0 +1,36 @@ + + + + + + + + +(֡(ڡ˵)) + + + + + + + + + + + +

֡(ڡ˵)

+ + + +

ʹôԽڲֳɶȻʹϵļͷƶɺ󣬰갴ť Enter ǵλϡ Escape + + Խԭеλϡ<<ڵĵӦóУ + +ͼ˵С>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile.htm new file mode 100644 index 0000000..a5e5a11 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ƽ̡(ڡ˵)) + + + + + + + + + + + +

ƽ̡(ڡ˵)

+ + + +

ʹôԲصķʽж򿪵Ĵڡ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile_horz.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile_horz.htm new file mode 100644 index 0000000..e0426ab --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile_horz.htm @@ -0,0 +1,34 @@ + + + + + + + + +(ˮƽƽ̡(ڡ˵)) + + + + + + + + + + + +

ˮƽƽ̡(ڡ˵)

+ + + +

ʹôԲصķʽ + +ֱж򿪵Ĵڡ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile_vert.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile_vert.htm new file mode 100644 index 0000000..755bd1a --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hid_window_tile_vert.htm @@ -0,0 +1,32 @@ + + + + + + + + +(ֱƽ̡(ڡ˵)) + + + + + + + + + + + +

ֱƽ̡(ڡ˵)

+ + + +

ʹôԲж򿪵Ĵڡ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/hidr_doc1type.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hidr_doc1type.htm new file mode 100644 index 0000000..b91c892 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/hidr_doc1type.htm @@ -0,0 +1,56 @@ + + + + + + + + +(޸ĵ) + + + + + + + + + + + +

޸ĵ

+ + + +

<<ڴ˱дӦóضİṩûӦʹӦó޸ĵĸ

+ + + +

Ӧóֶ֧ĵͶϣÿͶһİ⣬ʹð ID + +ͨӦó򵼲 MAKEHELP.BAT ļ + +ɵġߣҲ԰·ʽ MAKEHM:

+ + + +

makehm IDR_HIDR_,0x2000 resource.h

+ + + +

磬ijĵ͵ IDR_ Ϊ IDR_CHARTTYPE MAKEHM ɵİ ID + + HIDR_CHARTTYPE

+ + + +

ע: Ӧó򵼶йظӦóֵ֧ĵһĵ͵İʹõ HIDR_DOC1TYPE ID + +Ӧó .hpj ļΪӦóһ HIDR_DOC1TYPE ӳ䵽ɸĵ͵ MAKEHM HIDR_>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/main_index.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/main_index.htm new file mode 100644 index 0000000..7c92cc4 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/main_index.htm @@ -0,0 +1,58 @@ + + + + + + + + +(<<Ӧó>> ) + + + + + + + + + + + +

<<Ӧó>>

+ + + +

...

+ + + +

<<ڴ˴Ӧóضİ>>

+ + + +

+ + + +

ļ˵

+ + + +

༭˵

+ + + + +

ͼ˵

+ + + + +

˵

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_edit.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_edit.htm new file mode 100644 index 0000000..c628006 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_edit.htm @@ -0,0 +1,79 @@ + + + + + + + + +(༭˵) + + + + + + + + + + + +

༭˵

+ + + +

˵ṩ:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
תһ༭
ĵɾݣƶ塣
ݴĵƵ塣
ճݴӼճĵС
+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_file.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_file.htm new file mode 100644 index 0000000..2dcccb6 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_file.htm @@ -0,0 +1,108 @@ + + + + + + + + +(ļ˵) + + + + + + + + + + + + + + + + + + + +

ļ˵

+ + + +

ļ˵ṩ:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
½ĵ
ĵ
ررմ򿪵ĵ
ʹͬļ򿪵ĵ
ΪѴ򿪵ĵ浽ָļ
˳˳ <<Ӧó>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_help.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_help.htm new file mode 100644 index 0000000..b87c05a --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_help.htm @@ -0,0 +1,58 @@ + + + + + + + + +(˵) + + + + + + + + + + + +

˵

+ + + +

˵ṩЩɰʹôӦó:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ṩͨԻð
ʾӦóİ汾š

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_view.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_view.htm new file mode 100644 index 0000000..d00cad8 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_view.htm @@ -0,0 +1,58 @@ + + + + + + + + +(ͼ˵) + + + + + + + + + + + +

ͼ˵

+ + + +

ͼ˵ṩ:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ʾع
״̬ʾ״̬
+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_window.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_window.htm new file mode 100644 index 0000000..3ef080a --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/menu_window.htm @@ -0,0 +1,87 @@ + + + + + + + + +(ڡ˵) + + + + + + + + + + + +

ڡ˵

+ + + +

ڡ˵ṩЩʹӦó򴰿жĵĶͼ:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
½鿴ͬһĵ´ڡ
صʽдڡ
ƽԻصʽдڡ
ͼѹرմڵͼꡣ
1, 2, ...תָڡ

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/scrollbars.htm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/scrollbars.htm new file mode 100644 index 0000000..921f400 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/scrollbars.htm @@ -0,0 +1,36 @@ + + + + + + + + +() + + + + + + + + + + + +

+ + + +

ĵڵұԵ͵ױԵʾڵĹָʾĵеĴֱˮƽλáʹĵе֡

+ + + +

<<ݹIJͬӦóеΪ>>

+ + + + + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.chm b/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.chm new file mode 100644 index 0000000..27a82ae Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.chm differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhc b/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhc new file mode 100644 index 0000000..3e4f3df --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhc @@ -0,0 +1,42 @@ + + + + + + +
    +
  • + + + +
  • + + +
      +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    +
  • + + + +
  • + + + +
+ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhk b/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhk new file mode 100644 index 0000000..c0ba08a --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhk @@ -0,0 +1,9 @@ + + + + + + +
    +
+ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhp b/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhp new file mode 100644 index 0000000..2222711 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/hlp/vspr.hhp @@ -0,0 +1,197 @@ +[OPTIONS] +Auto Index=Yes +Compatibility=1.1 or later +Compiled file=vspr.chm +Contents file=vspr.hhc +Index file=vspr.hhk +Default topic=main_index.htm +Display compile progress=No +Full-text search=Yes +Language=0x0804 (壬й) + + +[FILES] +afx_hidd_color.htm +afx_hidd_fileopen.htm +afx_hidd_filesave.htm +afx_hidd_find.htm +afx_hidd_font.htm +afx_hidd_newtypedlg.htm +afx_hidd_replace.htm +afx_hidp_default.htm +afx_hidw_dockbar_top.htm +afx_hidw_status_bar.htm +afx_hidw_toolbar.htm +hidr_doc1type.htm +hid_app_about.htm +hid_app_exit.htm +hid_context_help.htm +hid_edit_clear.htm +hid_edit_clear_all.htm +hid_edit_copy.htm +hid_edit_cut.htm +hid_edit_find.htm +hid_edit_paste.htm +hid_edit_redo.htm +hid_edit_repeat.htm +hid_edit_replace.htm +hid_edit_undo.htm +hid_file_close.htm +hid_file_mru_file1.htm +hid_file_new.htm +hid_file_open.htm +hid_file_save.htm +hid_file_save_as.htm +hid_file_send_mail.htm +hid_help_index.htm +hid_help_using.htm +hid_ht_caption.htm +hid_ht_nowhere.htm +hid_next_pane.htm +hid_prev_pane.htm +hid_sc_close.htm +hid_sc_maximize.htm +hid_sc_minimize.htm +hid_sc_move.htm +hid_sc_nextwindow.htm +hid_sc_prevwindow.htm +hid_sc_restore.htm +hid_sc_size.htm +hid_sc_tasklist.htm +hid_view_ruler.htm +hid_view_status_bar.htm +hid_view_toolbar.htm +hid_window_all.htm +hid_window_arrange.htm +hid_window_cascade.htm +hid_window_new.htm +hid_window_split.htm +hid_window_tile.htm +hid_window_tile_horz.htm +hid_window_tile_vert.htm +main_index.htm +menu_edit.htm +menu_file.htm +menu_help.htm +menu_view.htm +menu_window.htm +scrollbars.htm + +[ALIAS] +HIDR_MAINFRAME = main_index.htm + +main_index = main_index.htm +afx_hidd_color = afx_hidd_color.htm +afx_hidd_fileopen = afx_hidd_fileopen.htm +afx_hidd_filesave = afx_hidd_filesave.htm +afx_hidd_find = afx_hidd_find.htm +afx_hidd_font = afx_hidd_font.htm +afx_hidd_newtypedlg = afx_hidd_newtypedlg.htm +afx_hidd_replace = afx_hidd_replace.htm +AFX_HIDP_DEFAULT = AFX_HIDP_DEFAULT.htm +afx_hidw_dockbar_top = afx_hidw_dockbar_top.htm +afx_hidw_status_bar = afx_hidw_status_bar.htm +afx_hidw_toolbar = afx_hidw_toolbar.htm +hid_app_about = hid_app_about.htm +hid_app_exit = hid_app_exit.htm +hid_context_help = hid_context_help.htm +hid_edit_clear = hid_edit_clear.htm +hid_edit_clear_all = hid_edit_clear_all.htm +hid_edit_copy = hid_edit_copy.htm +hid_edit_cut = hid_edit_cut.htm +hid_edit_find = hid_edit_find.htm +hid_edit_paste = hid_edit_paste.htm +hid_edit_redo = hid_edit_redo.htm +hid_edit_repeat = hid_edit_repeat.htm +hid_edit_replace = hid_edit_replace.htm +hid_edit_undo = hid_edit_undo.htm +hid_file_close = hid_file_close.htm +hid_file_mru_file1 = hid_file_mru_file1.htm +hid_file_new = hid_file_new.htm +hid_file_open = hid_file_open.htm +hid_file_save = hid_file_save.htm +hid_file_save_as = hid_file_save_as.htm +hid_file_send_mail = hid_file_send_mail.htm +hid_help_index = hid_help_index.htm +hid_help_using = hid_help_using.htm +hid_ht_caption = hid_ht_caption.htm +hid_ht_nowhere = hid_ht_nowhere.htm +hid_next_pane = hid_next_pane.htm +hid_prev_pane = hid_prev_pane.htm +hid_sc_close = hid_sc_close.htm +hid_sc_maximize = hid_sc_maximize.htm +hid_sc_minimize = hid_sc_minimize.htm +hid_sc_move = hid_sc_move.htm +hid_sc_nextwindow = hid_sc_nextwindow.htm +hid_sc_prevwindow = hid_sc_prevwindow.htm +hid_sc_restore = hid_sc_restore.htm +hid_sc_size = hid_sc_size.htm +hid_sc_tasklist = hid_sc_tasklist.htm +hid_view_ruler = hid_view_ruler.htm +hid_view_status_bar = hid_view_status_bar.htm +hid_view_toolbar = hid_view_toolbar.htm +hid_window_all = hid_window_all.htm +hid_window_arrange = hid_window_arrange.htm +hid_window_cascade = hid_window_cascade.htm +hid_window_new = hid_window_new.htm +hid_window_split = hid_window_split.htm +hid_window_tile = hid_window_tile.htm +hid_window_tile_horz = hid_window_tile_horz.htm +hid_window_tile_vert = hid_window_tile_vert.htm +hidr_doc1type = hidr_doc1type.htm +menu_edit = menu_edit.htm +menu_file = menu_file.htm +menu_help = menu_help.htm +menu_view = menu_view.htm +menu_window = menu_window.htm +scrollbars = scrollbars.htm +HIDD_ABOUTBOX = HID_APP_ABOUT.htm +HID_HT_SIZE = HID_SC_SIZE.htm +HID_HT_HSCROLL = scrollbars.htm +HID_HT_VSCROLL = scrollbars.htm +HID_HT_MINBUTTON = HID_SC_MINIMIZE.htm +HID_HT_MAXBUTTON = HID_SC_MAXIMIZE.htm +AFX_HIDP_INVALID_FILENAME = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_OPEN_DOC = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_SAVE_DOC = AFX_HIDP_DEFAULT.htm +AFX_HIDP_ASK_TO_SAVE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_CREATE_DOC = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FILE_TOO_LARGE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_START_PRINT = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_LAUNCH_HELP = AFX_HIDP_DEFAULT.htm +AFX_HIDP_INTERNAL_FAILURE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_COMMAND_FAILURE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_PARSE_INT = AFX_HIDP_DEFAULT.htm +AFX_HIDP_PARSE_REAL = AFX_HIDP_DEFAULT.htm +AFX_HIDP_PARSE_INT_RANGE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_PARSE_REAL_RANGE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_PARSE_STRING_SIZE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_INVALID_FORMAT = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_INVALID_PATH = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_DISK_FULL = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_ACCESS_READ = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_ACCESS_WRITE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_IO_ERROR_READ = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_IO_ERROR_WRITE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_STATIC_OBJECT = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_CONNECT = AFX_HIDP_DEFAULT.htm +AFX_HIDP_SERVER_BUSY = AFX_HIDP_DEFAULT.htm +AFX_HIDP_BAD_VERB = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_MEMORY_ALLOC = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_NOTIFY = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_LAUNCH = AFX_HIDP_DEFAULT.htm +AFX_HIDP_ASK_TO_UPDATE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_UPDATE = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_REGISTER = AFX_HIDP_DEFAULT.htm +AFX_HIDP_FAILED_TO_AUTO_REGISTER = AFX_HIDP_DEFAULT.htm +AFX_HIDW_DOCKBAR_BOTTOM = AFX_HIDW_DOCKBAR_TOP.HTM ; Same topic, 4 different possible hit tests +AFX_HIDW_DOCKBAR_LEFT = AFX_HIDW_DOCKBAR_TOP.HTM ; Same topic, 4 different possible hit tests +AFX_HIDW_DOCKBAR_RIGHT = AFX_HIDW_DOCKBAR_TOP.HTM ; Same topic, 4 different possible hit tests + +[MAP] +#include HTMLDefines.h + +[TEXT POPUPS] +HTMLDefines.h + +[INFOTYPES] diff --git a/Labs/Lab2/requirements/src/vspr/vspr/res/Toolbar.bmp b/Labs/Lab2/requirements/src/vspr/vspr/res/Toolbar.bmp new file mode 100644 index 0000000..0556e00 Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/res/Toolbar.bmp differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/res/Toolbar256.bmp b/Labs/Lab2/requirements/src/vspr/vspr/res/Toolbar256.bmp new file mode 100644 index 0000000..14bd422 Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/res/Toolbar256.bmp differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/res/vspr.ico b/Labs/Lab2/requirements/src/vspr/vspr/res/vspr.ico new file mode 100644 index 0000000..d56fbcd Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/res/vspr.ico differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/res/vspr.rc2 b/Labs/Lab2/requirements/src/vspr/vspr/res/vspr.rc2 new file mode 100644 index 0000000..34986e6 Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/res/vspr.rc2 differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/res/vsprDoc.ico b/Labs/Lab2/requirements/src/vspr/vspr/res/vsprDoc.ico new file mode 100644 index 0000000..96365d4 Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/res/vsprDoc.ico differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/resource.h b/Labs/Lab2/requirements/src/vspr/vspr/resource.h new file mode 100644 index 0000000..15560de Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/resource.h differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/stdafx.cpp b/Labs/Lab2/requirements/src/vspr/vspr/stdafx.cpp new file mode 100644 index 0000000..d96f61c --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/stdafx.cpp @@ -0,0 +1,8 @@ + +// stdafx.cpp : ֻ׼ļԴļ +// vspr.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/stdafx.h b/Labs/Lab2/requirements/src/vspr/vspr/stdafx.h new file mode 100644 index 0000000..fac7631 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/stdafx.h @@ -0,0 +1,58 @@ + +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ + +#pragma once + +#ifndef _SECURE_ATL +#define _SECURE_ATL 1 +#endif + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Windows ͷųʹõ +#endif + +#include "targetver.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString 캯ʽ + +// ر MFC ijЩɷĺԵľϢ +#define _AFX_ALL_WARNINGS + +#include // MFC ͱ׼ +#include // MFC չ + + +#include // MFC Զ + + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC Internet Explorer 4 ؼ֧ +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC Windows ؼ֧ +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include // Ϳؼ MFC ֧ + + + + + + + + + +#ifdef _UNICODE +#if defined _M_IX86 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") +#elif defined _M_X64 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#else +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#endif +#endif + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/targetver.h b/Labs/Lab2/requirements/src/vspr/vspr/targetver.h new file mode 100644 index 0000000..0afac5b --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h ߰汾Ŀ Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vspr.aps b/Labs/Lab2/requirements/src/vspr/vspr/vspr.aps new file mode 100644 index 0000000..d58cb2f Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/vspr.aps differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vspr.cpp b/Labs/Lab2/requirements/src/vspr/vspr/vspr.cpp new file mode 100644 index 0000000..f79020f --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vspr.cpp @@ -0,0 +1,213 @@ + +// vspr.cpp : ӦóΪ +// + +#include "stdafx.h" +#include "afxwinappex.h" +#include "afxdialogex.h" +#include "vspr.h" +#include "MainFrm.h" + +#include "vsprDoc.h" +#include "vsprView.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CvsprApp + +BEGIN_MESSAGE_MAP(CvsprApp, CWinAppEx) + ON_COMMAND(ID_APP_ABOUT, &CvsprApp::OnAppAbout) + // ļı׼ĵ + ON_COMMAND(ID_FILE_NEW, &CWinAppEx::OnFileNew) + ON_COMMAND(ID_FILE_OPEN, &CWinAppEx::OnFileOpen) +END_MESSAGE_MAP() + + +// CvsprApp + +CvsprApp::CvsprApp() +{ + EnableHtmlHelp(); + + m_bHiColorIcons = TRUE; + + // ֧ + m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS; +#ifdef _MANAGED + // Ӧóùʱ֧(/clr)ģ: + // 1) д˸ãֲ֧ + // 2) ĿУ밴˳ System.Windows.Forms á + System::Windows::Forms::Application::SetUnhandledExceptionMode(System::Windows::Forms::UnhandledExceptionMode::ThrowException); +#endif + + // TODO: Ӧó ID ַ滻ΪΨһ ID ַַʽ + //Ϊ CompanyName.ProductName.SubProduct.VersionInformation + SetAppID(_T("vspr.AppID.NoVersion")); + + // TODO: ڴ˴ӹ룬 + // Ҫijʼ InitInstance +} + +// Ψһһ CvsprApp + +CvsprApp theApp; + + +// CvsprApp ʼ + +BOOL CvsprApp::InitInstance() +{ + // һ Windows XP ϵӦó嵥ָҪ + // ʹ ComCtl32.dll 汾 6 ߰汾ÿӻʽ + //Ҫ InitCommonControlsEx()򣬽޷ڡ + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // ΪҪӦóʹõ + // ؼࡣ + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + + CWinAppEx::InitInstance(); + + + // ʼ OLE + if (!AfxOleInit()) + { + AfxMessageBox(IDP_OLE_INIT_FAILED); + return FALSE; + } + + AfxEnableControlContainer(); + + EnableTaskbarInteraction(FALSE); + + // ʹ RichEdit ؼҪ AfxInitRichEdit2() + // AfxInitRichEdit2(); + + // ׼ʼ + // δʹЩܲϣС + // տִļĴСӦƳ + // Ҫضʼ + // ڴ洢õע + // TODO: Ӧʵ޸ĸַ + // ޸Ϊ˾֯ + SetRegistryKey(_T("ӦóɵıӦó")); + LoadStdProfileSettings(4); // ر׼ INI ļѡ( MRU) + + + InitContextMenuManager(); + + InitKeyboardManager(); + + InitTooltipManager(); + CMFCToolTipInfo ttParams; + ttParams.m_bVislManagerTheme = TRUE; + theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL, + RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams); + + // עӦóĵģ塣ĵģ + // ĵܴںͼ֮ + CSingleDocTemplate* pDocTemplate; + pDocTemplate = new CSingleDocTemplate( + IDR_MAINFRAME, + RUNTIME_CLASS(CvsprDoc), + RUNTIME_CLASS(CMainFrame), // SDI ܴ + RUNTIME_CLASS(CvsprView)); + if (!pDocTemplate) + return FALSE; + AddDocTemplate(pDocTemplate); + + + // ׼ shell DDEļ + CCommandLineInfo cmdInfo; + ParseCommandLine(cmdInfo); + + + + // ָ + // /RegServer/Register/Unregserver /Unregister Ӧó򷵻 FALSE + if (!ProcessShellCommand(cmdInfo)) + return FALSE; + + // Ψһһѳʼʾи + m_pMainWnd->ShowWindow(SW_SHOW); + m_pMainWnd->UpdateWindow(); + // к׺ʱŵ DragAcceptFiles + // SDI ӦóУӦ ProcessShellCommand ֮ + return TRUE; +} + +int CvsprApp::ExitInstance() +{ + //TODO: ӵĸԴ + AfxOleTerm(FALSE); + + return CWinAppEx::ExitInstance(); +} + +// CvsprApp Ϣ + + +// Ӧó򡰹ڡ˵ CAboutDlg Ի + +class CAboutDlg : public CDialogEx +{ +public: + CAboutDlg(); + +// Ի + enum { IDD = IDD_ABOUTBOX }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + +// ʵ +protected: + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD) +{ +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) +END_MESSAGE_MAP() + +// жԻӦó +void CvsprApp::OnAppAbout() +{ + CAboutDlg aboutDlg; + aboutDlg.DoModal(); +} + +// CvsprApp Զ/淽 + +void CvsprApp::PreLoadState() +{ + BOOL bNameValid; + CString strName; + bNameValid = strName.LoadString(IDS_EDIT_MENU); + ASSERT(bNameValid); + GetContextMenuManager()->AddMenu(strName, IDR_POPUP_EDIT); +} + +void CvsprApp::LoadCustomState() +{ +} + +void CvsprApp::SaveCustomState() +{ +} + +// CvsprApp Ϣ + + + diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vspr.h b/Labs/Lab2/requirements/src/vspr/vspr/vspr.h new file mode 100644 index 0000000..a98cd9e --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vspr.h @@ -0,0 +1,40 @@ + +// vspr.h : vspr Ӧóͷļ +// +#pragma once + +#ifndef __AFXWIN_H__ + #error "ڰļ֮ǰstdafx.h PCH ļ" +#endif + +#include "resource.h" // + + +// CvsprApp: +// йشʵ֣ vspr.cpp +// + +class CvsprApp : public CWinAppEx +{ +public: + CvsprApp(); + + +// д +public: + virtual BOOL InitInstance(); + virtual int ExitInstance(); + +// ʵ + UINT m_nAppLook; + BOOL m_bHiColorIcons; + + virtual void PreLoadState(); + virtual void LoadCustomState(); + virtual void SaveCustomState(); + + afx_msg void OnAppAbout(); + DECLARE_MESSAGE_MAP() +}; + +extern CvsprApp theApp; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vspr.rc b/Labs/Lab2/requirements/src/vspr/vspr/vspr.rc new file mode 100644 index 0000000..8e5746d Binary files /dev/null and b/Labs/Lab2/requirements/src/vspr/vspr/vspr.rc differ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj b/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj new file mode 100644 index 0000000..3bec10e --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj @@ -0,0 +1,455 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {52B64FA8-32A0-49D7-BDF5-26AE8BD35E87} + vspr + MFCProj + + + + Application + true + Unicode + Dynamic + + + Application + false + true + Unicode + Dynamic + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + + + Windows + true + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0804 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0804 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + Document + $(OutDir)vspr.chm;%(Outputs) + hlp\HTMLDefines.h;%(AdditionalInputs) + start /wait hhc "hlp\vspr.hhp" +if not exist "hlp\vspr.chm" goto :HelpError +copy "hlp\vspr.chm" "$(OutDir)vspr.chm" +goto :HelpDone +:HelpError +echo hlp\vspr.hhp(1) : error:创建帮助文件时遇到问题 +echo. +:HelpDone +echo. + + 正在生成帮助文件... + $(OutDir)vspr.chm;%(Outputs) + hlp\HTMLDefines.h;%(AdditionalInputs) + start /wait hhc "hlp\vspr.hhp" +if not exist "hlp\vspr.chm" goto :HelpError +copy "hlp\vspr.chm" "$(OutDir)vspr.chm" +goto :HelpDone +:HelpError +echo hlp\vspr.hhp(1) : error:创建帮助文件时遇到问题 +echo. +:HelpDone +echo. + + 正在生成帮助文件... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + hlp\HTMLDefines.h;%(Outputs) + echo // 生成的帮助映射文件。使用者为vspr.HHP. > "hlp\HTMLDefines.h" +echo. > "hlp\HTMLDefines.h" +echo // 命令(ID_* 和 IDM_*) >> "hlp\HTMLDefines.h" +makehm /h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 "%(FullPath)" >> "hlp\HTMLDefines.h" +echo. >> "hlp\HTMLDefines.h" +echo // 提示(IDP_*) >> "hlp\HTMLDefines.h" +makehm /h IDP_,HIDP_,0x30000 "%(FullPath)" >> "hlp\HTMLDefines.h" +echo. >> "hlp\HTMLDefines.h" +echo // 资源(IDR_*) >> "hlp\HTMLDefines.h" +makehm /h IDR_,HIDR_,0x20000 "%(FullPath)" >> "hlp\HTMLDefines.h" +echo. >> "hlp\HTMLDefines.h" +echo // 对话框(IDD_*) >> "hlp\HTMLDefines.h" +makehm /h IDD_,HIDD_,0x20000 "%(FullPath)" >> "hlp\HTMLDefines.h" +echo. >> "hlp\HTMLDefines.h" +echo // 框架控件(IDW_*) >> "hlp\HTMLDefines.h" +makehm /h /a afxhh.h IDW_,HIDW_,0x50000 "%(FullPath)" >> "hlp\HTMLDefines.h" + + 正在生成帮助编译器的映射文件... + hlp\HTMLDefines.h;%(Outputs) + echo // 生成的帮助映射文件。使用者为vspr.HHP. > "hlp\HTMLDefines.h" +echo. > "hlp\HTMLDefines.h" +echo // 命令(ID_* 和 IDM_*) >> "hlp\HTMLDefines.h" +makehm /h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 "%(FullPath)" >> "hlp\HTMLDefines.h" +echo. >> "hlp\HTMLDefines.h" +echo // 提示(IDP_*) >> "hlp\HTMLDefines.h" +makehm /h IDP_,HIDP_,0x30000 "%(FullPath)" >> "hlp\HTMLDefines.h" +echo. >> "hlp\HTMLDefines.h" +echo // 资源(IDR_*) >> "hlp\HTMLDefines.h" +makehm /h IDR_,HIDR_,0x20000 "%(FullPath)" >> "hlp\HTMLDefines.h" +echo. >> "hlp\HTMLDefines.h" +echo // 对话框(IDD_*) >> "hlp\HTMLDefines.h" +makehm /h IDD_,HIDD_,0x20000 "%(FullPath)" >> "hlp\HTMLDefines.h" +echo. >> "hlp\HTMLDefines.h" +echo // 框架控件(IDW_*) >> "hlp\HTMLDefines.h" +makehm /h /a afxhh.h IDW_,HIDW_,0x50000 "%(FullPath)" >> "hlp\HTMLDefines.h" + + 正在生成帮助编译器的映射文件... + + + + + + + + + + + + NotUsing + + + NotUsing + + + + NotUsing + + + NotUsing + + + NotUsing + + + + + + + + + + + + + + + + + + Create + Create + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj.filters b/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj.filters new file mode 100644 index 0000000..0bc658c --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj.filters @@ -0,0 +1,432 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8ac95954-76a1-4ed8-91af-bcea37585668} + hhp;hhc;hhk;gif;jpg + + + {3dd02135-781b-48bb-bb7f-9d5ea658e60f} + htm;html + + + + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + HTML 帮助文件 + + + HTML 帮助文件 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + HTML 帮助主题 + + + 资源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 资源文件 + + + + + HTML 帮助文件 + + + 头文件 + + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj.user b/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj.user new file mode 100644 index 0000000..3f03091 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vspr.vcxproj.user @@ -0,0 +1,6 @@ + + + + false + + \ No newline at end of file diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vsprDoc.cpp b/Labs/Lab2/requirements/src/vspr/vspr/vsprDoc.cpp new file mode 100644 index 0000000..811c505 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vsprDoc.cpp @@ -0,0 +1,182 @@ + +// vsprDoc.cpp : CvsprDoc ʵ +// + +#include "stdafx.h" +// SHARED_HANDLERS ʵԤͼɸѡ +// ATL Ŀнж壬Ŀĵ롣 +#ifndef SHARED_HANDLERS +#include "vspr.h" +#endif + +#include "vsprDoc.h" +#include +#include +using namespace std; + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +// CvsprDoc + +IMPLEMENT_DYNCREATE(CvsprDoc, CDocument) + +BEGIN_MESSAGE_MAP(CvsprDoc, CDocument) +END_MESSAGE_MAP() + + +// CvsprDoc / + +CvsprDoc::CvsprDoc() +{ + // TODO: ڴһԹ +#if 0 + m_pBuf = NULL; + m_nLen = 0; + m_nMaxLen = 1024; + + { + // ԣ + char buf[100]; + for( int i = 0; i < 100; i++ ) + { + buf[i] = i%2; + } + + setShowBuf(buf, 100 ); + } +#endif +} + +CvsprDoc::~CvsprDoc() +{ +#if 0 + if( m_pBuf ) + { + delete[] m_pBuf; + m_pBuf = NULL; + m_nLen = 0; + } +#endif +} + +BOOL CvsprDoc::OnNewDocument() +{ + if (!CDocument::OnNewDocument()) + return FALSE; + + // TODO: ڴ³ʼ + // (SDI ĵøĵ) + + return TRUE; +} + + +int CvsprDoc::setShowBuf( char *pBuf, int len ) +{ +#if 0 + try + { + if( !m_pBuf ) + { + m_pBuf = new char[m_nMaxLen]; + } + } + catch( bad_alloc &ba ) + { + return 0; + } + m_nLen = len > m_nMaxLen ? m_nMaxLen : len; + memcpy( m_pBuf, pBuf, m_nLen ); + return m_nLen; +#endif + return 0; +} + + + +// CvsprDoc л + +void CvsprDoc::Serialize(CArchive& ar) +{ + if (ar.IsStoring()) + { + // TODO: ڴӴ洢 + } + else + { + // TODO: ڴӼش + } +} + +#ifdef SHARED_HANDLERS + +// ͼ֧ +void CvsprDoc::OnDrawThumbnail(CDC& dc, LPRECT lprcBounds) +{ + // ޸Ĵ˴Իĵ + dc.FillSolidRect(lprcBounds, RGB(255, 255, 255)); + + CString strText = _T("TODO: implement thumbnail drawing here"); + LOGFONT lf; + + CFont* pDefaultGUIFont = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)); + pDefaultGUIFont->GetLogFont(&lf); + lf.lfHeight = 36; + + CFont fontDraw; + fontDraw.CreateFontIndirect(&lf); + + CFont* pOldFont = dc.SelectObject(&fontDraw); + dc.DrawText(strText, lprcBounds, DT_CENTER | DT_WORDBREAK); + dc.SelectObject(pOldFont); +} + +// ֧ +void CvsprDoc::InitializeSearchContent() +{ + CString strSearchContent; + // ĵݡ + // ݲӦɡ;ָ + + // : strSearchContent = _T("point;rectangle;circle;ole object;") + SetSearchContent(strSearchContent); +} + +void CvsprDoc::SetSearchContent(const CString& value) +{ + if (value.IsEmpty()) + { + RemoveChunk(PKEY_Search_Contents.fmtid, PKEY_Search_Contents.pid); + } + else + { + CMFCFilterChunkValueImpl *pChunk = NULL; + ATLTRY(pChunk = new CMFCFilterChunkValueImpl); + if (pChunk != NULL) + { + pChunk->SetTextValue(PKEY_Search_Contents, value, CHUNK_TEXT); + SetChunkValue(pChunk); + } + } +} + +#endif // SHARED_HANDLERS + +// CvsprDoc + +#ifdef _DEBUG +void CvsprDoc::AssertValid() const +{ + CDocument::AssertValid(); +} + +void CvsprDoc::Dump(CDumpContext& dc) const +{ + CDocument::Dump(dc); +} +#endif //_DEBUG + + +// CvsprDoc diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vsprDoc.h b/Labs/Lab2/requirements/src/vspr/vspr/vsprDoc.h new file mode 100644 index 0000000..6dfe853 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vsprDoc.h @@ -0,0 +1,55 @@ + +// vsprDoc.h : CvsprDoc Ľӿ +// + + +#pragma once + + +class CvsprDoc : public CDocument +{ +protected: // л + CvsprDoc(); + DECLARE_DYNCREATE(CvsprDoc) + +// +public: + // clientʾIJ. + // m_nLen=0ʱûݣʾ +#if 0 + char *m_pBuf; + int m_nLen; + int m_nMaxLen; // 1024أ +#endif +// +public: + // ʵʾıس + int setShowBuf( char *pBuf, int len ); +// д +public: + virtual BOOL OnNewDocument(); + virtual void Serialize(CArchive& ar); +#ifdef SHARED_HANDLERS + virtual void InitializeSearchContent(); + virtual void OnDrawThumbnail(CDC& dc, LPRECT lprcBounds); +#endif // SHARED_HANDLERS + +// ʵ +public: + virtual ~CvsprDoc(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + +// ɵϢӳ亯 +protected: + DECLARE_MESSAGE_MAP() + +#ifdef SHARED_HANDLERS + // Ϊݵ Helper + void SetSearchContent(const CString& value); +#endif // SHARED_HANDLERS +}; diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vsprView.cpp b/Labs/Lab2/requirements/src/vspr/vspr/vsprView.cpp new file mode 100644 index 0000000..9b272a4 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vsprView.cpp @@ -0,0 +1,130 @@ + +// vsprView.cpp : CvsprView ʵ +// + +#include "stdafx.h" +// SHARED_HANDLERS ʵԤͼɸѡ +// ATL Ŀнж壬Ŀĵ롣 +#ifndef SHARED_HANDLERS +#include "vspr.h" +#endif + +#include "vsprDoc.h" +#include "vsprView.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CvsprView + +IMPLEMENT_DYNCREATE(CvsprView, CScrollView) + +BEGIN_MESSAGE_MAP(CvsprView, CScrollView) + ON_WM_CONTEXTMENU() + ON_WM_RBUTTONUP() +END_MESSAGE_MAP() + +// CvsprView / + +CvsprView::CvsprView() +{ + // TODO: ڴ˴ӹ + +} + +CvsprView::~CvsprView() +{ +} + +BOOL CvsprView::PreCreateWindow(CREATESTRUCT& cs) +{ + // TODO: ڴ˴ͨ޸ + // CREATESTRUCT cs ޸Ĵʽ + + return CScrollView::PreCreateWindow(cs); +} + +// CvsprView + +void CvsprView::OnDraw(CDC *pDC) +{ + CvsprDoc* pDoc = GetDocument(); + ASSERT_VALID(pDoc); + if (!pDoc) + return; + + // TODO: ڴ˴Ϊӻƴ +#if 0 + if( pDoc->m_nLen ) + { + // ʼƲ. + int x = 0, y = 100; + pDC->MoveTo( x, y ); // ʼλΪ. + for( int i = 0; i < pDoc->m_nLen; i++ ) + { + if( pDoc->m_pBuf[i] == 0 ) + { + y = 100; + pDC->LineTo( x, y ); + pDC->LineTo( x+10, y ); + } + else + { + y = 10; + pDC->LineTo( x, y ); + pDC->LineTo( x+10, y ); + } + x += 10; + } + } +#endif +} + +void CvsprView::OnInitialUpdate() +{ + CScrollView::OnInitialUpdate(); + + CSize sizeTotal; + // TODO: ͼĺϼƴС + sizeTotal.cx = sizeTotal.cy = 100; + SetScrollSizes(MM_TEXT, sizeTotal); +} + +void CvsprView::OnRButtonUp(UINT /* nFlags */, CPoint point) +{ + ClientToScreen(&point); + OnContextMenu(this, point); +} + +void CvsprView::OnContextMenu(CWnd* /* pWnd */, CPoint point) +{ +#ifndef SHARED_HANDLERS + theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_EDIT, point.x, point.y, this, TRUE); +#endif +} + + +// CvsprView + +#ifdef _DEBUG +void CvsprView::AssertValid() const +{ + CScrollView::AssertValid(); +} + +void CvsprView::Dump(CDumpContext& dc) const +{ + CScrollView::Dump(dc); +} + +CvsprDoc* CvsprView::GetDocument() const // ǵ԰汾 +{ + ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CvsprDoc))); + return (CvsprDoc*)m_pDocument; +} +#endif //_DEBUG + + +// CvsprView Ϣ diff --git a/Labs/Lab2/requirements/src/vspr/vspr/vsprView.h b/Labs/Lab2/requirements/src/vspr/vspr/vsprView.h new file mode 100644 index 0000000..9db2071 --- /dev/null +++ b/Labs/Lab2/requirements/src/vspr/vspr/vsprView.h @@ -0,0 +1,50 @@ + +// vsprView.h : CvsprView Ľӿ +// + +#pragma once + + +class CvsprView : public CScrollView +{ +protected: // л + CvsprView(); + DECLARE_DYNCREATE(CvsprView) + +// +public: + CvsprDoc* GetDocument() const; + +// +public: + +// д +public: + virtual void OnDraw(CDC* pDC); // дԻƸͼ + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); +protected: + virtual void OnInitialUpdate(); // һε + +// ʵ +public: + virtual ~CvsprView(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + +// ɵϢӳ亯 +protected: + afx_msg void OnFilePrintPreview(); + afx_msg void OnRButtonUp(UINT nFlags, CPoint point); + afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); + DECLARE_MESSAGE_MAP() +}; + +#ifndef _DEBUG // vsprView.cpp еĵ԰汾 +inline CvsprDoc* CvsprView::GetDocument() const + { return reinterpret_cast(m_pDocument); } +#endif + diff --git a/Labs/Lab2/tmp/pcd.exe b/Labs/Lab2/tmp/pcd.exe new file mode 100644 index 0000000..edf73a5 Binary files /dev/null and b/Labs/Lab2/tmp/pcd.exe differ diff --git a/Labs/Lab2/tmp/picc.exe b/Labs/Lab2/tmp/picc.exe new file mode 100644 index 0000000..5142381 Binary files /dev/null and b/Labs/Lab2/tmp/picc.exe differ