I want to create an UWP application to receive information sent by Waspmote board.
in WindowsForms, it\'s using System.IO.Ports;
it can work
bu
You're trying to use an old API which is not accessible to UWP apps.
Serial communication can be achieved by using the classes from Windows.Devices.SerialCommunication.
The class you'll use is SerialDevice which will allow you to enumerate, open the device and perform I/O operations.
In order to use the API, you will need to add the serial port capability in your application manifest. UWP applications can only access to declared hardware resources.
<DeviceCapability Name="serialcommunication">
<Device Id="vidpid:045E 0610">
<Function Type="name:serialPort"/>
</Device>
</DeviceCapability>
or if you want to access any hardware:
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort"/>
</Device>
</DeviceCapability>
You will find a full serial port sample as part of the UWP sample collection.