简体   繁体   English

在Windows 10上使用PointOfService检测条形码扫描仪

[英]Detect barcode scanner with PointOfService on Windows 10

I would like to use a barcode scanner with Windows 10 (Build 15063) via the Windows.Devices.PointOfService namespace. 我想通过Windows.Devices.PointOfService命名空间在Windows 10(内部版本15063)中使用条形码扫描仪。 The scanner is a Datalogic Quickscan QD2430 and I tried with all RS-232 and Keyboard mode. 扫描仪是Datalogic Quickscan QD2430,我尝试了所有RS-232和键盘模式。

I used the official sample application https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BarcodeScanner with no luck. 我没有运气就使用了官方示例应用程序https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BarcodeScanner It can detect a device but it's definitely the in-built webcam (HP laptop). 它可以检测设备,但绝对是内置的网络摄像头(HP笔记本电脑)。

I tried to modify the source, the DeviceHelpers's GetFirstDeviceAsync function https://github.com/Microsoft/Windows-universal-samples/blob/master/SharedContent/cs/DeviceHelpers.cs . 我试图修改源代码,即DeviceHelpers的GetFirstDeviceAsync函数https://github.com/Microsoft/Windows-universal-samples/blob/master/SharedContent/cs/DeviceHelpers.cs

The DeviceInformation.FindAllAsync also returns only the camera's info as result. DeviceInformation.FindAllAsync也仅返回相机的信息作为结果。

string selector = BarcodeScanner.GetDeviceSelector(PosConnectionTypes.All);
DeviceInformation.FindAllAsync(selector);

It returns nothing. 它什么也不返回。

DeviceInformation.FindAllAsync(DeviceClass.ImageScanner);

It returns every connected and I think the previously connected but currently offline devices too. 它返回所有已连接的设备,我认为以前已连接但当前处于脱机状态的设备也是如此。 I tried to filter the scanner by name. 我试图按名称过滤扫描仪。 There was a lot filterd result too, but the convertAsync function returned null for all excepts one, it thrown an Exception "A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)". 过滤结果也很多,但是convertAsync函数对除一个以外的所有函数都返回null,它引发了异常“连接到系统的设备不起作用。(来自HRESULT的异常:0x8007001F)”。

DeviceInformationCollection infos = await DeviceInformation.FindAllAsync(DeviceClass.All);
foreach(DeviceInformation info in infos)
{
    if (info.Name.ToUpper().Contains("BARCODE"))
    {
        T scanner = await convertAsync(info.Id);
        if (scanner != null)
        {
            return scanner;
        }
    }
}

Datalogic Quickscan QD2430 is not in the list of devices supported by Windows.Devices.PointOfService . Datalogic Quickscan QD2430不在Windows.Devices.PointOfService支持的设备列表中

Ask Datalogic to provide a device driver that supports Windows.Devices.PointOfService, or change the scanner to the one described in the supported list. 要求Datalogic提供支持Windows.Devices.PointOfService的设备驱动程序,或将扫描仪更改为支持的列表中描述的扫描仪。

Alternatively, create your own device driver according to the Point of Service (POS) of Windows Driver Kit . 或者,根据Windows Driver Kit的服务点(POS)创建自己的设备驱动程序

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

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