Page MenuHomePhabricator | MITK

The return value in mitkSerialCommunication::Send is inconsistent under Microsoft Windows Platforms
Closed, ResolvedPublic


The return value of mitkSerialCommunication::Send is incosistent in Windows. That function returns 1 for Ok and 0 for an error condition, but if the WriteFile fails (it it returns FALSE), Send returns the GetLastError() value. In general GetLastError will return values > 0 for error codes, possibly not a 1 (ERROR_INVALID_FUNCTION) for the WriteFile call, but surely a 5 (ERROR_ACCESS_DENIED) when the serial port is physically unplugged while sending data.

I propose to replace the calls to GetLastError() for ERROR_VALUE.


Event Timeline

milano triaged this task as Low priority.Feb 7 2019, 3:33 PM
milano created this task.
milano updated the task description. (Show Details)Feb 7 2019, 3:54 PM
milano added a project: Pull Request.
seitela closed this task as Resolved.Feb 15 2019, 12:23 PM