问题
I am looking for a solution to send an escape sequence to a serial port in a windows store app.
Maybe my understanding of windows store apps is wrong. I don't want to run this app on a windows RT device, but on a normal windows 8 PC. I know, that windows RT devices do only support very less communication with connected devices, but not serial ports.
回答1:
Well, as I know it's not possible to do something like that by using WinRT library. It's sandboxed and you can't access lots of features Windows OS is supplying. Your only choice is to create a regular desktop application.
回答2:
You can do this with a USB to UART Bridge device, but it will require some work and basic knowledge of USB to get it up and running.
Have a look at the Windows.Devices.Usb namespace. With this you can use a defined protocol for a USB to serial device to transmit data. There are plenty of USB to UART Bridges available if you search. For example use the CP210x interface specification with a CP210x device using Windows.Devices.Usb. Your application can configure the device through control requests and can transmit data over the bulk pipes to read/write from the RS232 port on the other side of the USB to UART Bridge.
来源:https://stackoverflow.com/questions/23127596/access-to-serial-port-for-windows-store-apps