霍尼韦尔N3680未触发DataReceived事件

时间:2018-01-24 11:38:38

标签: uwp barcode-scanner honeywell

我的设备配有扫描引擎霍尼韦尔N3680。根据文档https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/pos-device-support,该引擎应该是支持。

当我使用此代码编写示例UWP应用程序时。 OnDataReceived 方法永远不会被调用。

async void InitScanner()
{
    BarcodeScanner scanner = null;
    var scannerDevices = await DeviceInformation.FindAllAsync(BarcodeScanner.GetDeviceSelector());
    if (scannerDevices != null && scannerDevices.Count > 0)
    {
        foreach (var scannerDevice in scannerDevices)
        {
            scanner = await BarcodeScanner.FromIdAsync(scannerDevice.Id);
            claimedScanner = await scanner.ClaimScannerAsync();
            claimedScanner.RetainDevice();
            await claimedScanner.EnableAsync();
            claimedScanner.IsDecodeDataEnabled = true;

            claimedScanner.DataReceived += OnDataReceived;
        }
    }
}

POS模式已激活,设备管理器中的设备表示如下:

enter image description here

如果我使用霍尼韦尔UWP应用程序“BarcodeScanningApp”,也不会触发DataReceived事件。

如果是霍尼韦尔Windows桌面应用程序“POS4NET验证实用程序”扫描程序正确扫描。

有没有选择如何在UWP应用程序中设置此扫描引擎?

1 个答案:

答案 0 :(得分:1)

@ User1629894,

您在设备管理器中看到的设备不是您期望的霍尼韦尔N3680扫描引擎。当霍尼韦尔N3680配置为HID POS扫描仪模式时,您将在设备管理器中看到HID POS扫描仪条目。只有这样,此扫描仪才能与您的UWP应用程序配合使用。

请参阅HID POS扫描仪模式下的Honeywell N3680文档。

特里沃里克 微软