libcsdbg  1.28
C++ exception (and generic) stack trace debug library
u32 csdbg::sttybuf::translate_baud ( u32  rate)
static

Translate a number to a baud rate as defined in termios.h.

Parameters
[in]ratethe value to translate
Returns
the translated value
Exceptions
csdbg::exception
Attention
For simplicity, only a subset (most commonly used) of the values defined in termios.h are translatable

Definition at line 390 of file sttybuf.cpp.

Referenced by config().

391 {
392  switch (rate) {
393  case 9600:
394  return B9600;
395 
396  case 19200:
397  return B19200;
398 
399  case 38400:
400  return B38400;
401 
402  case 57600:
403  return B57600;
404 
405  case 115200:
406  return B115200;
407 
408  case 230400:
409  return B230400;
410 
411  case 460800:
412  return B460800;
413 
414  default:
415  throw exception("invalid argument: rate (=%d)", rate);
416  }
417 }

+ Here is the caller graph for this function: