linux - fconfigure refuses to set baud rate to 921600 -


in expect script, i'm trying replace spawn kermit direct access serial port/console under ubuntu 14.04.

the code simple:

set device "/dev/ttyusb1" set device_handle [open $device w+] fconfigure $device_handle -mode "921600,n,8,1" -handshake none #spawn -open $device_handle 

my problem tcl (8.6) or expect (5.45) refuse set baud rate 921600.

from strace output, can see baud rate set 460800 instead (in tcsetsw command ioctl()). this:

$ grep tcsetsw strace.out.* strace.out.28667:ioctl(6, sndctl_tmr_stop or sndrv_timer_ioctl_ginfo or tcsetsw, {b460800 -opost -isig -icanon -echo ...}) = 0 strace.out.28667:ioctl(6, sndctl_tmr_stop or sndrv_timer_ioctl_ginfo or tcsetsw, {b460800 -opost -isig -icanon -echo ...}) = 0 strace.out.28667:ioctl(6, sndctl_tmr_stop or sndrv_timer_ioctl_ginfo or tcsetsw, {b460800 -opost -isig -icanon -echo ...}) = 0 

i have tested lower baud rates - 9600, 115200, 460800 - , tcl calls ioctl() correct baud rates. if try set 921600, tcl sets 460800 instead. (the kermit uses same ioctl() call , sets correct baudrate.)

any ideas?

i have researched issue, , appears limitation burned tcl core. on unix platform, have hard coded list of baud rates, , highest 460800.

if comfortable hacking tcl core sources, can add own baud rates speeds[] array populated in unix/tclunixchan.c (around line 900). we'll working on getting more date set of speeds next release.

--sean "the hypnotoad" woods

update: patch checked in: http://core.tcl.tk/tcl/info/7c1aae5292b3e6cd


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -