Menu

#177 Non-standard baudrate behaviour misleading

v2.5
open
nobody
None
5
2015-01-07
2015-01-07
No

Hi.

AFAIU, when a non-standard baudrate is provided, 38400 is actually used, but Serial.baudrate still returns the provided non standard value.

This would happen at line 346 and below in serialposix.py:

http://sourceforge.net/p/pyserial/code/HEAD/tree/trunk/pyserial/serial/serialposix.py#l346

If this is correct, then I think it is pretty misleading.

If my understanding is incorrect, then, well... I'm sorry.

This gave us quite a hard time today:

https://github.com/emonhub/emonhub/issues/135#issuecomment-68865416

Maybe this could be at least documented in the API doc page:

http://pyserial.sourceforge.net/pyserial_api.html

Currently it just says:

Non-standard values are also supported on some platforms (GNU/Linux, MAC OSX >= Tiger, Windows). Though, even on these platforms some serial ports may reject non-standard values.

But nothing about a default value.

I'm using Raspian version (on a RaspberryPi), which is 2.5.

Thanks for pyserial, anyway. We use it extensively.

Discussion


Log in to post a comment.