码迷,mamicode.com
首页 > Windows程序 > 详细

win10 IoT开发 Serial?Device 返回 null

时间:2017-05-26 11:57:30      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:over   devices   dev   for   nbsp   mmu   library   com   creat   

树莓派3,win10 Iot,串口开发,抄例子,串口获取返回老是null,例子却可以,代码一样,上网查询结果如下:

https://stackoverflow.com/questions/34160376/windows-universal-app-serial-ports-wont-open-serialdevice-fromidasync-always-n

 

So Microsoft do not mention that you need to add something to the app manifest for serial communication nor is there a tick box in the app manifest GUI for serial communication.

The following needs to be added to your app manifest (create the <Capabilities> section if it doesn‘t exist):

<Capabilities>
  <DeviceCapability Name="serialcommunication">
    <Device Id="any">
      <Function Type="name:serialPort" />
    </Device>
  </DeviceCapability>
</Capabilities>

UPDATE 10/2016

Microsoft have updated their documentation to reflect this requirement.

https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.serialcommunication.aspx

 

记录并转载

win10 IoT开发 Serial?Device 返回 null

标签:over   devices   dev   for   nbsp   mmu   library   com   creat   

原文地址:http://www.cnblogs.com/ylgqq/p/6907641.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!