与串行端口"Verifone VX520"进行通信 [英] Communicating with Serial Port “Verifone VX520”

查看:512
本文介绍了与串行端口"Verifone VX520"进行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过串行端口将数据发送到"Verifone VX520"支付设备. 与此类设备进行通讯是我的第一次尝试

I’m sending data through serial port to "Verifone VX520" payment device. It is my first trial to communicate with such devices

SerialObj.Open();字符串输入= "02hPUR.10.99._000000000004.634._4761739001010010FFFFF.0808.123456.
.03h; byte [] asciiBytes = Encoding.ASCII.GetBytes(input); SerialObj.Write(asciiBytes,0,asciiBytes.Length);

SerialObj.Open(); string input = "02hPUR.10.99._000000000004.634._4761739001010010FFFFF.0808.123456.
.03h"; byte[] asciiBytes = Encoding.ASCII.GetBytes(input); SerialObj.Write(asciiBytes, 0, asciiBytes.Length);

根据结构,此消息应发送一定数量并显示在机器上,但我得到的只是此消息"Send Ack" 当我尝试阅读确认书时,我只有这个字符

As per the structure this message should send some amount and appear it on the machine but what I got is only this message "Sending Ack" And when I tried to read acknowledgment I got only this character

就像颠倒的"T"

所以,有什么方法可以知道这里出了什么问题.

So, is there any way to know what’s going wrong here.

推荐答案

大多数Verifone终端使用特殊的消息格式在PC和内部软件之间传输信息.您的付款字符串有误.来自终端的答复是正确的. 21十进制是15h NAK,表示消息错误或crc错误. 您的字符串必须看起来像这样"\ 02PUR.10.99._000000000004.634._4761739001010010FFFFF.0808.123456. .\ 03,但我真的怀疑这些点是真正的点,而不是用不同字符(1Ch)编码的场分隔符.该消息还会丢失ETX之后的CRC字符. 首先与终端进行通信的最佳方法是从设备制造商或供应商那里获取要使用的POS通信协议的手册.如果您详细说明要使用POS设备实现的目标,那么它也有帮助...下载软件,使用ECR功能等.

Most Verifone terminals use a special message formatting to transfer information between a PC and the software inside. Your payment string is wrong. The reply from the terminal is correct. 21 decimal is 15h NAK meaning message is wrong or crc wrong. Your string has to look like this "\02PUR.10.99._000000000004.634._4761739001010010FFFFF.0808.123456. .\03" but i really doubt that the dots are really dots and not Field Separators that code with a different character (1Ch). the message also misses the CRC character after ETX. The best way of communicating with the terminal first is obtaining the manual for the POS communication protocol you are trying to use from the device manufacturer or from the vendor. It also helps if you detail what you are trying to achieve with the POS device...Download software, use the ECR functionality,etc.

这篇关于与串行端口"Verifone VX520"进行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆