got rid of duplicate catalog libmbus/libmbus
This commit is contained in:
24
bin/Makefile-static
Normal file
24
bin/Makefile-static
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
# All rights reserved.
|
||||
#
|
||||
# rSCADA
|
||||
# http://www.rSCADA.se
|
||||
# info@rscada.se
|
||||
#
|
||||
CFLAGS=-Wall -g -I..
|
||||
LDFLAGS=-L.. -lm -lmbus
|
||||
|
||||
all: mbus-tcp-scan mbus-tcp-request-data
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
mbus-tcp-scan: mbus-tcp-scan.o mbus-tcp.o
|
||||
gcc -o $@ $^ $(LDFLAGS)
|
||||
|
||||
mbus-tcp-request-data: mbus-tcp-request-data.o mbus-tcp.o
|
||||
gcc -o $@ $^ $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -rf mbus-tcp-request-data mbus-tcp-scan *.o *~
|
63
bin/Makefile.am
Normal file
63
bin/Makefile.am
Normal file
@ -0,0 +1,63 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (C) 2010, Raditex AB
|
||||
# All rights reserved.
|
||||
#
|
||||
# rSCADA
|
||||
# http://www.rSCADA.se
|
||||
# info@rscada.se
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/src
|
||||
|
||||
noinst_HEADERS =
|
||||
bin_PROGRAMS = mbus-tcp-scan mbus-tcp-request-data mbus-tcp-request-data-multi-reply \
|
||||
mbus-tcp-select-secondary mbus-tcp-scan-secondary \
|
||||
mbus-serial-scan mbus-serial-request-data \
|
||||
mbus-serial-select-secondary mbus-serial-scan-secondary \
|
||||
mbus-serial-switch-baudrate
|
||||
|
||||
# tcp
|
||||
mbus_tcp_scan_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_scan_LDADD = -lmbus
|
||||
mbus_tcp_scan_SOURCES = mbus-tcp-scan.c
|
||||
|
||||
mbus_tcp_request_data_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_request_data_LDADD = -lmbus
|
||||
mbus_tcp_request_data_SOURCES = mbus-tcp-request-data.c
|
||||
|
||||
mbus_tcp_request_data_multi_reply_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_request_data_multi_reply_LDADD = -lmbus
|
||||
mbus_tcp_request_data_multi_reply_SOURCES = mbus-tcp-request-data-multi-reply.c
|
||||
|
||||
mbus_tcp_select_secondary_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_select_secondary_LDADD = -lmbus
|
||||
mbus_tcp_select_secondary_SOURCES = mbus-tcp-select-secondary.c
|
||||
|
||||
mbus_tcp_scan_secondary_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_scan_secondary_LDADD = -lmbus
|
||||
mbus_tcp_scan_secondary_SOURCES = mbus-tcp-scan-secondary.c
|
||||
|
||||
# serial
|
||||
mbus_serial_scan_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_scan_LDADD = -lmbus
|
||||
mbus_serial_scan_SOURCES = mbus-serial-scan.c
|
||||
|
||||
mbus_serial_request_data_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_request_data_LDADD = -lmbus
|
||||
mbus_serial_request_data_SOURCES = mbus-serial-request-data.c
|
||||
|
||||
mbus_serial_select_secondary_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_select_secondary_LDADD = -lmbus
|
||||
mbus_serial_select_secondary_SOURCES = mbus-serial-select-secondary.c
|
||||
|
||||
mbus_serial_scan_secondary_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_scan_secondary_LDADD = -lmbus
|
||||
mbus_serial_scan_secondary_SOURCES = mbus-serial-scan-secondary.c
|
||||
|
||||
mbus_serial_switch_baudrate_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_switch_baudrate_LDADD = -lmbus
|
||||
mbus_serial_switch_baudrate_SOURCES = mbus-serial-switch-baudrate.c
|
||||
|
671
bin/Makefile.in
Normal file
671
bin/Makefile.in
Normal file
@ -0,0 +1,671 @@
|
||||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
bin_PROGRAMS = mbus-tcp-scan$(EXEEXT) mbus-tcp-request-data$(EXEEXT) \
|
||||
mbus-tcp-request-data-multi-reply$(EXEEXT) \
|
||||
mbus-tcp-select-secondary$(EXEEXT) \
|
||||
mbus-tcp-scan-secondary$(EXEEXT) mbus-serial-scan$(EXEEXT) \
|
||||
mbus-serial-request-data$(EXEEXT) \
|
||||
mbus-serial-select-secondary$(EXEEXT) \
|
||||
mbus-serial-scan-secondary$(EXEEXT)
|
||||
subdir = bin
|
||||
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_mbus_serial_request_data_OBJECTS = \
|
||||
mbus-serial-request-data.$(OBJEXT)
|
||||
mbus_serial_request_data_OBJECTS = \
|
||||
$(am_mbus_serial_request_data_OBJECTS)
|
||||
mbus_serial_request_data_DEPENDENCIES =
|
||||
mbus_serial_request_data_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(mbus_serial_request_data_LDFLAGS) $(LDFLAGS) -o $@
|
||||
am_mbus_serial_scan_OBJECTS = mbus-serial-scan.$(OBJEXT)
|
||||
mbus_serial_scan_OBJECTS = $(am_mbus_serial_scan_OBJECTS)
|
||||
mbus_serial_scan_DEPENDENCIES =
|
||||
mbus_serial_scan_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(mbus_serial_scan_LDFLAGS) $(LDFLAGS) -o $@
|
||||
am_mbus_serial_scan_secondary_OBJECTS = \
|
||||
mbus-serial-scan-secondary.$(OBJEXT)
|
||||
mbus_serial_scan_secondary_OBJECTS = \
|
||||
$(am_mbus_serial_scan_secondary_OBJECTS)
|
||||
mbus_serial_scan_secondary_DEPENDENCIES =
|
||||
mbus_serial_scan_secondary_LINK = $(LIBTOOL) --tag=CC \
|
||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
||||
$(AM_CFLAGS) $(CFLAGS) $(mbus_serial_scan_secondary_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
am_mbus_serial_select_secondary_OBJECTS = \
|
||||
mbus-serial-select-secondary.$(OBJEXT)
|
||||
mbus_serial_select_secondary_OBJECTS = \
|
||||
$(am_mbus_serial_select_secondary_OBJECTS)
|
||||
mbus_serial_select_secondary_DEPENDENCIES =
|
||||
mbus_serial_select_secondary_LINK = $(LIBTOOL) --tag=CC \
|
||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
||||
$(AM_CFLAGS) $(CFLAGS) $(mbus_serial_select_secondary_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
am_mbus_tcp_request_data_OBJECTS = mbus-tcp-request-data.$(OBJEXT)
|
||||
mbus_tcp_request_data_OBJECTS = $(am_mbus_tcp_request_data_OBJECTS)
|
||||
mbus_tcp_request_data_DEPENDENCIES =
|
||||
mbus_tcp_request_data_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(mbus_tcp_request_data_LDFLAGS) $(LDFLAGS) -o $@
|
||||
am_mbus_tcp_request_data_multi_reply_OBJECTS = \
|
||||
mbus-tcp-request-data-multi-reply.$(OBJEXT)
|
||||
mbus_tcp_request_data_multi_reply_OBJECTS = \
|
||||
$(am_mbus_tcp_request_data_multi_reply_OBJECTS)
|
||||
mbus_tcp_request_data_multi_reply_DEPENDENCIES =
|
||||
mbus_tcp_request_data_multi_reply_LINK = $(LIBTOOL) --tag=CC \
|
||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
||||
$(AM_CFLAGS) $(CFLAGS) \
|
||||
$(mbus_tcp_request_data_multi_reply_LDFLAGS) $(LDFLAGS) -o $@
|
||||
am_mbus_tcp_scan_OBJECTS = mbus-tcp-scan.$(OBJEXT)
|
||||
mbus_tcp_scan_OBJECTS = $(am_mbus_tcp_scan_OBJECTS)
|
||||
mbus_tcp_scan_DEPENDENCIES =
|
||||
mbus_tcp_scan_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(mbus_tcp_scan_LDFLAGS) $(LDFLAGS) -o $@
|
||||
am_mbus_tcp_scan_secondary_OBJECTS = \
|
||||
mbus-tcp-scan-secondary.$(OBJEXT)
|
||||
mbus_tcp_scan_secondary_OBJECTS = \
|
||||
$(am_mbus_tcp_scan_secondary_OBJECTS)
|
||||
mbus_tcp_scan_secondary_DEPENDENCIES =
|
||||
mbus_tcp_scan_secondary_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(mbus_tcp_scan_secondary_LDFLAGS) $(LDFLAGS) -o $@
|
||||
am_mbus_tcp_select_secondary_OBJECTS = \
|
||||
mbus-tcp-select-secondary.$(OBJEXT)
|
||||
mbus_tcp_select_secondary_OBJECTS = \
|
||||
$(am_mbus_tcp_select_secondary_OBJECTS)
|
||||
mbus_tcp_select_secondary_DEPENDENCIES =
|
||||
mbus_tcp_select_secondary_LINK = $(LIBTOOL) --tag=CC \
|
||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
||||
$(AM_CFLAGS) $(CFLAGS) $(mbus_tcp_select_secondary_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(mbus_serial_request_data_SOURCES) \
|
||||
$(mbus_serial_scan_SOURCES) \
|
||||
$(mbus_serial_scan_secondary_SOURCES) \
|
||||
$(mbus_serial_select_secondary_SOURCES) \
|
||||
$(mbus_tcp_request_data_SOURCES) \
|
||||
$(mbus_tcp_request_data_multi_reply_SOURCES) \
|
||||
$(mbus_tcp_scan_SOURCES) $(mbus_tcp_scan_secondary_SOURCES) \
|
||||
$(mbus_tcp_select_secondary_SOURCES)
|
||||
DIST_SOURCES = $(mbus_serial_request_data_SOURCES) \
|
||||
$(mbus_serial_scan_SOURCES) \
|
||||
$(mbus_serial_scan_secondary_SOURCES) \
|
||||
$(mbus_serial_select_secondary_SOURCES) \
|
||||
$(mbus_tcp_request_data_SOURCES) \
|
||||
$(mbus_tcp_request_data_multi_reply_SOURCES) \
|
||||
$(mbus_tcp_scan_SOURCES) $(mbus_tcp_scan_secondary_SOURCES) \
|
||||
$(mbus_tcp_select_secondary_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (C) 2010, Raditex AB
|
||||
# All rights reserved.
|
||||
#
|
||||
# rSCADA
|
||||
# http://www.rSCADA.se
|
||||
# info@rscada.se
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/src
|
||||
noinst_HEADERS =
|
||||
|
||||
# tcp
|
||||
mbus_tcp_scan_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_scan_LDADD = -lmbus
|
||||
mbus_tcp_scan_SOURCES = mbus-tcp-scan.c
|
||||
mbus_tcp_request_data_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_request_data_LDADD = -lmbus
|
||||
mbus_tcp_request_data_SOURCES = mbus-tcp-request-data.c
|
||||
mbus_tcp_request_data_multi_reply_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_request_data_multi_reply_LDADD = -lmbus
|
||||
mbus_tcp_request_data_multi_reply_SOURCES = mbus-tcp-request-data-multi-reply.c
|
||||
mbus_tcp_select_secondary_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_select_secondary_LDADD = -lmbus
|
||||
mbus_tcp_select_secondary_SOURCES = mbus-tcp-select-secondary.c
|
||||
mbus_tcp_scan_secondary_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_tcp_scan_secondary_LDADD = -lmbus
|
||||
mbus_tcp_scan_secondary_SOURCES = mbus-tcp-scan-secondary.c
|
||||
|
||||
# serial
|
||||
mbus_serial_scan_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_scan_LDADD = -lmbus
|
||||
mbus_serial_scan_SOURCES = mbus-serial-scan.c
|
||||
mbus_serial_request_data_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_request_data_LDADD = -lmbus
|
||||
mbus_serial_request_data_SOURCES = mbus-serial-request-data.c
|
||||
mbus_serial_select_secondary_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_select_secondary_LDADD = -lmbus
|
||||
mbus_serial_select_secondary_SOURCES = mbus-serial-select-secondary.c
|
||||
mbus_serial_scan_secondary_LDFLAGS = -L$(top_builddir)/mbus
|
||||
mbus_serial_scan_secondary_LDADD = -lmbus
|
||||
mbus_serial_scan_secondary_SOURCES = mbus-serial-scan-secondary.c
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign bin/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed 's/$(EXEEXT)$$//' | \
|
||||
while read p p1; do if test -f $$p || test -f $$p1; \
|
||||
then echo "$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
|
||||
sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) files[d] = files[d] " " $$1; \
|
||||
else { print "f", $$3 "/" $$4, $$1; } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
||||
-e 's/$$/$(EXEEXT)/' `; \
|
||||
test -n "$$list" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(bindir)" && rm -f $$files
|
||||
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
mbus-serial-request-data$(EXEEXT): $(mbus_serial_request_data_OBJECTS) $(mbus_serial_request_data_DEPENDENCIES)
|
||||
@rm -f mbus-serial-request-data$(EXEEXT)
|
||||
$(mbus_serial_request_data_LINK) $(mbus_serial_request_data_OBJECTS) $(mbus_serial_request_data_LDADD) $(LIBS)
|
||||
mbus-serial-scan$(EXEEXT): $(mbus_serial_scan_OBJECTS) $(mbus_serial_scan_DEPENDENCIES)
|
||||
@rm -f mbus-serial-scan$(EXEEXT)
|
||||
$(mbus_serial_scan_LINK) $(mbus_serial_scan_OBJECTS) $(mbus_serial_scan_LDADD) $(LIBS)
|
||||
mbus-serial-scan-secondary$(EXEEXT): $(mbus_serial_scan_secondary_OBJECTS) $(mbus_serial_scan_secondary_DEPENDENCIES)
|
||||
@rm -f mbus-serial-scan-secondary$(EXEEXT)
|
||||
$(mbus_serial_scan_secondary_LINK) $(mbus_serial_scan_secondary_OBJECTS) $(mbus_serial_scan_secondary_LDADD) $(LIBS)
|
||||
mbus-serial-select-secondary$(EXEEXT): $(mbus_serial_select_secondary_OBJECTS) $(mbus_serial_select_secondary_DEPENDENCIES)
|
||||
@rm -f mbus-serial-select-secondary$(EXEEXT)
|
||||
$(mbus_serial_select_secondary_LINK) $(mbus_serial_select_secondary_OBJECTS) $(mbus_serial_select_secondary_LDADD) $(LIBS)
|
||||
mbus-tcp-request-data$(EXEEXT): $(mbus_tcp_request_data_OBJECTS) $(mbus_tcp_request_data_DEPENDENCIES)
|
||||
@rm -f mbus-tcp-request-data$(EXEEXT)
|
||||
$(mbus_tcp_request_data_LINK) $(mbus_tcp_request_data_OBJECTS) $(mbus_tcp_request_data_LDADD) $(LIBS)
|
||||
mbus-tcp-request-data-multi-reply$(EXEEXT): $(mbus_tcp_request_data_multi_reply_OBJECTS) $(mbus_tcp_request_data_multi_reply_DEPENDENCIES)
|
||||
@rm -f mbus-tcp-request-data-multi-reply$(EXEEXT)
|
||||
$(mbus_tcp_request_data_multi_reply_LINK) $(mbus_tcp_request_data_multi_reply_OBJECTS) $(mbus_tcp_request_data_multi_reply_LDADD) $(LIBS)
|
||||
mbus-tcp-scan$(EXEEXT): $(mbus_tcp_scan_OBJECTS) $(mbus_tcp_scan_DEPENDENCIES)
|
||||
@rm -f mbus-tcp-scan$(EXEEXT)
|
||||
$(mbus_tcp_scan_LINK) $(mbus_tcp_scan_OBJECTS) $(mbus_tcp_scan_LDADD) $(LIBS)
|
||||
mbus-tcp-scan-secondary$(EXEEXT): $(mbus_tcp_scan_secondary_OBJECTS) $(mbus_tcp_scan_secondary_DEPENDENCIES)
|
||||
@rm -f mbus-tcp-scan-secondary$(EXEEXT)
|
||||
$(mbus_tcp_scan_secondary_LINK) $(mbus_tcp_scan_secondary_OBJECTS) $(mbus_tcp_scan_secondary_LDADD) $(LIBS)
|
||||
mbus-tcp-select-secondary$(EXEEXT): $(mbus_tcp_select_secondary_OBJECTS) $(mbus_tcp_select_secondary_DEPENDENCIES)
|
||||
@rm -f mbus-tcp-select-secondary$(EXEEXT)
|
||||
$(mbus_tcp_select_secondary_LINK) $(mbus_tcp_select_secondary_OBJECTS) $(mbus_tcp_select_secondary_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-serial-request-data.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-serial-scan-secondary.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-serial-scan.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-serial-select-secondary.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-tcp-request-data-multi-reply.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-tcp-request-data.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-tcp-scan-secondary.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-tcp-scan.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbus-tcp-select-secondary.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-binPROGRAMS install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
||||
uninstall-binPROGRAMS
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
156
bin/mbus-serial-request-data.c
Normal file
156
bin/mbus-serial-request-data.c
Normal file
@ -0,0 +1,156 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
static int debug = 0;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Scan for devices using secondary addressing.
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mbus_frame reply;
|
||||
mbus_frame_data reply_data;
|
||||
mbus_handle *handle = NULL;
|
||||
|
||||
char *device, *addr_str, matching_addr[16];
|
||||
int address, baudrate = 9600;
|
||||
|
||||
if (argc == 3)
|
||||
{
|
||||
device = argv[1];
|
||||
addr_str = argv[2];
|
||||
}
|
||||
else if (argc == 4 && strcmp(argv[1], "-d") == 0)
|
||||
{
|
||||
device = argv[2];
|
||||
addr_str = argv[3];
|
||||
debug = 1;
|
||||
}
|
||||
else if (argc == 5 && strcmp(argv[1], "-b") == 0)
|
||||
{
|
||||
baudrate = atoi(argv[2]);
|
||||
device = argv[3];
|
||||
addr_str = argv[4];
|
||||
}
|
||||
else if (argc == 6 && strcmp(argv[1], "-d") == 0 && strcmp(argv[2], "-b") == 0)
|
||||
{
|
||||
baudrate = atoi(argv[3]);
|
||||
device = argv[4];
|
||||
addr_str = argv[5];
|
||||
debug = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-d] [-b BAUDRATE] device mbus-address\n", argv[0]);
|
||||
fprintf(stderr, " optional flag -d for debug printout\n");
|
||||
fprintf(stderr, " optional flag -b for selecting baudrate\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_serial(device)) == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
|
||||
{
|
||||
printf("Failed to set baud rate.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (strlen(addr_str) == 16)
|
||||
{
|
||||
// secondary addressing
|
||||
|
||||
int probe_ret;
|
||||
|
||||
probe_ret = mbus_probe_secondary_address(handle, addr_str, matching_addr);
|
||||
|
||||
if (probe_ret == MBUS_PROBE_COLLISION)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: The address mask [%s] matches more than one device.\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
else if (probe_ret == MBUS_PROBE_NOTHING)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: The selected secondary address does not match any device [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
else if (probe_ret == MBUS_PROBE_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: Failed to probe secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send M-Bus request frame.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// primary addressing
|
||||
|
||||
address = atoi(addr_str);
|
||||
if (mbus_send_request_frame(handle, address) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send M-Bus request frame.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (mbus_recv_frame(handle, &reply) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to receive M-Bus response frame.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
//
|
||||
// parse data and print in XML format
|
||||
//
|
||||
if (debug)
|
||||
{
|
||||
mbus_frame_print(&reply);
|
||||
}
|
||||
|
||||
if (mbus_frame_data_parse(&reply, &reply_data) == -1)
|
||||
{
|
||||
fprintf(stderr, "M-bus data parse error.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("%s", mbus_frame_data_xml(&reply_data));
|
||||
|
||||
// manual free
|
||||
if (reply_data.data_var.record)
|
||||
{
|
||||
mbus_data_record_free(reply_data.data_var.record); // free's up the whole list
|
||||
}
|
||||
|
||||
mbus_disconnect(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
88
bin/mbus-serial-scan-secondary.c
Normal file
88
bin/mbus-serial-scan-secondary.c
Normal file
@ -0,0 +1,88 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Scan for devices using secondary addressing.
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char *device, *addr_mask;
|
||||
int baudrate = 9600;
|
||||
mbus_handle *handle = NULL;
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
device = argv[1];
|
||||
addr_mask = strdup("FFFFFFFFFFFFFFFF");
|
||||
}
|
||||
else if (argc == 3)
|
||||
{
|
||||
device = argv[1];
|
||||
addr_mask = strdup(argv[2]);
|
||||
}
|
||||
else if (argc == 4 && strcmp(argv[1], "-b") == 0)
|
||||
{
|
||||
baudrate = atoi(argv[2]);
|
||||
device = argv[3];
|
||||
addr_mask = strdup("FFFFFFFFFFFFFFFF");
|
||||
}
|
||||
else if (argc == 5 && strcmp(argv[1], "-b") == 0)
|
||||
{
|
||||
baudrate = atoi(argv[2]);
|
||||
device = argv[3];
|
||||
addr_mask = strdup(argv[4]);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-b BAUDRATE] device [address-mask]\n", argv[0]);
|
||||
fprintf(stderr, "\trestrict the search by supplying an optional address mask on the form\n");
|
||||
fprintf(stderr, "\t'FFFFFFFFFFFFFFFF' where F is a wildcard character\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strlen(addr_mask) != 16)
|
||||
{
|
||||
fprintf(stderr, "Misformatted secondary address mask. Must be 16 character HEX number.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_serial(device)) == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to setup connection to M-bus gateway: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
|
||||
{
|
||||
printf("Failed to set baud rate.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
mbus_scan_2nd_address_range(handle, 0, addr_mask);
|
||||
|
||||
mbus_disconnect(handle);
|
||||
|
||||
//printf("Summary: Tried %ld address masks and found %d devices.\n", probe_count, match_count);
|
||||
|
||||
free(addr_mask);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
84
bin/mbus-serial-scan.c
Normal file
84
bin/mbus-serial-scan.c
Normal file
@ -0,0 +1,84 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Primary addressing scanning of mbus devices.
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mbus_handle *handle;
|
||||
char *device;
|
||||
int address, baudrate = 9600;
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
device = argv[1];
|
||||
}
|
||||
else if (argc == 4 && strcmp(argv[1], "-b") == 0)
|
||||
{
|
||||
baudrate = atoi(argv[2]);
|
||||
device = argv[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-b BAUDRATE] device\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_serial(device)) == NULL)
|
||||
{
|
||||
printf("Failed to setup connection to M-bus gateway\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
|
||||
{
|
||||
printf("Failed to set baud rate.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
for (address = 0; address < 254; address++)
|
||||
{
|
||||
mbus_frame reply;
|
||||
|
||||
memset((void *)&reply, 0, sizeof(mbus_frame));
|
||||
|
||||
if (mbus_send_ping_frame(handle, address) == -1)
|
||||
{
|
||||
printf("Scan failed. Could not send ping frame: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_recv_frame(handle, &reply) == -1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
printf("Found a M-Bus device at address %d\n", address);
|
||||
}
|
||||
}
|
||||
|
||||
mbus_disconnect(handle);
|
||||
return 0;
|
||||
}
|
||||
|
117
bin/mbus-serial-select-secondary.c
Normal file
117
bin/mbus-serial-select-secondary.c
Normal file
@ -0,0 +1,117 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Execution starts here:
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mbus_handle *handle;
|
||||
mbus_frame reply;
|
||||
char *device, *addr;
|
||||
int ret, baudrate = 9600;
|
||||
|
||||
if (argc == 3)
|
||||
{
|
||||
device = argv[1];
|
||||
addr = strdup(argv[2]);
|
||||
}
|
||||
else if (argc == 5 && strcmp(argv[1], "-b") == 0)
|
||||
{
|
||||
baudrate = atoi(argv[2]);
|
||||
device = argv[3];
|
||||
addr = strdup(argv[4]);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "usage: %s device secondary-mbus-address\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strlen(addr) != 16)
|
||||
{
|
||||
printf("Misformatted secondary address. Must be 16 character HEX number.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_serial(device)) == NULL)
|
||||
{
|
||||
printf("Failed to setup connection to M-bus device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
|
||||
{
|
||||
printf("Failed to set baud rate.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_send_select_frame(handle, addr) == -1)
|
||||
{
|
||||
printf("Failed to send selection frame: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = mbus_recv_frame(handle, &reply);
|
||||
|
||||
if (ret == -1)
|
||||
{
|
||||
printf("No reply from device with secondary address %s: %s\n", argv[2], mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ret == -2)
|
||||
{
|
||||
printf("Invalid reply from %s: The address address probably match more than one device: %s\n", argv[2], mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
{
|
||||
printf("Failed to send request to selected secondary device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_recv_frame(handle, &reply) == -1)
|
||||
{
|
||||
printf("Failed to recieve reply from selected secondary device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_frame_type(&reply) != MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
printf("Recieved a reply from secondarily addressed device: Searched for [%s] and found [%s].\n",
|
||||
argv[2], mbus_frame_get_secondary_address(&reply));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unknown reply:\n");
|
||||
mbus_frame_print(&reply);
|
||||
}
|
||||
|
||||
free(addr);
|
||||
mbus_disconnect(handle);
|
||||
return 0;
|
||||
}
|
||||
|
90
bin/mbus-serial-switch-baudrate.c
Normal file
90
bin/mbus-serial-switch-baudrate.c
Normal file
@ -0,0 +1,90 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2010-2012, Robert Johansson and contributors, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
// Contributors:
|
||||
// Large parts of this file was contributed by Stefan Wahren.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Execution starts here:
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mbus_handle *handle;
|
||||
mbus_frame reply;
|
||||
char *device;
|
||||
int address, ret;
|
||||
int source_baudrate = 9600, target_baudrate;
|
||||
|
||||
if (argc == 4)
|
||||
{
|
||||
device = argv[1];
|
||||
address = atoi(argv[2]);
|
||||
target_baudrate = atoi(argv[3]);
|
||||
}
|
||||
else if (argc == 6 && strcmp(argv[1], "-b") == 0)
|
||||
{
|
||||
source_baudrate = atoi(argv[2]);
|
||||
device = argv[3];
|
||||
address = atoi(argv[4]);
|
||||
target_baudrate = atoi(argv[5]);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "usage: %s device address target-baudrate\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_serial(device)) == NULL)
|
||||
{
|
||||
printf("Failed to setup connection to M-bus device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_serial_set_baudrate(handle->m_serial_handle, source_baudrate) == -1)
|
||||
{
|
||||
printf("Failed to set baud rate.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_send_switch_baudrate_frame(handle, address, target_baudrate) == -1)
|
||||
{
|
||||
printf("Failed to send switch baudrate frame: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = mbus_recv_frame(handle, &reply);
|
||||
|
||||
if (ret == -1)
|
||||
{
|
||||
printf("No reply from device\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_frame_type(&reply) != MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
printf("Unknown reply:\n");
|
||||
mbus_frame_print(&reply);
|
||||
}
|
||||
|
||||
mbus_disconnect(handle);
|
||||
return 0;
|
||||
}
|
||||
|
139
bin/mbus-tcp-request-data-multi-reply.c
Normal file
139
bin/mbus-tcp-request-data-multi-reply.c
Normal file
@ -0,0 +1,139 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
static int debug = 0;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Execution starts here:
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mbus_frame reply, *reply_iter;
|
||||
mbus_frame_data reply_data;
|
||||
mbus_handle *handle = NULL;
|
||||
|
||||
char *host, *addr_str, matching_addr[16];
|
||||
int port, address;
|
||||
|
||||
memset((void *)&reply, 0, sizeof(mbus_frame));
|
||||
memset((void *)&reply_data, 0, sizeof(mbus_frame_data));
|
||||
|
||||
if (argc == 4)
|
||||
{
|
||||
host = argv[1];
|
||||
port = atoi(argv[2]);
|
||||
addr_str = argv[3];
|
||||
debug = 0;
|
||||
}
|
||||
else if (argc == 5 && strcmp(argv[1], "-d") == 0)
|
||||
{
|
||||
host = argv[2];
|
||||
port = atoi(argv[3]);
|
||||
addr_str = argv[4];
|
||||
debug = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-d] host port mbus-address\n", argv[0]);
|
||||
fprintf(stderr, " optional flag -d for debug printout\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_tcp(host, port)) == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strlen(addr_str) == 16)
|
||||
{
|
||||
// secondary addressing
|
||||
|
||||
int probe_ret;
|
||||
|
||||
probe_ret = mbus_probe_secondary_address(handle, addr_str, matching_addr);
|
||||
|
||||
if (probe_ret == MBUS_PROBE_COLLISION)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: The address mask [%s] matches more than one device.\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
else if (probe_ret == MBUS_PROBE_NOTHING)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: The selected secondary address does not match any device [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
else if (probe_ret == MBUS_PROBE_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: Failed to probe secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
address = 253;
|
||||
}
|
||||
else
|
||||
{
|
||||
// primary addressing
|
||||
address = atoi(addr_str);
|
||||
}
|
||||
|
||||
// instead of the send and recv, use this sendrecv function that
|
||||
// takes care of the possibility of multi-telegram replies (limit = 16 frames)
|
||||
if (mbus_sendrecv_request(handle, address, &reply, 16) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send/receive M-Bus request.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
//
|
||||
// dump hex data if debug is true
|
||||
//
|
||||
if (debug)
|
||||
{
|
||||
mbus_frame_print(&reply);
|
||||
}
|
||||
|
||||
//
|
||||
// here, figure out how the list of frames should be merged into a single
|
||||
// XML document, but for now let's just dump all frames as independent XMLs
|
||||
//
|
||||
for (reply_iter = &reply; reply_iter; reply_iter = reply_iter->next)
|
||||
{
|
||||
if (mbus_frame_data_parse(reply_iter, &reply_data) == -1)
|
||||
{
|
||||
fprintf(stderr, "M-bus data parse error.\n");
|
||||
return 1;
|
||||
}
|
||||
printf("%s", mbus_frame_data_xml(&reply_data));
|
||||
|
||||
// manual free, all records in the list
|
||||
if (reply_data.data_var.record)
|
||||
{
|
||||
mbus_data_record_free(reply_data.data_var.record);
|
||||
}
|
||||
}
|
||||
|
||||
mbus_disconnect(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
140
bin/mbus-tcp-request-data.c
Normal file
140
bin/mbus-tcp-request-data.c
Normal file
@ -0,0 +1,140 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
static int debug = 0;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Execution starts here:
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mbus_frame reply;
|
||||
mbus_frame_data reply_data;
|
||||
mbus_handle *handle = NULL;
|
||||
|
||||
char *host, *addr_str, matching_addr[16];
|
||||
int port, address;
|
||||
|
||||
memset((void *)&reply, 0, sizeof(mbus_frame));
|
||||
memset((void *)&reply_data, 0, sizeof(mbus_frame_data));
|
||||
|
||||
if (argc == 4)
|
||||
{
|
||||
host = argv[1];
|
||||
port = atoi(argv[2]);
|
||||
addr_str = argv[3];
|
||||
debug = 0;
|
||||
}
|
||||
else if (argc == 5 && strcmp(argv[1], "-d") == 0)
|
||||
{
|
||||
host = argv[2];
|
||||
port = atoi(argv[3]);
|
||||
addr_str = argv[4];
|
||||
debug = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-d] host port mbus-address\n", argv[0]);
|
||||
fprintf(stderr, " optional flag -d for debug printout\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_tcp(host, port)) == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strlen(addr_str) == 16)
|
||||
{
|
||||
// secondary addressing
|
||||
|
||||
int probe_ret;
|
||||
|
||||
probe_ret = mbus_probe_secondary_address(handle, addr_str, matching_addr);
|
||||
|
||||
if (probe_ret == MBUS_PROBE_COLLISION)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: The address mask [%s] matches more than one device.\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
else if (probe_ret == MBUS_PROBE_NOTHING)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: The selected secondary address does not match any device [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
else if (probe_ret == MBUS_PROBE_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: Failed to probe secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send M-Bus request frame.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// primary addressing
|
||||
|
||||
address = atoi(addr_str);
|
||||
if (mbus_send_request_frame(handle, address) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send M-Bus request frame.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (mbus_recv_frame(handle, &reply) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to receive M-Bus response frame.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
//
|
||||
// parse data and print in XML format
|
||||
//
|
||||
if (debug)
|
||||
{
|
||||
mbus_frame_print(&reply);
|
||||
}
|
||||
|
||||
if (mbus_frame_data_parse(&reply, &reply_data) == -1)
|
||||
{
|
||||
fprintf(stderr, "M-bus data parse error.\n");
|
||||
return 1;
|
||||
}
|
||||
printf("%s", mbus_frame_data_xml(&reply_data));
|
||||
|
||||
// manual free
|
||||
if (reply_data.data_var.record)
|
||||
{
|
||||
mbus_data_record_free(reply_data.data_var.record); // free's up the whole list
|
||||
}
|
||||
|
||||
mbus_disconnect(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
73
bin/mbus-tcp-scan-secondary.c
Normal file
73
bin/mbus-tcp-scan-secondary.c
Normal file
@ -0,0 +1,73 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
static mbus_handle *handle = NULL;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Execution starts here:
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char *host, *addr_mask;
|
||||
int port;
|
||||
|
||||
if (argc != 4 && argc != 3)
|
||||
{
|
||||
fprintf(stderr, "usage: %s host port [address-mask]\n", argv[0]);
|
||||
fprintf(stderr, "\trestrict the search by supplying an optional address mask on the form\n");
|
||||
fprintf(stderr, "\t'FFFFFFFFFFFFFFFF' where F is a wildcard character\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
host = argv[1];
|
||||
port = atoi(argv[2]);
|
||||
if (argc == 4)
|
||||
{
|
||||
addr_mask = strdup(argv[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
addr_mask = strdup("FFFFFFFFFFFFFFFF");
|
||||
}
|
||||
|
||||
if (strlen(addr_mask) != 16)
|
||||
{
|
||||
fprintf(stderr, "Misformatted secondary address mask. Must be 16 character HEX number.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_tcp(host, port)) == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to setup connection to M-bus gateway: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
mbus_scan_2nd_address_range(handle, 0, addr_mask);
|
||||
|
||||
mbus_disconnect(handle);
|
||||
|
||||
//printf("Summary: Tried %ld address masks and found %d devices.\n", probe_count, match_count);
|
||||
|
||||
free(addr_mask);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
70
bin/mbus-tcp-scan.c
Normal file
70
bin/mbus-tcp-scan.c
Normal file
@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Execution starts here:
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mbus_handle *handle;
|
||||
char *host;
|
||||
int port, address;
|
||||
|
||||
if (argc != 3)
|
||||
{
|
||||
printf("usage: %s host port\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
host = argv[1];
|
||||
port = atoi(argv[2]);
|
||||
|
||||
if ((handle = mbus_connect_tcp(host, port)) == NULL)
|
||||
{
|
||||
printf("Scan failed: Could not setup connection to M-bus gateway: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (address = 0; address < 254; address++)
|
||||
{
|
||||
mbus_frame reply;
|
||||
|
||||
if (mbus_send_ping_frame(handle, address) == -1)
|
||||
{
|
||||
printf("Scan failed. Could not send ping frame: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_recv_frame(handle, &reply) == -1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
printf("Found a M-Bus device at address %d\n", address);
|
||||
}
|
||||
}
|
||||
|
||||
mbus_disconnect(handle);
|
||||
return 0;
|
||||
}
|
||||
|
104
bin/mbus-tcp-select-secondary.c
Normal file
104
bin/mbus-tcp-select-secondary.c
Normal file
@ -0,0 +1,104 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (C) 2011, Robert Johansson, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mbus/mbus.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Execution starts here:
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mbus_handle *handle;
|
||||
mbus_frame reply;
|
||||
char *host, *addr;
|
||||
int port, ret;
|
||||
|
||||
if (argc != 4)
|
||||
{
|
||||
printf("usage: %s host port secondary-mbus-address\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
host = argv[1];
|
||||
port = atoi(argv[2]);
|
||||
addr = strdup(argv[3]);
|
||||
|
||||
if (strlen(argv[3]) != 16)
|
||||
{
|
||||
printf("Misformatted secondary address. Must be 16 character HEX number.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((handle = mbus_connect_tcp(host, port)) == NULL)
|
||||
{
|
||||
printf("Failed to setup connection to M-bus gateway: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_send_select_frame(handle, addr) == -1)
|
||||
{
|
||||
printf("Failed to send selection frame: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = mbus_recv_frame(handle, &reply);
|
||||
|
||||
if (ret == -1)
|
||||
{
|
||||
printf("No reply from device with secondary address %s: %s\n", argv[3], mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ret == -2)
|
||||
{
|
||||
printf("Invalid reply from %s: The address address probably match more than one device: %s\n", argv[3], mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
{
|
||||
printf("Failed to send request to selected secondary device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_recv_frame(handle, &reply) == -1)
|
||||
{
|
||||
printf("Failed to recieve reply from selected secondary device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mbus_frame_type(&reply) != MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
printf("Recieved a reply from secondarily addressed device: Searched for [%s] and found [%s].\n",
|
||||
argv[3], mbus_frame_get_secondary_address(&reply));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unknown reply:\n");
|
||||
mbus_frame_print(&reply);
|
||||
}
|
||||
|
||||
free(addr);
|
||||
mbus_disconnect(handle);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user