Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-15-2011, 03:02 AM   #1
LQ Newbie
Registered: Nov 2010
Location: Eindhoven, NL
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
Unhappy Why is 6400 baud not supported!


I desperately want to get away from DOS and Windows, change to Linux... however I need 6400 baud for a special dongle.

I found out my PC is working in Windows perfect at this baudrate, but in Linux it is unsupported.

termios.h seems to have no support. I'm programming in C++ and want to use 6400 baud.

With setserial software I can have a divisor of 18, then the baudrate = 115200/18 = 6400. However, I want to use it in my programs (G++) and maybe also in Dosbox until my program is completely converted to Linux... however, if Linux does NOT support 6400 baud this operating system I have to stick to MFC, which is terrible.

Who has a decent solution to this?
Old 01-15-2011, 06:57 AM   #2
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,816
Blog Entries: 27

Rep: Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
Old 01-15-2011, 06:59 AM   #3
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,251

Rep: Reputation: 826Reputation: 826Reputation: 826Reputation: 826Reputation: 826Reputation: 826Reputation: 826
Why not change the dongle design? Or are you circumventing proprietary code?
Old 01-15-2011, 10:04 PM   #4
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 178Reputation: 178
Originally Posted by business_kid View Post
are you circumventing proprietary code?
We don't need to know the answer to this question, because what mensfort needs to do here is the same, regardless of whether he's circumventing proprietary code.

I found a hint here. I haven't tested the following code, but it ought to compile in both Microsoft(spit)(R) and Linux environments. Will something like this do the trick?
#if defined(__GLIBC__)
#include <asm/ioctls.h>
#include <linux/serial.h>

/* ... */

#if defined(__GLIBC__)
struct serial_struct cheerios;

/* ... */

#if defined(__GLIBC__)
  /* Handle error here. */
  /* Handle error here. */
/* Do whatever one does in the Microsoft(spit)(R) world. */
The link mentioned above hints that before you use TIOC[GS]SERIAL, you should call tcsetattr() and set c_cflag to B38400. I'm not convinced that this is necessary, but if the above code doesn't work by itself, try adding this additional stuff first.

Hope this helps.


dosbox, hardware, serial port

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make the baud rate be configured automatically? corone Linux - Server 6 11-03-2010 01:47 PM
SF Thinstation redirected com port baud rate JoDee Linux - Software 0 09-11-2006 12:25 PM
Change the network baud rate zaheer031 Linux - Software 1 05-15-2006 11:37 PM
Reading Baud Rate of Serial Port zaheer031 Programming 1 09-27-2004 12:47 PM
rs232 at non-standard baud rate possible? scgadgets Programming 1 09-14-2001 08:27 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration