|Top Previous Next|
Actual baudrade is calculated as follows: (9600*ser.div9600)/ser.baudrate. The ser.div9600 read-only property returns the value ser.baudrate must be set to in order to obtain 9600 bps on a particular platform.
For example, if we need to achieve 38400bps and ser.div9600 returns 12, then we need to set ser.baudrate=3, because (9600*12)/38400=3. This serves as a platform-independent baudrate calculation, as ser.div9600 will return different values for different platforms.
This property is only relevant when the serial port is in the UART mode (ser.mode= 0- PL_SER_MODE_UART).