bla
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld.vcproj", "{D227A517-3E51-4CF2-BD63-1271A1083545}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D227A517-3E51-4CF2-BD63-1271A1083545}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D227A517-3E51-4CF2-BD63-1271A1083545}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D227A517-3E51-4CF2-BD63-1271A1083545}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D227A517-3E51-4CF2-BD63-1271A1083545}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="HelloWorld"
|
||||
ProjectGUID="{D227A517-3E51-4CF2-BD63-1271A1083545}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\bin"
|
||||
IntermediateDirectory=".\obj"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\bin/HelloWorld.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="0"
|
||||
PrecompiledHeaderFile=".\obj/HelloWorld.pch"
|
||||
AssemblerListingLocation=".\obj/"
|
||||
ObjectFile=".\obj/"
|
||||
ProgramDataBaseFileName=".\obj/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=".\lib\openpcd.lib"
|
||||
OutputFile=".\bin/HelloWorld.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateManifest="false"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\bin/HelloWorld.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\bin/HelloWorld.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\bin"
|
||||
IntermediateDirectory=".\obj"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\bin/HelloWorld.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\obj/HelloWorld.pch"
|
||||
AssemblerListingLocation=".\obj/"
|
||||
ObjectFile=".\obj/"
|
||||
ProgramDataBaseFileName=".\obj/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1031"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=".\lib\librfid.lib"
|
||||
OutputFile=".\bin/HelloWorld.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\bin/HelloWorld.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\bin/HelloWorld.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Quellcodedateien"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="main.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header-Dateien"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\api\openpcd.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Libraries"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
Binary file not shown.
@@ -0,0 +1,95 @@
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "..\..\api\openpcd.h"
|
||||
|
||||
MIFARE_HANDLE handle;
|
||||
|
||||
void hexdump (const char *buffer, unsigned int len)
|
||||
{
|
||||
while (len--)
|
||||
printf (" %02X", (unsigned char)*buffer++);
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int res,ErrorCount;
|
||||
unsigned int uid;
|
||||
/* const char text1[] = "Hello!", text2[] = "World!", *text;*/
|
||||
char buffer[20];
|
||||
bool allow_reset,first;
|
||||
|
||||
allow_reset=first=true;
|
||||
handle=NULL;
|
||||
ErrorCount=0;
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(!handle)
|
||||
{
|
||||
if ((res = openpcd_open_reader (&handle)) < 0)
|
||||
handle=NULL;
|
||||
else
|
||||
printf ("STATUS: Reader=%02X\n",(unsigned int)handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((res = openpcd_select_card (handle)) < 0)
|
||||
{
|
||||
// optionally reset reader once after some errors
|
||||
if(++ErrorCount>3)
|
||||
{
|
||||
printf ("ERROR: Can't select card: %s\n", openpcd_get_error_text (res));
|
||||
printf ("STATUS: resetting reader\n");
|
||||
ErrorCount=0;
|
||||
|
||||
if(allow_reset)
|
||||
{
|
||||
allow_reset=false;
|
||||
openpcd_reset_reader(handle);
|
||||
}
|
||||
}
|
||||
openpcd_close_reader (handle);
|
||||
handle=NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(openpcd_get_card_id(handle,&uid)<0)
|
||||
uid=-1;
|
||||
|
||||
printf ("DONE: selected card [0x%08X]\n",uid);
|
||||
|
||||
if ((res = openpcd_read (handle, 2, buffer, 6)) < 0)
|
||||
printf ("ERROR: Read card error: %s\n",
|
||||
openpcd_get_error_text (res));
|
||||
else
|
||||
{
|
||||
printf ("DONE - %i bytes read:", res);
|
||||
hexdump (buffer, res);
|
||||
}
|
||||
|
||||
/* text = strncmp (buffer, text1, 6) ? text1 : text2;
|
||||
|
||||
if ((res = openpcd_write (handle, 2, text, 6)) < 0)
|
||||
printf ("ERROR: Write card error: %s\n",
|
||||
openpcd_get_error_text (res));
|
||||
else
|
||||
{
|
||||
buffer[res] = 0;
|
||||
printf ("DONE: written %i bytes [%s]\n", res, text);
|
||||
}*/
|
||||
|
||||
openpcd_deselect_card (handle);
|
||||
|
||||
printf ("STATUS: deselected card\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openpcd_close_reader (handle);
|
||||
printf ("STATUS: closed reader\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user