![](/img/trans.png)
[英]Windows Phone 8, 8.1 and 10 Store support with one app with barcode scanner
[英]Detect barcode scanner with PointOfService on Windows 10
我想通过Windows.Devices.PointOfService命名空间在Windows 10(内部版本15063)中使用条形码扫描仪。 扫描仪是Datalogic Quickscan QD2430,我尝试了所有RS-232和键盘模式。
我没有运气就使用了官方示例应用程序https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BarcodeScanner 。 它可以检测设备,但绝对是内置的网络摄像头(HP笔记本电脑)。
我试图修改源代码,即DeviceHelpers的GetFirstDeviceAsync函数https://github.com/Microsoft/Windows-universal-samples/blob/master/SharedContent/cs/DeviceHelpers.cs 。
DeviceInformation.FindAllAsync也仅返回相机的信息作为结果。
string selector = BarcodeScanner.GetDeviceSelector(PosConnectionTypes.All);
DeviceInformation.FindAllAsync(selector);
它什么也不返回。
DeviceInformation.FindAllAsync(DeviceClass.ImageScanner);
它返回所有已连接的设备,我认为以前已连接但当前处于脱机状态的设备也是如此。 我试图按名称过滤扫描仪。 过滤结果也很多,但是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不在Windows.Devices.PointOfService支持的设备列表中 。
要求Datalogic提供支持Windows.Devices.PointOfService的设备驱动程序,或将扫描仪更改为支持的列表中描述的扫描仪。
或者,根据Windows Driver Kit的服务点(POS)创建自己的设备驱动程序 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.