棘手的 POS 打印机设计问题

发布于 2024-08-03 21:09:54 字数 1431 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在梵高的星空下 2024-08-10 21:09:54

我认为解决方案是在 POS 应用程序之外执行此操作,但要在其理解的水平上进行通信(打印)。一个看起来像打印机的解决方案可以捕获数据,重新格式化,然后发送,或者在打印机端口级别与操作系统(假设是Windows)进行交互。

在 Windows 中,我们使用我们创建的自定义端口监视器来捕获和路由这些数据,这是我们内部使用的东西,所以我不会建议您使用它,因为它有一些错误。类似的解决方案是 RedMon。这可以提供解决方案或为您提供如何实现它的想法。捕获数据后,您可以针对它启动一个流程。

另一种方法是通过网络,您可以随时设置监视 9100 (RAW) 或 515 (LPR) 的东西来拦截数据。

最后,如果它是 Windows 并且您不想创建像 RedMon 这样低级的东西,您始终可以使用命名管道。您将运行一个监视命名管道的服务应用程序。 POS 打印机的端口将设置为“本地”,端口将为 \.\pipe\。这将允许应用程序直接与您的服务通信,从而启动一个进程。

您可以设置多个命名管道/Redmon/网络端口,每个端口都有一个唯一的关联输出,以定向到另一侧的正确设备。

I think the solution will be to do this outside of the POS app, but communicate on a level that it understands, print. A solution that looks like a printer to capture the data, reformat, and then send on would do the trick or something that interfaces with the OS (let's say Windows) at a printer port level.

In Windows we use a custom port monitor we created to caputre and route this data, it's something we use internally so I wouldn't suggest it for you as it has some bugs. A similar solution is RedMon. This could provide the solution or provide you ideas on how to accomplish it. Once the data is captured you launch a process against it.

An alternative is to it's over the network you can always setup something that montiors 9100 (RAW) or 515 (LPR) to intercept the data.

Lastly, if it's Windows and you don't want to create something as low-level as RedMon you can always use named pipes. You'd run a service application that would be montioring a named pipe. Your printer from the POS would have it's port set to 'local' and the port would be \.\pipe\. The would allow the application to driectly communicate with your service and thus launch a process.

You could have multiple named pipe/Redmon/network ports setup each with a unique assocated output to direct to the correct device on the other side.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文