UWP serial unpredictable

DannyKir 1 Reputation point
2021-01-22T10:03:39.283+00:00

Hello, I'm trying to submit this issue that is blocking my developments using uwp but every time the only feedbacks I receive are broken links where I should resubmit the issue. Could you please help me in find the right place where I can submit this issue?
Thank you

(reposted)

The UWP SerialDevice class currently only allows you to set "ReadTimeout", which under the hood, sets the"ReadIntervalTimeout" of the actual serial device (). There are two other timeout values which dramatically affect the read operations behavior:

ReadTotalTimeoutMultiplier
ReadTotalTimeoutConstant.
The UWP SerialDevice class does not allow the user to set these two other read timeout values, and even
worse, the UWP SerialDevice class does not set these two other timeout values to known values when the
serial device is opened. This means that the two other timeout values will be whatever default value the serial
driver uses, or worse still, whatever value some serial port application happened to set these two values to be
when the other application was last executed.

The overall effect of this is that your UWP application's serial device read behavior is undefined and cannot reliably be used. For example, if these two other timeout values happen to be set one way, then a read operation may block forever waiting on the first byte of data to be read, but if the other timeout values
happen to be set a different way, then the read operation may return immediately, with no data read at all.
Currently, a UWP application cannot control this behavior, and the behavior will be different across different serial ports, and even perhaps different every time the UWP application is executed.
The UWP SerialDevice class either needs to

1)Allow the user to set these two other read timeout values (preferred), OR
2)Initialize these two other timeout values to known values when the serial device is opened.

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,856 Reputation points
    2021-01-25T06:10:07.233+00:00

    Hello @DannyKir , Welcome to Microsoft Q&A,

    The UWP SerialDevice class currently only allows you to set "ReadTimeout", which under the hood, sets the"ReadIntervalTimeout" of the actual serial device (). There are two other timeout values which dramatically affect the read operations behavior:

    Yep, currently, UWP SerialDevice does not contain ReadTotalTimeoutMultiplier ReadTotalTimeoutConstant property, For your scenario, we suggest use desktop-bridge to make desktop extension for UWP app, and load SerialDevice in the desktop extension and send the message back to uwp with AppService.

    And you do want this feature, please feel free post your requirements with windows feed back hub app.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments