首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UWP PointOfService API -无法使用GetSupportSymbologiesAsync或GetSymbologyAttributesAsync

UWP PointOfService API -无法使用GetSupportSymbologiesAsync或GetSymbologyAttributesAsync
EN

Stack Overflow用户
提问于 2018-01-29 12:59:49
回答 1查看 253关注 0票数 1

我正在使用UWP Barcode Sample.

我正在尝试通过运行Windows10移动企业版的松下FZ-F1来使用UWP。我无法获得支持的符号系统,因为scanner.GetSupportedSymbologiesAsync()总是返回一个空的System.__ComObject。具有本机视图,在调试到设备时为IUnknown类型。

代码语言:javascript
复制
0x00007ff8ca8ba278 {Windows.Devices.PointOfService.dll!const Windows::Internal::AsyncOperation<struct Windows::Foundation::IAsyncOperation<struct Windows::Foundation::Collections::IVectorView<unsigned int> *>, struct Windows::Foundation::IAsyncOperationCompletedHandler<struct Windows::Foundation::Collections::IVectorView<unsigned int> *>, class Windows::Internal::CMarshaledInterfaceResult<struct Windows::Foundation::Collections::IVectorView<unsigned int> >, class Windows::Internal::ComTaskPoolHandler,struct Windows::Internal::INilDelegate,struct Microsoft::WRL::AsyncOptions<-1,0,&struct _GUID const GUID_CAUSALITY_WINDOWS_PLATFORM_ID,2> >::`vftable'{for `Microsoft::WRL::Details::ImplementsHelper<struct Microsoft::WRL::RuntimeClassFlags<3>,1,struct Windows::Foundation::IAsyncOperation<struct Windows::Foundation::Collections::IVectorView<unsigned int> *>, struct Windows::Internal::IAsyncOperationLocal,struct Microsoft::WRL::CloakedIid<struct Windows::Internal::IAsyncDeferral>,struct Microsoft::WRL::CloakedIid<struct Windows::Internal::IComPoolTask>,struct Microsoft::WRL::CloakedIid<struct Windows::Internal::IAsyncFireCompletion> >'}} {...}

我也在Windows10 16299上用霍尼韦尔Xenon 1900g进行了测试,它在那里也不能工作。这是错误所在。

代码语言:javascript
复制
$exception  {System.NullReferenceException: Object reference not set to an instance of an object.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at SDKTemplate.Scenario3_ActiveSymbologies.<ScenarioStartScanButton_Click>d__8.MoveNext()} System.NullReferenceException

StackTrace  "   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at SDKTemplate.Scenario3_ActiveSymbologies.<ScenarioStartScanButton_Click>d__8.MoveNext()"  string

我需要能够支持长度为10的TfInt (I2of5),因为无法设置长度属性,所以无法扫描。我尝试过用claimedScanner.GetSymbologyAttributesAsync(BarcodeSymbologies.TfInt)定义条形码,但失败了,出现以下异常。

代码语言:javascript
复制
{System.Exception: The request is not supported. (Exception from HRESULT: 0x80070032)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at SDKTemplate.Scenario4_SymbologyAttributes.<SymbologySelection_Changed>d__13.MoveNext()}  System.Exception

FZ-F1支持TfInt (I2of5)。使用其预装的条形码阅读器演示应用程序(我假设它是使用Windows8.1手持API创建的),我可以在那里分配长度,它就可以像预期的那样工作。

目前,经过一些测试,我发现API默认为TfInt (I2of5) Length1、Length2或AnyLength (我不确定当前设置的值)使用的长度为14,因此有一个可能的变通方法,即我们可以将所有条形码更改为使用长度为14的条形码。如果长度小于14,则无法扫描。

任何人都能洞察这个API是否真的能做我尝试过的事情。他们创建了样例,就像它工作一样,但根据我的经验,它不是这样的。(将此添加到文档中将非常有帮助)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-02-07 11:50:18

在与微软和松下开了一张罚单后,结果如下。

来自Panasonic:

GetSupportedSymbologiesAsync:目前,此接口无法正确返回支持的符号系统。此问题将在RS3上修复。然而,我认为这个问题对UWP用户应用程序的影响不是很大,因为FZ-F1支持的符号系统没有变化。

GetSymbologyAttributesAsync:不支持此接口。

我遇到的问题与无法使用设备上的Panasonic条形码阅读器应用程序配置交错的2/5符号有关。我错误地认为,由于我不能使用这个应用程序,所以我必须用代码来做这件事。事实证明,条形码阅读器中应用的设置不起作用的原因是,设备需要运行以下命令才能应用条形码阅读器中的设置-否则将应用默认的符号系统。

在认领扫描仪之后。

代码语言:javascript
复制
await claimedScanner.SetActiveProfileAsync("OEMProfile");

这是松下的支持文档,他们发布了这一要求,因为这是一个持续的支持问题,我第一次联系他们是在2017年10月。

http://pc-dl.panasonic.co.jp/dl/docs/076321?dc[]=002012&no=3&p1=221&q=FZ-F1&score=1.43731880187988&sri=12077714&trn_org=2

以下是一个工作样例项目。如果您正在使用需要设置长度的符号系统,并且您没有使用默认长度,这可能会对您有所帮助。

https://1drv.ms/u/s!Am4H1xOfJ2mxgQ_pqOia9wj46oKq

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48494632

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档