Raspberry pi3 IAsyncOperation<;串行设备>;FromIdAsync(字符串deviceId)返回null
我的Windows IoT Core 10 17744运行在Raspberry Pi 3上。Raspberry pi3 IAsyncOperation<;串行设备>;FromIdAsync(字符串deviceId)返回null,raspberry-pi3,uart,windows-iot-core-10,Raspberry Pi3,Uart,Windows Iot Core 10,我的Windows IoT Core 10 17744运行在Raspberry Pi 3上。 我尝试使用以下代码从UWP应用程序初始化COM端口: string aqs = SerialDevice.GetDeviceSelector(); DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(aqs); List<DeviceInformation> list = devices.ToL
我尝试使用以下代码从UWP应用程序初始化COM端口:
string aqs = SerialDevice.GetDeviceSelector();
DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(aqs);
List<DeviceInformation> list = devices.ToList();
DeviceInformation di = list.First();
_serial_port = await SerialDevice.FromIdAsync(di.Id);
但是在等待
操作之后,\u串行\u端口
中有空值
更新
即使我将Raspberry UART接口连接到工作节点,它也是空的:第8个引脚作为TX到成对RX线路。
第10个引脚作为RX至成对TX线路 更新 我在清单中有
DeviceCapability
:
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
</Device>
</DeviceCapability>
您需要在以下位置添加串行设备功能:
即使我将Raspberry UART接口连接到工作节点,它也是空的:
第8个引脚作为TX至成对RX线路。第10个引脚作为RX至成对TX线路
这不是SerialDevice.FromIdAsync()成功所必需的。即使未连接这些管脚,如果代码和设置正确,SerialDevice.FromIdAsync()也可以获取有效的设备。您可以参考。您需要在中添加串行设备功能:
即使我将Raspberry UART接口连接到工作节点,它也是空的:
第8个引脚作为TX至成对RX线路。第10个引脚作为RX至成对TX线路
这不是SerialDevice.FromIdAsync()成功所必需的。即使未连接这些管脚,如果代码和设置正确,SerialDevice.FromIdAsync()也可以获取有效的设备。你可以参考。我有。@OlgaPshenichnikova你有没有试过我回答中提到的官方样本?我有。@OlgaPshenichnikova你有没有试过我回答中提到的官方样本?问题解决了吗?没有。。。我们决定迁移到Raspbean/C++问题解决了吗?没有。。。我们决定迁移到Raspbean/C++
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
</Device>
</DeviceCapability>
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
</Device>
</DeviceCapability>