Skip to content

Support other baud rates #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

mfine
Copy link

@mfine mfine commented Oct 7, 2016

We're using higher baud rates not defined - we'd like to access them if our underlying system can support them. The limited set of baud rates is currently too restrictive - this allows an escape hatch.

@hvr
Copy link
Member

hvr commented Oct 7, 2016

Which baudrates are you considering?

The not-so-nice thing about it is that those BOther-values are rather magical, e.g. I see

#define  B0     0000000
#define  B50    0000001
#define  B75    0000002
#define  B110   0000003
#define  B134   0000004
#define  B150   0000005
#define  B200   0000006
#define  B300   0000007
#define  B600   0000010
#define  B1200  0000011
#define  B1800  0000012
#define  B2400  0000013
#define  B4800  0000014
#define  B9600  0000015
#define  B19200 0000016
#define  B38400 0000017

#define  B57600   0010001
#define  B115200  0010002
#define  B230400  0010003
#define  B460800  0010004
#define  B500000  0010005
#define  B576000  0010006
#define  B921600  0010007
#define  B1000000 0010010
#define  B1152000 0010011
#define  B1500000 0010012
#define  B2000000 0010013
#define  B2500000 0010014
#define  B3000000 0010015
#define  B3500000 0010016
#define  B4000000 0010017

which don't have an obvious mapping between the magic value and the nominal baudrate...

@mfine
Copy link
Author

mfine commented Oct 7, 2016

Interesting - on our systems the defines refer to speeds:

/*

  • Standard speeds
    _/
    #define B0 0
    #define B50 50
    #define B75 75
    #define B110 110
    #define B134 134
    #define B150 150
    #define B200 200
    #define B300 300
    #define B600 600
    #define B1200 1200
    #define B1800 1800
    #define B2400 2400
    #define B4800 4800
    #define B9600 9600
    #define B19200 19200
    #define B38400 38400
    #if !defined(_POSIX_C_SOURCE) || defined(DARWIN_C_SOURCE)
    #define B7200 7200
    #define B14400 14400
    #define B28800 28800
    #define B57600 57600
    #define B76800 76800
    #define B115200 115200
    #define B230400 230400
    #define EXTA 19200
    #define EXTB 38400
    #endif /
    (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */

Our devices have baud rates of 921600 and 1000000, neither value of which is defined in the headers :( which makes checking for the defines problematic - we really need a way just to bypass things. We're able to use this bypass successfully. Not sure what makes sense here.

@mfine
Copy link
Author

mfine commented Oct 7, 2016

/*
 * Standard speeds
 */
#define B0  0
#define B50 50
#define B75 75
#define B110    110
#define B134    134
#define B150    150
#define B200    200
#define B300    300
#define B600    600
#define B1200   1200
#define B1800   1800
#define B2400   2400
#define B4800   4800
#define B9600   9600
#define B19200  19200
#define B38400  38400
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define B7200   7200
#define B14400  14400
#define B28800  28800
#define B57600  57600
#define B76800  76800
#define B115200 115200
#define B230400 230400
#define EXTA    19200
#define EXTB    38400
#endif  /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */

@hs-viktor
Copy link
Contributor

hs-viktor commented May 30, 2022

Closing, replaced by #216

@hs-viktor hs-viktor closed this May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants