Skip to content

Parity is always read as SP_PARITY_INVALID on Linux #44

@sdbbs

Description

@sdbbs

I have noticed, that while running on WIndows, sp_get_config_parity nearly always returns some concrete parity for a serial port, e.g. SP_PARITY_NONE - but on Linux, even if I call with my libserialport application with sudo, having used these lines from examples:

         result = check_sp(sp_get_config_parity(initial_config, &parity));
         if (result != SP_OK) { return result; }

... and then, whever I print parity_name_sp(parity) I get "(Invalid)" that is SP_PARITY_INVALID. This is on Raspbian 9, Raspberry Pi 3B+.

I would inspected the matter more, unfortunately parity_name_sp() is a macro (itself created by CREATE_ACCESSORS), and I cannot break into it in the debugger.

What can I do to get actual parity information about serial ports on this OS? Note that there are no problems with the other config parameters on this system, e.g. I get printouts:

config: Baudrate: 9600, data bits: 8, parity: (Invalid), stop bits: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions