Commitdd68b8d1 by developer2

ufr_lib removed

家长 b04d3857
No preview for this file type
No preview for this file type
No preview for this file type
... ... @@ -56,9 +56,9 @@
option="-Wall"/>
option="-pipe"/>
option="-mthreads"/>
option="-Wall"/>
option="-D__GNUWIN32__"/>
option="-D__WXMSW__"/>
option="-DwxUSE_UNICODE"/>
... ... @@ -84,8 +84,10 @@
library="libodbc32.a"/>
library="libuFCoder-x86.a"/>
library="libws2_32.a"/>
library="ufr-lib/windows/static-x86/ftd2xx.lib"/>
directory="ufr-lib/windows/static-x86"/>
library="lib/windows/static-x86/ftd2xx_coff.lib"/>
library="lib/windows/static-x86/libtomcrypt.a"/>
library="lib/windows/static-x86/libtommath.a"/>
directory="lib/windows/static-x86"/>
filename="ftd2xx.h"/>
filename="resource.rc">
... ...
... ... @@ -2,14 +2,24 @@
major="1"minor="0"/>
name="Release"/>
name="uFR_Readers_toolMain.cpp"open="1"top="1"tabpos="1"split="0"active="1"splitpos="0"zoom_1="0"zoom_2="0">
name="ftd2xx.h"open="1"top="0"tabpos="3"split="0"active="1"splitpos="0"zoom_1="0"zoom_2="0">
position="40916"topLine="775"/>
position="0"topLine="0"/>
name="uFR_Readers_toolMain.cpp"open="1"top="0"tabpos="1"split="0"active="1"splitpos="0"zoom_1="0"zoom_2="0">
position="43969"topLine="828"/>
name="uFR_Readers_toolMain.h"open="1"top="0"tabpos="2"split="0"active="1"splitpos="0"zoom_1="0"zoom_2="0">
position="945"topLine="12"/>
position="375"topLine="0"/>
name="uFR_Readers_toolApp.cpp"open="1"top="0"tabpos="4"split="0"active="1"splitpos="0"zoom_1="0"zoom_2="0">
position="0"topLine="0"/>
... ... @@ -14,7 +14,7 @@
#endif
#include "uFR_Readers_toolMain.h"
#include
#include "ufr-lib/include/uFCoder.h"
#include "lib/include/uFCoder.h"
#include "ftd2xx.h"
#include
#include
... ... @@ -38,6 +38,7 @@ baudRate[10] = 576000;
baudRate[11] = 921600;
baudRate[12] = 1000000;*/
/*
std::map baudRate = {
{0, 2400},
{1, 4800},
... ... @@ -53,7 +54,7 @@ std::map baudRate = {
{11, 921600},
{12, 1000000}
};
*/
voidConvertStringToUint8Array(std::stringstr,uint8_t*array)
{
... ... @@ -128,6 +129,8 @@ const long uFR_Readers_toolFrame::ID_BUTTON7 = wxNewId();
constlonguFR_Readers_toolFrame::ID_STATICTEXT19=wxNewId();
constlonguFR_Readers_toolFrame::ID_COMBOBOX5=wxNewId();
constlonguFR_Readers_toolFrame::ID_BUTTON18=wxNewId();
constlonguFR_Readers_toolFrame::ID_STATICTEXT22=wxNewId();
constlonguFR_Readers_toolFrame::ID_TEXTCTRL14=wxNewId();
constlonguFR_Readers_toolFrame::ID_STATICTEXT20=wxNewId();
constlonguFR_Readers_toolFrame::ID_TEXTCTRL12=wxNewId();
constlonguFR_Readers_toolFrame::ID_STATICTEXT21=wxNewId();
... ... @@ -211,7 +214,7 @@ uFR_Readers_toolFrame::uFR_Readers_toolFrame(wxWindow* parent,wxWindowID id)
wxMenu*Menu2;
wxStaticBoxSizer*StaticBoxSizer5;
Create(家长,wxID_ANY,wxEmptyString,wxDefaultPosition,wxDefaultSize,wxDEFAULT_FRAME_STYLE,_T(“wxID_ANY"));
Create(家长,wxID_ANY,_("UFR READERS TOOL version 1.1"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_FRAME_STYLE,_T(“wxID_ANY"));
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
BoxSizer1=newwxBoxSizer(wxVERTICAL);
StaticBoxSizer1=newwxStaticBoxSizer(wxVERTICAL,this,_("Reader commands"));
... ... @@ -267,30 +270,30 @@ uFR_Readers_toolFrame::uFR_Readers_toolFrame(wxWindow* parent,wxWindowID id)
StaticText17=newwxStaticText(this,ID_STATICTEXT19,_("New baud rate: "),wxDefaultPosition,wxDefaultSize,0,_T("ID_STATICTEXT19"));
StaticBoxSizer7->Add(StaticText17,0,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,3);
NewBaudCB=newwxComboBox(this,ID_COMBOBOX5,wxEmptyString,wxDefaultPosition,wxDefaultSize,0,0,wxCB_READONLY,wxDefaultValidator,_T("ID_COMBOBOX5"));
NewBaudCB->SetSelection(NewBaudCB->Append(_("2400 bps")));
NewBaudCB->Append(_("4800 bps"));
NewBaudCB->Append(_("9600 bps"));
NewBaudCB->SetSelection(NewBaudCB->Append(_("9600 bps")));
NewBaudCB->Append(_("19200 bps"));
NewBaudCB->Append(_("38400 bps"));
NewBaudCB->Append(_("57600 bps"));
NewBaudCB->Append(_("115200 bps"));
NewBaudCB->Append(_("230400 bps"));
NewBaudCB->Append(_("234000 bps"));
NewBaudCB->Append(_("460800 bps"));
NewBaudCB->Append(_("500000 bps"));
NewBaudCB->Append(_("576000 bps"));
NewBaudCB->Append(_("921600 bps"));
NewBaudCB->Append(_("1000000 bps"));
NewBaudCB->Append(_("1 Mbps"));
StaticBoxSizer7->Add(NewBaudCB,1,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,3);
bEnterNewBaudRate=newwxButton(this,ID_BUTTON18,_("Enter new baud rate"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,_T("ID_BUTTON18"));
StaticBoxSizer7->Add(bEnterNewBaudRate,1,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,3);
BoxSizer16->Add(StaticBoxSizer7,1,wxALL|wxEXPAND,3);
StaticBoxSizer8=newwxStaticBoxSizer(wxHORIZONTAL,this,_("Baud rate reset"));
StaticText20=newwxStaticText(this,ID_STATICTEXT22,_("reader type"),wxDefaultPosition,wxDefaultSize,0,_T("ID_STATICTEXT22"));
StaticBoxSizer8->Add(StaticText20,0,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,5);
ReaderTypeResetBR=newwxTextCtrl(this,ID_TEXTCTRL14,wxEmptyString,wxDefaultPosition,wxSize(37,24),0,wxDefaultValidator,_T("ID_TEXTCTRL14"));
StaticBoxSizer8->Add(ReaderTypeResetBR,1,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,5);
StaticText18=newwxStaticText(this,ID_STATICTEXT20,_("COM:"),wxDefaultPosition,wxDefaultSize,0,_T("ID_STATICTEXT20"));
StaticBoxSizer8->Add(StaticText18,0,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,3);
COMResetBR=newwxTextCtrl(this,ID_TEXTCTRL12,wxEmptyString,wxDefaultPosition,wxDefaultSize,wxTE_CENTRE,wxDefaultValidator,_T("ID_TEXTCTRL12"));
wxFontCOMResetBRFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Courier New"),wxFONTENCODING_DEFAULT);
COMResetBR->SetFont(COMResetBRFont);
StaticBoxSizer8->Add(COMResetBR,1,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,3);
StaticBoxSizer8->Add(COMResetBR,0,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,3);
StaticText19=newwxStaticText(this,ID_STATICTEXT21,_("port interface:"),wxDefaultPosition,wxDefaultSize,0,_T("ID_STATICTEXT21"));
StaticBoxSizer8->Add(StaticText19,0,wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL,3);
PortInterfaceResetBR=newwxTextCtrl(this,ID_TEXTCTRL13,wxEmptyString,wxDefaultPosition,wxSize(37,24),wxTE_CENTRE,wxDefaultValidator,_T("ID_TEXTCTRL13"));
... ... @@ -784,11 +787,13 @@ void uFR_Readers_toolFrame::OnbtnFactoryResetClick(wxCommandEvent& event)
{
InfoTB->Clear();
UFR_STATUSstatus[6];
UFR_STATUSstatus[7];
uint8_tuserData[16];
uint8_tkey[6];
uint8_taes_key[16];
memset(userData,0,16);
memset(key,255,6);
memset(aes_key,0,16);
status[0]=UfrLeaveSleepMode();
InfoTB->AppendText("UfrLeaveSleepMode() -> "+(std::string)UFR_Status2String(status[0])+"\n");
... ... @@ -824,7 +829,22 @@ void uFR_Readers_toolFrame::OnbtnFactoryResetClick(wxCommandEvent& event)
Sleep(200);
}
if(status[0]==UFR_OK&&status[1]==UFR_OK&&status[2]==UFR_OK&&status[3]==UFR_OK&&status[4]==UFR_OK)
for(uint8_ti=0;i<16;i++)
{
status[6]=uFR_int_DesfireWriteAesKey(i,aes_key);
wxStringwxIndex="";
wxIndex<<(int)i;
InfoTB->AppendText("[Aes key index : "+wxIndex+", key : 0x00000000000000000000000000000000] ReaderKeyWrite() -> "+(std::string)UFR_Status2String(status[6])+"\n");
if(status[6])
{
break;
}
Sleep(200);
}
if(status[0]==UFR_OK&&status[1]==UFR_OK&&status[2]==UFR_OK&&status[3]==UFR_OK&&status[4]==UFR_OK&&status[5]==UFR_OK&&status[6]==UFR_OK)
{
setStatusColor(UFR_OK);
StatusLabel->SetLabel("FACTORY RESET -> UFR_OK");
... ... @@ -841,6 +861,8 @@ void uFR_Readers_toolFrame::OnbtnFactoryResetClick(wxCommandEvent& event)
voiduFR_Readers_toolFrame::OnbEnterNewBaudRateClick(wxCommandEvent&event)
{
uint32_tbaud_rate[]={9600,19200,38400,57600,115200,230400,460800,500000,1000000};
uint8_tver_major,ver_minor;
status=GetReaderHardwareVersion(&ver_major,&ver_minor);
... ... @@ -851,6 +873,14 @@ void uFR_Readers_toolFrame::OnbEnterNewBaudRateClick(wxCommandEvent& event)
return;
}
uint32_tbaud=NewBaudCB->GetSelection();
status=SetUartSpeed(baud_rate[baud]);
setStatusColor(status);
StatusLabel->SetLabel("SetUartSpeed() -> "+(std::string)UFR_Status2String(status));
/*
if(ver_minor == 24 || ver_minor == 34)
{
uint32_t baud = NewBaudCB->GetSelection();
... ... @@ -866,17 +896,23 @@ void uFR_Readers_toolFrame::OnbEnterNewBaudRateClick(wxCommandEvent& event)
setStatusColor((UFR_STATUS)1);
StatusLabel -> SetLabel("ReaderChangeBaudrate() -> UNSUPPORTED DEVICE TYPE");
}
*/
}
voiduFR_Readers_toolFrame::OnbResetBaudRateToDefaultClick(wxCommandEvent&event)
{
wxStringwxCOM=COMResetBR->GetValue();
wxCOM=wxCOM.Trim();
c_stringcom_port=wxCOM.c_str();
c_stringcom_port=0;
if(wxCOM.c_str()!="0")
com_port=wxCOM.c_str();
wxStringwxPortInterface=PortInterfaceResetBR->GetValue();
wxPortInterface=wxPortInterface.Trim();
uint32_tport_interface=wxAtoi(wxPortInterface);
wxStringwxReaderType=ReaderTypeResetBR->GetValue();
wxReaderType=wxReaderType.Trim();
uint32_treader_type=wxAtoi(wxReaderType);
if(wxCOM==""||wxPortInterface=="")
{
... ... @@ -884,7 +920,8 @@ void uFR_Readers_toolFrame::OnbResetBaudRateToDefaultClick(wxCommandEvent& event
return;
}
status=uFR_set_default_baudrate(com_port,port_interface);
//status = uFR_set_default_baudrate(com_port, port_interface);
status=SetDefaultUartSpeed(reader_type,port_interface,com_port);
setStatusColor(status);
StatusLabel->SetLabel("uFR_set_default_baudrate() -> "+(std::string)UFR_Status2String(status));
... ...
... ... @@ -6,7 +6,7 @@
* Copyright: Aleksandar Krstic (www.d-logic.net)
* License:
**************************************************************/
#include "ufr-lib/include/uFCoder.h"
#include "lib/include/uFCoder.h"
#ifndef UFR_READERS_TOOLMAIN_H
#define UFR_READERS_TOOLMAIN_H
... ... @@ -76,6 +76,8 @@ class uFR_Readers_toolFrame: public wxFrame
staticconstlongID_STATICTEXT19;
staticconstlongID_COMBOBOX5;
staticconstlongID_BUTTON18;
staticconstlongID_STATICTEXT22;
staticconstlongID_TEXTCTRL14;
staticconstlongID_STATICTEXT20;
staticconstlongID_TEXTCTRL12;
staticconstlongID_STATICTEXT21;
... ... @@ -124,6 +126,7 @@ class uFR_Readers_toolFrame: public wxFrame
//(*Declarations(uFR_Readers_toolFrame)
wxStaticText*StaticText10;
wxStaticText*StaticText9;
wxStaticText*StaticText20;
wxButton*btnCheckConnection;
wxTextCtrl*LockPassTB;
wxButton*btnSetSpeedPermanently;
... ... @@ -171,6 +174,7 @@ class uFR_Readers_toolFrame: public wxFrame
wxStaticText*StaticText12;
wxButton*btnLeaveSleepMode;
wxButton*btnUnlockKeys;
wxTextCtrl*ReaderTypeResetBR;
wxComboBox*RXCB;
wxButton*btnGetSpeed;
wxButton*btnSetAutoSleep;
... ...
ufr-lib@d7da795e
Subproject commit d7da795ed708a51b9d949b2e4905af92ccb3534e
class=“wxFrame"name="uFR_Readers_toolFrame">
</span>UFR READERS TOOL version 1.1<span class="nt">
wxSYS_COLOUR_WINDOW
0
class=“wxBoxSizer"variable="BoxSizer1"member="no">
... ... @@ -210,19 +211,15 @@
class="sizeritem">
class=“wxComboBox"name="ID_COMBOBOX5"variable="NewBaudCB"member="yes">
2400 bps
4800 bps
9600 bps
19200 bps
38400 bps
57600bps
115200 bps
230400 bps
234000 bps
460800 bps
500000 bps
576000 bps
921600 bps
1000000 bps
1 Mbps
0