← Back to team overview

modbus team mailing list archive

Re: libmodbus on ARM

 

On 12/07/2011 20:10, Stéphane Raimbault wrote:
2011/7/12 Alex Stapleton<alexs@xxxxxxxxxxxxx>:
It would seem that the RS485 code that's been put into libmodbus could use
some ifdefs for better platform compatibility.

It's already the case (since one month) on github:

#if defined(HAVE_DECL_TIOCSRS485)
#include<sys/ioctl.h>
#include<linux/serial.h>
#endif

Could test again with 3.0.0 release, please?

The problem with this is that sometimes HAVE_DECL_TIOCSRS485 is set
but TIOCSRS485 is not. For me this was because the emdebian armel headers
don't seem to line up properly.

Normally sys/ioctl.h indirectly includes
asm-generic/ioctls.h which has the actual defines in. On some cross-compile
headers asm-generic/ioctls.h must be included directly. This is an upstream
bug but it might be worth working around it in the libmodbus tree. Maybe throw
a #warning in if it's detected?


Follow ups

References