Patches for FreeBSD
Bug #457200 reported by
Norbert Koch
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmodbus |
Fix Released
|
Low
|
Stéphane Raimbault |
Bug Description
As I would like to use libmodbus under FreeBSD I did some testing today.
With the attached patches I can run the programs under tests/
on the following systems:
FreeBSD 4.11 / gcc 2.95.4
FreeBSD 8.0RC1 / gcc 4.2.1
So far I did only test local host network communication,
not serial communication.
Related branches
Changed in libmodbus: | |
status: | New → Fix Released |
importance: | Undecided → Low |
assignee: | nobody → Stéphane Raimbault (sra) |
To post a comment you must log in.
FYI, I did some modbus-rtu tests:
Operating systems
Unit1: Windows XP COM1
Unit2: FreeBSD 4.11, /dev/cuaa0 (COM1)
Unit3: FreeBSD 4.11, /dev/cuaa0 (COM1)
Software: test-master( rtu, "/dev/cuaa0", 9600BpS) @ Unit2 test-slave( rtu, "/dev/cuaa0", 9600BpS) @ Unit3
Sw1: QModbus 0.1.1 @ Unit1 (libmodbus-based)
Sw2: random-
Sw3: random-
Sw4: known-to-work modbus slave software @ Unit3 (not libmodbus-based)
Sw5: 'cat /dev/cuaa0 | hd' @ Unit3
1: Sw1 --> Sw4 : ok
2: Sw1 --> Sw3 : not ok, Timeout
3: Sw2 --> Sw3: not ok, Timeout
4: Sw2 --> Sw4: not ok, Timeout
5: Sw2 --> Sw5: I can see correct request messages arriving
I compared termios settings to serial.cpp in =c_cc[VEOL2] = 0
platform independant library CommonC++
which is used in Sw4:
1. They first open with O_RDWR|O_NDELAY
2. They set HUPCL in c_cflag.
3. They set c_cc[VMIN]=1, NOT to 0.
4. They set c_cc[VEOL]
5. After tcsetattr they do fcntl ~O_NDELAY
But as, they do poll (=select) before reading,
I see no reason why this should make a
difference.