RFID技术 M1卡数据和钱包操作上机报告
更新时间:2023-10-28 09:06:01 阅读量: 综合文库 文档下载
- rfid技术应用领域推荐度:
- 相关推荐
M1卡数据和钱包操作上机报告
一、实验目标
通过对较常见RFID技术标准(ISO/IEC14443RFID)标准的PICC和PCD 的操作实验,写出M1卡数据读写函数,M1卡钱包读写函数和M1卡钱包加减函数,理解M1卡的数据存取机制、钱包存储结构、钱包工作原理。
二、实验内容
1)(写程序)实践阅读器对M1卡数据读写,理解M1卡的数据存取机制 2)(写程序)实践阅读器对M1卡钱包读写,理解M1卡的钱包存储结构 3)(写程序)实践阅读器对M1卡钱包加减,理解M1卡的钱包工作原理
三、实验分工:
函数的理解和代码实现:XX 实验报告书写:XX
四、分析、步骤、设计和布局
1.分析:通过添加数据读写按钮,块的初始化,快增值,块减值和读块值按钮来实现数据读写,钱包读写和钱包加减。
2.在下载密码,初始化块值,快增值,块减值和读块值的函数里要注意扇区和块地址,是我们事先定好的地址。
3.这是我们的设计和布局:
五、具体代码:
// text2Dlg.cpp : implementation file //
#include \#include \#include \#include \
#ifdef _DEBUG
#define new DEBUG_NEW #undef THIS_FILE
static char THIS_FILE[] = __FILE__; #endif
///////////////////////////////////////////////////////////////////////////// // CText2Dlg dialog
CText2Dlg::CText2Dlg(CWnd* pParent /*=NULL*/) : CDialog(CText2Dlg::IDD, pParent) { //{{AFX_DATA_INIT(CText2Dlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); }
void CText2Dlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CText2Dlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP }
BEGIN_MESSAGE_MAP(CText2Dlg, CDialog) //{{AFX_MSG_MAP(CText2Dlg) ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_BN_CLICKED(IDC_BUTTON1, OnButton1) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON5, OnButton5) ON_BN_CLICKED(IDC_BUTTON6, OnButton6) ON_BN_CLICKED(IDC_BUTTON7, OnButton7) ON_BN_CLICKED(IDC_BUTTON8, OnButton8) ON_BN_CLICKED(IDC_BUTTON9, OnButton9) ON_BN_CLICKED(IDC_BUTTON10, OnButton10) ON_BN_CLICKED(IDC_BUTTON11, OnButton11) //}}AFX_MSG_MAP END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////// // CText2Dlg message handlers
BOOL CText2Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control }
// If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework.
void CText2Dlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle 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; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } }
// The system calls this to obtain the cursor to display while the user drags // the minimized window.
HCURSOR CText2Dlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; }
HANDLE icdev;
unsigned long cardsnr;
void CText2Dlg::OnButton1() { // TODO: Add your control notification handler code here //初始化串口1, icdev=dc_init(100,9600); if((int)icdev<=0) { MessageBox(\ } else {
MessageBox(\ } dc_beep(icdev,10); return; }
void CText2Dlg::OnButton2() { // TODO: Add your control notification handler code here int st; CString linstr;
st=dc_card(icdev,0,&cardsnr); if(st!=0) {
MessageBox(\ return; } else { MessageBox(\ linstr.Format(\ MessageBox(linstr); } }
void CText2Dlg::OnButton3() { // TODO: Add your control notification handler code here int st; unsigned char
databuff[]={0x44,0x33,0x33,0x66,0x33,0x44,0x33,0x66,0x36,0x34,0x33,0x44,0x33,0x66,0x36,0x34,0x00};//
char databuff2[33]; char str[33]; st=dc_write(icdev,1,databuff); if(st!=0) {
MessageBox(\ return; } else { MessageBox(\ sprintf(str,\ MessageBox(str); } }
正在阅读:
网络子网划分练习题2(有答案)12-25
内浇外挂式外墙PC板施工工法 - 图文02-27
F1宣传册策划文案08-05
招标文件(范本) - 图文05-07
难忘那一巴掌作文500字06-21
描写树的词语和句08-27
英文版面试自我介绍演讲稿怎么写11-21
我的中国梦征文800字02-08
2013高考作文临考应急措施11-04
- 计算机试题
- 【2012天津卷高考满分作文】鱼心人不知
- 教育心理学历年真题及答案--浙江教师资格考试
- 20180327-第六届“中金所杯”全国大学生金融知识大赛参考题库
- 洪林兴达煤矿2018年度水情水害预测预报
- 基本要道讲义
- 机电设备安装试运行异常现象分析与对策
- 《有机化学》复习资料-李月明
- 非常可乐非常MC2--非常可乐广告策划提案 - 图文
- 2011中考数学真题解析4 - 科学记数法(含答案)
- 企业人力资源管理师三级07- 09年真题及答案
- 基于单片机的光控自动窗帘控制系统设计说明书1 - 图文
- 20160802神华九江输煤皮带机安装方案001
- (共53套)新人教版一生物必修2(全册)教案汇总 word打印版
- 2014行政管理学总复习
- 中国银监会关于加强地方政府融资平台贷款风险监管的指导意见
- 民宿酒店核心竞争与研究
- 游园活动谜语大全2012
- 河南省天一大联考2016届高三英语5月阶段性测试试题(六)(A卷)
- 小型超市管理系统毕业论文详细设计4
- 上机
- 钱包
- 操作
- 报告
- 数据
- 技术
- RFID