I have a device which works on 2400 bps baud rate speed, i am using a 3rd party application which sets the baud rate to 19200 bps. so sync is not happening. I can change the value to 2400 using command/script. (That's working fine).
I want a solution to restrict the baud rate to 2400, even application can't change it.
Kindly suggest.
I want to restrict a serial port baud rate to 2400 instead of the default value.
Re: I want to restrict a serial port baud rate to 2400 instead of the default value.
Can't you just set it (say in rc.local) via mgetty -s 2400 /dev/ttyS0 (or whatever device it is), or something like stty -F /dev/ttyS0 2400 cread cs8 -cstopb -parenb (more options used here). I don't think you can get udev to do it, when it "enables" the hardware - well you might with some custom udev rules, but I'll leave that to you to work out.
As far as some process that can change it, I doubt you could, but I guess you could change the permissions of the device so only a certain user (or root) can read/write to it (a simple udev rule would work for that). Unless you applications run as root of course.
As far as some process that can change it, I doubt you could, but I guess you could change the permissions of the device so only a certain user (or root) can read/write to it (a simple udev rule would work for that). Unless you applications run as root of course.
Re: I want to restrict a serial port baud rate to 2400 instead of the default value.
Yes, the application is running as root.
I want to know in which file the baud rate settings are defined. Can't we change that?
Or is there any macro defined for baud rate selection? What if we just change the baud rate value there.
I want to know in which file the baud rate settings are defined. Can't we change that?
Or is there any macro defined for baud rate selection? What if we just change the baud rate value there.
Re: I want to restrict a serial port baud rate to 2400 instead of the default value.
I think it's a hardware state. As the app runs as root, it can overwrite whatever values you set when it launches and opens the serial port.
You could use the stuff I posted earlier to set the various states, but it could always be overwritten anyway.
You could use the stuff I posted earlier to set the various states, but it could always be overwritten anyway.
Re: I want to restrict a serial port baud rate to 2400 instead of the default value.
If you run lsmod and look at the modules that are loaded you should be able to work out which are used for your serial port. Then run modinfo against each of those in turn and see if they take any parameters that might be used to artificially cap the baud rate.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke