Menu

#12 BAUD_INVALID == BAUD_115200 #2

None
closed-fixed
nobody
None
5
2015-04-18
2011-12-28
Anonymous
No

So why do you mark this case "fixed", while in the sourceforge download it is still there??? It took me an hour to find the cause of the problem!

Discussion

  • Radioguy00

    Radioguy00 - 2015-04-17

    In the latest version of the code the problem is not fixed. The problem can be traced to the BaudRateEnum defining the different baud rate speed. The BAUD_INVALID value takes by default the value of the previous enum value +1. The previous enum value happens to be 4097. BAUD_INVALID becomes 4098 the same as BAUD_115200.
    A fix would be to specify the underlying type of the enum and force BAUD_INVALID to be its maximum value

           enum BaudRateEnum {
                BAUD_50    = SerialPort::BAUD_50,
                BAUD_75    = SerialPort::BAUD_75,
                BAUD_110   = SerialPort::BAUD_110,
                BAUD_134   = SerialPort::BAUD_134,
                BAUD_150   = SerialPort::BAUD_150,
                BAUD_200   = SerialPort::BAUD_200,
                BAUD_300   = SerialPort::BAUD_300,
                BAUD_600   = SerialPort::BAUD_600,
                BAUD_1200  = SerialPort::BAUD_1200,
                BAUD_1800  = SerialPort::BAUD_1800,
                BAUD_2400  = SerialPort::BAUD_2400,
                BAUD_4800  = SerialPort::BAUD_4800,
                BAUD_9600  = SerialPort::BAUD_9600,
                BAUD_19200 = SerialPort::BAUD_19200,
                BAUD_38400 = SerialPort::BAUD_38400,
                BAUD_57600 = SerialPort::BAUD_57600,
                BAUD_115200 = SerialPort::BAUD_115200,  ----> 4098
                BAUD_230400 = SerialPort::BAUD_230400,
        #ifdef __linux__
                BAUD_460800 = SerialPort::BAUD_460800,
        #endif
                BAUD_DEFAULT = SerialPort::BAUD_DEFAULT, ----> 4097
                BAUD_INVALID   ----> 4098
            } ;
    
     
  • Crayzee Wulf

    Crayzee Wulf - 2015-04-17

    The issue was fixed in SVN (see this comment) by setting BAUD_INVALID to -1. It is not in a released version yet.

     
  • Crayzee Wulf

    Crayzee Wulf - 2015-04-17

    I have updated the latest source code package to include the fix from SVN. Hopefully this will help other. Sorry you had to waste your time tracking this issue.

     
  • Crayzee Wulf

    Crayzee Wulf - 2015-04-17
    • status: closed-invalid --> closed-fixed
     
  • Radioguy00

    Radioguy00 - 2015-04-18

    Thanks

     

Log in to post a comment.

MongoDB Logo MongoDB