locked
Access COM Port with Brokered Windows Runtime Components

    Question

  • Hi

    I found a way to execute code from desktop environment from my Windows Store apps. It is Brokered component here.

    But I need to know how to use that to access COM port. I am trying to execute this:

    System.IO.Ports.SerialPort gpsSerialPort = new System.IO.Ports.SerialPort("COM3", 4800);

    if (!gpsSerialPort.IsOpen) // exception here
                    {
                        gpsSerialPort.Open(); // or here, not sure
                    }

    But this code throws an exception. Can any one help in this point please?

    Thank you

    Friday, January 16, 2015 11:07 PM

All replies

  • But this code throws an exception

    What's the exception you're getting?


    Happy Coding!

    Saturday, January 17, 2015 3:09 PM
  • The exception says Not authorized access (that I cannot access COM port), NOTE: It succeeded to get the count and names of COM ports. But I cannot access certain port that is connected to GPS and get data from its buffer.
    Wednesday, January 21, 2015 12:12 PM