cnComm 测试 风火轮 NFC板子

cnComm

            DCB* pDcb = m_SerialCnCom.GetState();
            pDcb->BaudRate = 115200 ;
            pDcb->ByteSize  = 8 ;
            pDcb->StopBits = 0;
            pDcb->Parity = 0 ;

唤醒读卡器:
void CNFCReaderDlg::OnBtnWakeReader()
{
// TODO: Add your control notification handler code here
unsigned char WakeCode[]={
0x55,0x55,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0xFF,0x03,0xFD,0xD4,
0x14,0x01,0x17,0
};

if(m_bSerialCnComOpened){

    m_SerialCnCom.WritePort(WakeCode,sizeof(WakeCode));
}

}

返回数据:

00 00 FF 00 FF 00 00 00 FF 02 FE D5 15 16 00

00 00 ff 00 ff 00 00 00 ff 02 fe d5 15 16 00

Wait
len =15
00 00 FF 00 FF 00 00 00 FF 02 FE D5 15 16 00

代码: VC 控制台程序

// TestCnmmSerial.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include "CnComm.h"


class HelloComm : public CnComm
{   //! \sa CnComm::OnReceive()
    void OnReceive()
    {
        char buffer[1024];

       int len = Read(buffer,1023);

       printf("len =%d\r\n",len);

       for(int i=0;i <len;i++){

            printf("%.2X ",(unsigned char)buffer[i]);
       }

    }
};



int _tmain(int argc, _TCHAR* argv[])
{
    unsigned char  WakeCode[]={
        0x55,0x55,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0xFF,0x03,0xFD,0xD4,
            0x14,0x01,0x17,0
    };  


    HelloComm Com;//! 默认模式 重叠IO 监视线程
    Com.Open(12, 115200);


    Com.WritePort(WakeCode,sizeof(WakeCode));

    printf("Wait\r\n");
    getchar();
    printf("Exit\r\n");
    return 0;
}

备忘 ,有空完善一下

ETC卡读写指令:

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wowocpp/article/details/80352606
个人分类: win32-api
想对作者说点什么? 我来说一句

风火轮NFC2COM NFC模块

2018年01月22日 15.82MB 下载

没有更多推荐了,返回首页

不良信息举报

cnComm 测试 风火轮 NFC板子

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭