![](/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.