On Sat, 26 Apr 2014 15:44:24 -0700
peternewman <notifications@github.com> wrote:

> > + */
> > +
> > +#include <stdio.h>
> > +#include <stdlib.h>
> > +#include <string.h>
> > +// this provides ioctl() definition without conflicting with
> > asm/termios.h +#include <stropts.h>
> > +#include <asm/termios.h>  // use this not standard termios for
> > custom baud rates +
> > +#include "plugins/uartdmx/UartLinuxHelper.h"
> > +
> > +namespace ola {
> > +namespace plugin {
> > +namespace uartdmx {
> > +
> > +bool LinuxHelper::SetDmxBaud(const int fd) {
> 
> This really wants to become a shared function in
> include/ola/io/Serial.h, with some magic like the InterfacePickers to
> handle different implementations, and I guess all non-linux ones
> return false.

This could get quite messy, because you can't #include asm/termios.h
and termios.h into the same file without them clashing, and you can't
use ioctl.h in the same file as asm/termios.h (which is why I use
stropts.h). Otherwise this wouldn't be a separate compilation unit!
Keeping it here ensures that it doesn't get built for anything other
than Linux, which is all I expect it to compile on.

At the moment they could go in, but it would likely make moving any
other (platform-independent) code in rather harder.

Richard