首页 > 代码库 > win10 IoT开发 Serial?Device 返回 null
win10 IoT开发 Serial?Device 返回 null
树莓派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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。