First version of manpages. Added remaining baud rates for serial communication.
This commit is contained in:
parent
36c46d18c2
commit
db343cba2b
2
COPYING
2
COPYING
@ -22,7 +22,7 @@ Contributers:
|
|||||||
* Uwe Grohnwaldt
|
* Uwe Grohnwaldt
|
||||||
* Markus Bergkvist
|
* Markus Bergkvist
|
||||||
|
|
||||||
LICENSE (the BSD lisence):
|
LICENSE (the BSD license):
|
||||||
|
|
||||||
Copyright (c) 2010-2012, Raditex Control AB
|
Copyright (c) 2010-2012, Raditex Control AB
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -65,3 +65,24 @@ mbus_serial_switch_baudrate_LDFLAGS = -L$(top_builddir)/mbus
|
|||||||
mbus_serial_switch_baudrate_LDADD = -lmbus
|
mbus_serial_switch_baudrate_LDADD = -lmbus
|
||||||
mbus_serial_switch_baudrate_SOURCES = mbus-serial-switch-baudrate.c
|
mbus_serial_switch_baudrate_SOURCES = mbus-serial-switch-baudrate.c
|
||||||
|
|
||||||
|
# man pages
|
||||||
|
dist_man_MANS = libmbus.1 \
|
||||||
|
mbus-tcp-scan.1 \
|
||||||
|
mbus-tcp-request-data.1 \
|
||||||
|
mbus-tcp-request-data-multi-reply.1 \
|
||||||
|
mbus-tcp-select-secondary.1 \
|
||||||
|
mbus-tcp-scan-secondary.1 \
|
||||||
|
mbus-serial-scan.1 \
|
||||||
|
mbus-serial-request-data.1 \
|
||||||
|
mbus-serial-request-data-multi-reply.1 \
|
||||||
|
mbus-serial-select-secondary.1 \
|
||||||
|
mbus-serial-scan-secondary.1 \
|
||||||
|
mbus-serial-switch-baudrate.1
|
||||||
|
|
||||||
|
.pod.1:
|
||||||
|
pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
|
||||||
|
>.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
|
||||||
|
@if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
|
||||||
|
then \
|
||||||
|
echo "$@ has some POD errors!"; false; \
|
||||||
|
fi
|
||||||
|
125
bin/libmbus.pod
Normal file
125
bin/libmbus.pod
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
libmbus (utilities) - support utilities to the libmbus. libmbus is an open
|
||||||
|
source M-bus (Meter-Bus) library. The Meter-Bus is a standard for reading out
|
||||||
|
meter data from electricity meters, heat meters, gas meters, etc. The role
|
||||||
|
of the libmbus library is to decode/encode M-bus data, and to handle
|
||||||
|
the communication with M-Bus devices.
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
B<mbus-serial-switch-baudrate> [-b BAUDRATE] device address target-baudrate
|
||||||
|
|
||||||
|
B<mbus-serial-scan> [-d] [-b BAUDRATE] device
|
||||||
|
|
||||||
|
B<mbus-tcp-scan> [-d] host port
|
||||||
|
|
||||||
|
B<mbus-serial-scan-secondary> [-d] [-b BAUDRATE] device [address-mask]
|
||||||
|
|
||||||
|
B<mbus-tcp-scan-secondary> host port [address-mask]
|
||||||
|
|
||||||
|
B<mbus-serial-request-data> [-d] [-b BAUDRATE] device mbus-address
|
||||||
|
|
||||||
|
B<mbus-tcp-request-data> [-d] host port mbus-address
|
||||||
|
|
||||||
|
B<mbus-serial-request-data-multi-reply> [-d] [-b BAUDRATE] device mbus-address
|
||||||
|
|
||||||
|
B<mbus-tcp-request-data-multi-reply> [-d] host port mbus-address
|
||||||
|
|
||||||
|
B<mbus-serial-select-secondary> [-b BAUDRATE] device secondary-mbus-address
|
||||||
|
|
||||||
|
B<mbus-tcp-select-secondary> host port secondary-mbus-address
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
B<mbus-serial-switch-baudrate> - attempts to switch the communication speed of
|
||||||
|
the MBus device.
|
||||||
|
|
||||||
|
B<mbus-serial-scan>, B<mbus-tcp-scan> - sequentially scan for devices on MBus bus
|
||||||
|
using primary addresses.
|
||||||
|
|
||||||
|
B<mbus-serial-scan-secondary>, B<mbus-tcp-scan-secondary> - scan for devices on
|
||||||
|
MBus bus using secondary addresses. The scan is not sequential.
|
||||||
|
|
||||||
|
B<mbus-serial-request-data>, B<mbus-tcp-request-data> - read data from given device.
|
||||||
|
Supports both primary and secondary address types.
|
||||||
|
|
||||||
|
B<mbus-serial-request-data-multi-reply>, B<mbus-tcp-request-data-multi-reply> - read
|
||||||
|
data from given device supporting multi-telegram (up to 16 frames) reply. Can be also
|
||||||
|
used for single telegram as mbus-serial-request-data or mbus-tcp-request-data.
|
||||||
|
Supports both primary and secondary address types.
|
||||||
|
|
||||||
|
B<mbus-serial-select-secondary>, B<mbus-tcp-select-secondary> - perform single secondary
|
||||||
|
address select to check what device responds.
|
||||||
|
|
||||||
|
=head1 OPTIONS
|
||||||
|
|
||||||
|
There are following options/parameters:
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item B<-b> I<BAUDRATE>
|
||||||
|
|
||||||
|
For serial communication, use given I<BAUDRATE> (integer in Bd). If not used then
|
||||||
|
default baudrate of 9600 will be used.
|
||||||
|
|
||||||
|
=item B<-d>
|
||||||
|
|
||||||
|
Enable debugging messages.
|
||||||
|
|
||||||
|
=item B<device>
|
||||||
|
|
||||||
|
For serial communication, the serial device which represents the MBus (gateway).
|
||||||
|
Typically something like /dev/ttyS0, /dev/ttyUSB0, etc.
|
||||||
|
|
||||||
|
=item B<host>
|
||||||
|
|
||||||
|
For TCP communciation, the host which represents the MBus (gateway).
|
||||||
|
|
||||||
|
=item B<port>
|
||||||
|
|
||||||
|
For TCP communciation, the port on the host which represents the MBus (gateway).
|
||||||
|
|
||||||
|
=item B<address>
|
||||||
|
|
||||||
|
MBus device primary address. An integer between 1 and 250.
|
||||||
|
|
||||||
|
=item B<address-mask>
|
||||||
|
|
||||||
|
Address mask for secondary address scan - you can restrict the search by supplying
|
||||||
|
an optional address mask on the form 'FFFFFFFFFFFFFFFF' where F is a wildcard
|
||||||
|
character.
|
||||||
|
|
||||||
|
=item B<mbus-address>
|
||||||
|
|
||||||
|
MBus device address. Could be a primary address (an integer between 1 and 250) or
|
||||||
|
a secondary address (sixteen digit hexadecimal number).
|
||||||
|
|
||||||
|
=item B<secondary-mbus-address>
|
||||||
|
|
||||||
|
MBus secondary address of the device. Sixteen digit hexadecimal number.
|
||||||
|
|
||||||
|
=item B<target-baudrate>
|
||||||
|
|
||||||
|
For serial communication, the baudrate to which the device should be switched.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
|
||||||
|
=head1 EXAMPLES
|
||||||
|
|
||||||
|
Scan for MBus devices on the serial port:
|
||||||
|
|
||||||
|
mbus-serial-scan -d -b 2400 /dev/ttyS0
|
||||||
|
|
||||||
|
Try to switch baud rate of a device on address 59 from 2400Bd to 9600Bd:
|
||||||
|
|
||||||
|
mbus-serial-switch-baudrate -b 2400 /dev/ttyUSB0 59 9600
|
||||||
|
|
||||||
|
=head1 SEE ALSO
|
||||||
|
|
||||||
|
S<http://www.rscada.se/libmbus> and S<http://www.m-bus.com>
|
||||||
|
|
||||||
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
See S<http://www.rscada.se/libmbus> and S<https://github.com/rscada/libmbus>
|
2
bin/mbus-serial-request-data-multi-reply.1
Normal file
2
bin/mbus-serial-request-data-multi-reply.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-serial-request-data.1
Normal file
2
bin/mbus-serial-request-data.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-serial-scan-secondary.1
Normal file
2
bin/mbus-serial-scan-secondary.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-serial-scan.1
Normal file
2
bin/mbus-serial-scan.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-serial-select-secondary.1
Normal file
2
bin/mbus-serial-select-secondary.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-serial-switch-baudrate.1
Normal file
2
bin/mbus-serial-switch-baudrate.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-tcp-request-data-multi-reply.1
Normal file
2
bin/mbus-tcp-request-data-multi-reply.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-tcp-request-data.1
Normal file
2
bin/mbus-tcp-request-data.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-tcp-scan-secondary.1
Normal file
2
bin/mbus-tcp-scan-secondary.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-tcp-scan.1
Normal file
2
bin/mbus-tcp-scan.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
2
bin/mbus-tcp-select-secondary.1
Normal file
2
bin/mbus-tcp-select-secondary.1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.so man1/libmbus.1
|
||||||
|
|
@ -111,6 +111,11 @@ mbus_serial_set_baudrate(mbus_handle *handle, int baudrate)
|
|||||||
serial_data->t.c_cc[VTIME] = 12; // Timeout in 1/10 sec
|
serial_data->t.c_cc[VTIME] = 12; // Timeout in 1/10 sec
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 600:
|
||||||
|
speed = B600;
|
||||||
|
serial_data->t.c_cc[VTIME] = 6; // Timeout in 1/10 sec
|
||||||
|
break;
|
||||||
|
|
||||||
case 1200:
|
case 1200:
|
||||||
speed = B1200;
|
speed = B1200;
|
||||||
serial_data->t.c_cc[VTIME] = 4; // Timeout in 1/10 sec
|
serial_data->t.c_cc[VTIME] = 4; // Timeout in 1/10 sec
|
||||||
@ -121,11 +126,26 @@ mbus_serial_set_baudrate(mbus_handle *handle, int baudrate)
|
|||||||
serial_data->t.c_cc[VTIME] = 2; // Timeout in 1/10 sec
|
serial_data->t.c_cc[VTIME] = 2; // Timeout in 1/10 sec
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 4800:
|
||||||
|
speed = B4800;
|
||||||
|
serial_data->t.c_cc[VTIME] = 2; // Timeout in 1/10 sec
|
||||||
|
break;
|
||||||
|
|
||||||
case 9600:
|
case 9600:
|
||||||
speed = B9600;
|
speed = B9600;
|
||||||
serial_data->t.c_cc[VTIME] = 1; // Timeout in 1/10 sec
|
serial_data->t.c_cc[VTIME] = 1; // Timeout in 1/10 sec
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 19200:
|
||||||
|
speed = B19200;
|
||||||
|
serial_data->t.c_cc[VTIME] = 1; // Timeout in 1/10 sec
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 38400:
|
||||||
|
speed = B38400;
|
||||||
|
serial_data->t.c_cc[VTIME] = 1; // Timeout in 1/10 sec
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return -1; // unsupported baudrate
|
return -1; // unsupported baudrate
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user