简体   繁体   English

与串行端口“Verifone VX520”通信

[英]Communicating with Serial Port “Verifone VX520”

I'm sending data through serial port to “Verifone VX520” payment device. 我通过串口将数据发送到“Verifone VX520”支付设备。 It is my first trial to communicate with such devices 这是我与这些设备进行通信的第一次试验

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

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 根据结构,这个消息应该发送一些数量并显示在机器上,但我得到的只是这个消息“发送确认”当我试图读取确认时我只得到这个字符

在此输入图像描述

it is like upside down "T" 它就像颠倒的“T”

So, is there any way to know what's going wrong here. 那么,有没有办法知道这里出了什么问题。

Most Verifone terminals use a special message formatting to transfer information between a PC and the software inside. 大多数Verifone终端使用特殊的消息格式在PC和内部软件之间传输信息。 Your payment string is wrong. 您的付款字符串错误。 The reply from the terminal is correct. 终端的回复是正确的。 21 decimal is 15h NAK meaning message is wrong or crc wrong. 21十进制是15h NAK意味着消息错误或crc错误。 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). 你的字符串必须看起来像这样“\\ 02PUR.10.99._000000000004.634._4761739001010010FFFFF.0808.123456。\\ 03”,但我真的怀疑这些点是真正的点而不是字段分隔符,它们用不同的字符(1Ch)编码。 the message also misses the CRC character after ETX. 该消息也会在ETX之后错过CRC字符。 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. 与终端通信的最佳方式是获取您尝试从设备制造商或供应商处使用的POS通信协议的手册。 It also helps if you detail what you are trying to achieve with the POS device...Download software, use the ECR functionality,etc. 如果您详细说明要使用POS设备实现的功能,它也会有所帮助...下载软件,使用ECR功能等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM