简体   繁体   English

Symbol MC30xx条码读取器设备-如何将数据传输到PC

[英]Symbol MC30xx Barcode reader device - How to transfer data to PC

I'm developing application for Symbol MC3000 device. 我正在开发Symbol MC3000设备的应用程序。 It's running Windows CE 4.2 Professional. 它正在运行Windows CE 4.2专业版。 Application is simple data driven app, which stores information about products in store. 应用程序是简单的数据驱动的应用程序,它在商店中存储有关产品的信息。

My client wants to communicate with the device through serial and USB interface and read data stored in application. 我的客户希望通过串行和USB接口与设备通信,并读取存储在应用程序中的数据。 And here is where i'm stucked. 这就是我卡住的地方。

He wan't to send commands to device like over console: 他不会像通过控制台那样向设备发送命令:

RES:GET:DATA? RES:获取:数据? - to receive all data from device in spec.format -从设备接收规范格式的所有数据

RES:GET:VN? RES:GET:VN? - to get version of software. -获取软件版本。

and so on. 等等。

Serial line is not a big deal. 串行线没什么大不了的。 But how would you implement this via the USB port. 但是您将如何通过USB端口实现这一点。 (with no active sync, or network sockets) (无活动同步或网络套接字)

(the device might be connected to USB on linux or windows machine, and those terminal commands should work) (该设备可能已连接到Linux或Windows计算机上的USB,并且这些终端命令应该起作用)

Od do you have any ideas how to design this problem? 您是否对如何设计此问题有任何想法?

can you please guys recommend me some literature, or materials to read? 能否请大家推荐我一些文学或材料阅读?

Thank you very much. 非常感谢你。

Alef 阿列夫

The simple and short answer is "you don't." 简单而简短的答案是“您不这样做”。

The more complex, long answer is that it can be done, but the amount of work required is likely to be way more expensive than the value and an alternate should be looked at (eg if you have any mechanism for a network interface, use a socket). 更长的答案是可以完成的,但比较复杂,但所需的工作量可能会比值贵得多,因此应考虑替代方法(例如,如果您有网络接口的任何机制,请使用插座)。

For the USB side you have to understand how USB works, at least in general terms. 对于USB端,您必须至少从一般意义上理解USB的工作原理。 When you plug that device into the PC, the PC needs to have a driver that understands how to communicate with the device. 当您将该设备插入PC时,PC需要具有一个驱动程序,该驱动程序了解如何与该设备通信。 The device, at the same time, needs to have a driver that understands how to talk to the PC. 同时,该设备需要具有一个驱动程序,该驱动程序应了解如何与PC通话。 These drivers need to understand how each other work so they can effectively communicate. 这些驱动程序需要了解彼此的工作方式,才能有效地进行沟通。

When you use ActiveSync, what happens (with the older 4.2 stuff) is that ActiveSync on the PC has a serial over USB driver, so when you plug in your device, the PC says "hey, this looks like a serial device" and the ActiveSync itself does a PPP over serial connection using that serial layer. 当您使用ActiveSync时,发生的情况(使用旧版4.2的东西)是PC上的ActiveSync具有USB串行驱动程序,因此,当您插入设备时,PC会说“嘿,这看起来像是串行设备”,并且ActiveSync本身使用该串行层在串行连接上执行PPP。 Down on the device, when the connection is made, a driver that the OEM put in (usbser.dll to be specific) fires up and negotiates with the PC then fires up ActiveSync's device client with finishes creating that network. 在设备上,当建立连接时,OEM放入的驱动程序(具体来说是usbser.dll)启动并与PC协商,然后启动ActiveSync的设备客户端,并完成了该网络的创建。 Done and done. 做完了。 Newer devices use a similar mechanism but typically use RNDIS instead of serial over USB becasue PCs ship with ENDIS upport and it's more robust and faster. 较新的设备使用类似的机制,但是通常使用RNDIS而不是USB串行,因为PC附带ENDIS支持,并且功能更强大,更快速。

Now that you want to remove ActiveSync, you have to provide those drivers - for both ends. 现在您要删除ActiveSync,您必须为两端提供这些驱动程序。 The path of least resistance is probably to use HID . 阻力最小的路径可能是使用HID At least this way the PC-side is done (it's the same protocol a mouse uses, so any PC, be it Windows or Linux, that understands a USB mouse will have the driver for this). 至少以这种方式在PC端完成了(这与鼠标使用的协议相同,因此,任何理解USB鼠标的PC(无论是Windows还是Linux)都将具有驱动程序)。 You still would have to write the HID driver for the device. 您仍然必须为设备编写HID驱动程序。 Once you have that, you can then write an app for each end to use that USB pipe to communicate. 一旦有了,就可以为每个端编写一个应用程序,以使用该USB管道进行通信。

Of course all of this is going to also require that you deploy your driver(s) to the device and possibly PCs. 当然,所有这些还需要您将驱动程序部署到设备以及可能的PC上。

It would be difficult to build a USB serial link between the device and a PC. 在设备和PC之间建立USB串行链接将很困难。 For a Windows Platform you could use RAPI as a work around. 对于Windows平台,您可以使用RAPI来解决。 The device would connect to a PC through ActiveSync. 该设备将通过ActiveSync连接到PC。 Then using RAPI you can (among others), read the registry of the remote device, start the execution of an application in the device, transfer files between the two. 然后,您可以使用RAPI(除其他外),读取远程设备的注册表,开始在设备中执行应用程序,并在两者之间传输文件。

I suppose that if you don't want real-time transfer of data this will work. 我想,如果您不希望实时传输数据,那么它将起作用。 For Linux, I don't know if there is a RAPI SDK available. 对于Linux,我不知道是否有可用的RAPI SDK。 In Windows you could use OpenNetCF's RAPI SDK, which will make your life a lot easier. 在Windows中,您可以使用OpenNetCF的RAPI SDK,这将使您的生活更加轻松。

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

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