简体   繁体   English

相当于CCtalk协议的C#函数

[英]C# function equivalent to CCtalk protocol

Im looking fordward to integrate a coin acceptor into one of our divices. 我希望将硬币接收器集成到我们的设备中。 This specific coin acceptor CF7000 uses the ccTalk protocol 该特定的硬币接收器CF7000使用ccTalk协议

I've been working with the default libraries provided from the supplier which I can use in C#, however i want to see if its possible Find and USE a C# Function equivalent to the cctalk protocol and if possible use it directly into my C# code 我一直在使用供应商提供的默认库,可以在C#中使用它,但是我想查看它是否可以查找和使用与cctalk协议等效C#函数,并在可能的情况下直接将其用于我的C#代码中

i have been using ILSpy to open and explore the libraries provided and found this function that opens the device so it can recieve coins and store them 我一直在使用ILSpy打开和浏览提供的库,发现此功能可以打开设备,以便它可以接收硬币并将其存储

in my code all i have to type is: 在我的代码中,我必须输入的是:

DispositivoCF7000.BeginTransaction();

in order for the device to call the following function inside the library 为了使设备在库中调用以下函数

public override void BeginTransaction()
{
    if (this.changerState == ChangerStatus.Opened)
    {
        this.UpdateAPILogger();
        string logFileLine = CF7XXX.GetCurrentDate() + "|" + CF7XXX.GetCurrentTime() + "|C|BeginTransaction()";
        this.m_Logger.Write(logFileLine);
        this.Enable(this.creditLimit);
        this.EnableFreeVend();
        this.ClearCredit();
    }
}

Now what i want to do is Find the CCTalk Protocol equivalent to this library function, in order for me to interact with the device, without the need to call the function from the library, however im not so sure this is easy or possible hopefully someone here might have a little bit more experience with this 现在我要做的是找到与此库函数等效的CCTalk协议,以便我与设备进行交互,而无需从库中调用该函数,但是我不太确定这是否简单或希望有人这里可能对此有更多的经验

In order to do what you want you have to communicate directly to the USB/Serial port and send directly the commands you want, and then build your own library or helper functions. 为了执行您想要的操作,您必须直接与USB / Serial端口进行通信并直接发送所需的命令,然后构建自己的库或辅助函数。

  1. Open serial port 打开串口
  2. Generate the message to be sent, calculate checksum 生成要发送的消息,计算校验和
  3. Write the message on the serial interface 在串行接口上​​写消息
  4. Listen for the answer if any. 聆听答案(如果有)。

Hope I've helped. 希望我有所帮助。

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

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