240 Commits

Author SHA1 Message Date
61f6942448 Fix Frame Count Bit handling
Extend mbus_send_request_frame() to set FCB
Set FCB in case of primary adressing
2015-06-27 12:55:12 +02:00
716d712314 Merge pull request #74 from schnurksel/hex_dump
Hex dump
2015-04-11 12:36:03 +02:00
90bb12f9b0 Merge pull request #72 from schnurksel/beautify_tabs_spaces
Beautify tabs and spaces
2015-04-11 12:35:45 +02:00
1bc9f72c27 Merge pull request #71 from schnurksel/add_meter_strings
Add meter strings
2015-04-11 11:57:16 +02:00
576cefe80a Merge pull request #70 from schnurksel/add_codepage_to_xml_output
add codepage to XML output
2015-04-11 11:55:41 +02:00
53d66c3dd5 Merge pull request #79 from mhei/master
Add hint file for Travis CI
2015-03-07 17:52:06 +09:00
2dea1b99f3 Add hint file for Travis CI
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2015-01-25 11:28:28 +01:00
00d0fc0aaf add hex dump for regression tests as requested by lategoodbye 2014-03-13 13:33:28 +01:00
5f0b5d5dd1 Beautify: replace tabs with spaces and remove trailing spaces 2014-02-24 15:20:42 +01:00
f47caf151e add manufacturer id / product string of some meters:
Aquametro CALEC MB
Aquametro CALEC ST
Elster SensoStar 2
Elster F96 Plus
Elster F4
EMU Professional 3/75 M-Bus
Deltamess F2
Sensus PolluTherm
Sensus PolluStat E
NZR IC-M2
Saia-Burgess ALE3
Saia-Burgess AWD3
2014-02-24 11:22:40 +01:00
781736fe4c add codepage to XML output 2014-02-24 11:02:26 +01:00
57fceeb09a Merge pull request #69 from schnurksel/fix_storage_unit_tariff_calculation
bugfix storage/device/tariff caculation
2014-02-22 12:49:41 +09:00
8197874fe7 bugfix, the functions
mbus_data_record_storage_number()
  mbus_data_record_tariff()
  mbus_data_record_device()
did return bogus random values, because of uninitialized variables
2014-02-20 11:26:31 +01:00
3062c797a9 Merge pull request #66 from mhei/fixes
gitignore: add mbus-tcp-application-reset
2014-02-06 23:34:05 +09:00
9e81912a20 Merge pull request #65 from mhei/manufacturer-id
Add a function to calculate the manufacturer ID from the 3 byte ASCII
2014-02-06 23:33:47 +09:00
f262138572 mbus_manufacturer_id: add error checking code
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2014-01-18 20:43:57 +01:00
0fccc0e337 Add a function to calculate the manufacturer ID from the 3 byte ASCII
code. The formula can be found at http://www.m-bus.com/files/w4b21021.pdf,
chapter 3.3 at page 6.

This obsoletes the static defines, so remove them.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2014-01-18 13:44:01 +01:00
6abc6cd15d gitignore: add mbus-tcp-application-reset
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2014-01-18 13:23:33 +01:00
0102dc6ae5 Merge pull request #64 from lategoodbye/master
Fix decoding and 2nd address search
2013-11-12 05:36:49 -08:00
a32e325979 Update XML files because of storage number, tariff and
device
2013-11-07 12:06:09 +01:00
f42c56f19c fix 2nd address scanning bug, add some comments
code merge from arska/libmbus without debug
2013-11-07 11:14:15 +01:00
0d9f83ba88 Extend XML output with storage number, tariff and device 2013-11-07 00:32:01 +01:00
e1ca652bf0 Extend mbus_record with storage number, tariff and device 2013-11-07 00:31:03 +01:00
58778ba9bc Add functions to decode storage number, tariff and device from DIF 2013-11-07 00:24:11 +01:00
d79cb1c998 Fix BCD decoding bug 2013-11-07 00:13:56 +01:00
e9d39d4708 Extend DIF debug output (storage number LSB)
Fix DIFE debug output (storage number, tariff, device unit)
Fix typos in comments
Replace magic bit masks with defines
2013-11-06 11:11:43 +01:00
3aa81cfb23 Add DIF extension bit masks 2013-11-06 10:15:15 +01:00
7f00f72b69 Add missing VIF=7Eh / FEh 2013-11-01 17:17:57 +01:00
6021f3cc65 Fix VIF extension mappings for VIF=0FBh 2013-11-01 17:13:49 +01:00
887d6a2914 Add test frame for GMC EMMOD 206 2013-10-31 23:05:39 +01:00
4b82502c06 Add product name mapping for GMC-I EMMOD206 2013-10-31 23:01:06 +01:00
9d84318631 Add manufacturer ID for GMC 2013-10-31 22:59:59 +01:00
6ffa521473 Update XML after fixing bug with signed integer 2013-10-31 22:27:48 +01:00
6afe7a10dc fix wrong decoding of integer / type B (now handle signedness correctly)
separate result code und decoded value for integer decoding (new
parameter)
refactor variable names
2013-10-31 22:25:34 +01:00
663642b7ec Adopt retransmission for secondary address probing 2013-10-19 13:56:58 +02:00
e6173103e2 Avoid unnecessary data request in mbus_read_slave 2013-10-19 13:43:00 +02:00
b674dfcf24 Use new retransmission option and handle member 2013-10-19 11:44:37 +02:00
31016929bc Seperate retransmission maximum in two parameters
one for data requests and another for search requests
- add new handle member for max search retransmission
- set default maximum for search retransmission to one
- rename define for retransmission option
2013-10-18 20:15:53 +02:00
7ca329ee40 Add product name mapping for Rossweiner Modularis 2013-10-18 17:32:22 +02:00
fc8392de91 Merge remote-tracking branch 'upstream/master' 2013-10-17 15:55:57 +02:00
d54b594696 Sync behavior to mbus-serial-request-data-multi-reply
- init slaves before requesting data
- free ressources before exit
- refactor data request
- fix comments
2013-10-17 14:17:57 +02:00
28b73bf9d8 Add manufacturer ID for Rossweiner 2013-10-17 13:45:45 +02:00
ef0f05c460 Merge pull request #60 from lategoodbye/master
Improve event handling and support to send user data
2013-10-15 09:37:35 -07:00
c2a3f4b871 Fix event handling after moving callbacks to mbus handle 2013-10-13 21:56:15 +02:00
0cf57bfc35 Move event handling from global variable to handle
- remove global event function pointer
- add event function pointer to handle structure
- add handle parameter to register functions
- move all register functions to mbus-protocol-aux.c
2013-10-13 21:49:40 +02:00
9e23818152 Add new function to send a user data packet from master to slave 2013-10-13 14:52:45 +02:00
d5f06ec910 Replace magic number for M-Bus frame data length with define 2013-10-05 10:38:07 +02:00
3e24215e51 Merge pull request #59 from lategoodbye/master
Remove trailing whitespace
2013-10-02 06:58:45 -07:00
55d4c0fba2 Remove trailing whitespace
Signed-off-by: Stefan Wahren <info@lategoodbye.de>
2013-09-13 17:53:33 +02:00
654905a94d bug fix in timeout config 2013-08-30 00:20:35 +09:00
fd5c9adffb made it possible to configure the TCP read timeout parameter 2013-08-30 00:05:22 +09:00
84ffacadff Merge pull request #57 from lategoodbye/master
New option for normalized output, new test frames, unit fix
2013-08-03 19:35:59 -07:00
d9dd055bea Fix mbus_vib_unit_lookup
remove unreachable code
add missing unit password
fix typo

Signed-off-by: Stefan Wahren <info@lategoodbye.de>
2013-08-03 16:35:09 +02:00
c8aaa8dc32 Add new test frames from Elster Falcon and Relay Padpuls
Signed-off-by: Stefan Wahren <info@lategoodbye.de>
2013-08-03 16:23:20 +02:00
fb84fd11a8 Add additional check if directory is empty or hex file doesn't exists 2013-08-03 15:51:34 +02:00
55c2bf0dee Add normalized values option -n
Add file pointer check after fread
2013-07-17 22:21:07 +02:00
8f61edc85d remove the CUnit based unit test, since it does not work well (does not show which test that is failing...). instead we can use Stefan's nice generate-xml.sh which show exactly which test frames fails and the diff. 2013-07-05 00:12:38 +09:00
87cadafea0 updated XML files for test frames 2013-07-05 00:07:03 +09:00
5160a10211 fixed warning 2013-07-04 23:59:41 +09:00
b1473adc46 fixed warning 2013-07-04 23:49:42 +09:00
5b83cad8fb only show timestamp in XML output if it is set (not all frames that goes into mbus_parse passes through timestamp), to avoid a lot of '<Timestamp>1970-01-01T00:00:00</Timestamp>' 2013-07-04 23:47:06 +09:00
1fee3d9a5a bug fix: don't assume that frame->next is zeroed before mbus_parse is called 2013-07-04 23:30:27 +09:00
a8f5c07fcf Merge pull request #56 from lategoodbye/master
Improve wildcard search, fix leaks and segfault
2013-07-04 07:04:58 -07:00
dcc9e2c2b4 fix indent 2013-07-03 20:52:27 +02:00
7b897494fd Improve wildcard search
- handle collisions after request for secondary address
- check frame type correctly
- ignore M-Bus devices without secondary address
2013-07-03 20:46:47 +02:00
70f23567a8 fix potential segmentation fault 2013-07-03 20:36:43 +02:00
551176911f fix memory leaks in error case 2013-07-03 20:34:30 +02:00
8dd1d4e4ae bugfix for +1 error in VIFE parser
now VIFE and DIFE behave equal
2013-07-03 20:30:20 +02:00
88b2b9fafa bugfix in VIFE parser 2013-07-03 22:50:03 +09:00
0a0403988c improve error message in request data programs 2013-07-03 22:31:57 +09:00
e1164c87c9 error message if secondary address generation fails 2013-07-03 22:20:44 +09:00
31f17ab4c2 use error_str instead of direct console output 2013-07-03 22:18:06 +09:00
973cc7ba30 use MBUS_ERROR instead of fprintf(stderr 2013-07-03 22:11:13 +09:00
655e3c897d Merge pull request #55 from lategoodbye/master
Improve multi reply binaries
2013-07-01 07:09:18 -07:00
8b9d6e735e sync mbus-tcp-request-data-multi-reply with serial
make init_slaves and parse_abort static
fix return value of parse_abort
remove unused variables
free resources before exit
2013-07-01 08:16:20 +02:00
2ca73eefa1 add new parameter f to man page
add range for TCP port
2013-07-01 08:09:01 +02:00
0f0882d4fa Merge pull request #54 from lategoodbye/master
Add missing file mbus-tcp-application-reset.c
2013-06-29 07:13:06 -07:00
18987c7887 Merge pull request #53 from minusinf/master
Added frame "-f" to option to mbus-serial-request-data-multi-reply to specify frames needed for request
2013-06-29 07:12:56 -07:00
2c03cab529 Add missing file mbus-tcp-application-reset from issue #42.
This will fix also issue #52.
2013-06-28 18:59:04 +02:00
a61714d26d Added frame option to mbus-serial-request-data-multi-reply
Improved parsing
2013-06-28 14:10:15 +00:00
158208c2b1 Merge pull request #51 from lategoodbye/master
Improve data parsing
2013-06-22 02:47:17 -07:00
dd56a08811 Improve data parsing
- add length defines for variable data header and fixed data
- add size check for fixed data
- avoid problems with memory alignment / padding in mbus structures
(improve portability)
- abort parsing if there are too many DIFE or VIFEs
- check for premature end of variable data
- check size of variable length VIF
2013-06-22 11:50:36 +02:00
3381d1b41d test cases for invalid telegrams
- too short fixed data length (invalid_length2.hex)
- premature end of record at data (premature_end_of_data1.hex,
premature_end_of_data2.hex)
- premature end of record at DIF (premature_end_of_dif1.hex,
premature_end_of_dif2.hex)
- premature end of record at variable length VIF
(premature_end_of_var_vif1.hex)
- premature end of record at VIF (premature_end_of_vif1.hex)
- too long variable length VIF (too_long_var_vif.hex)
- too many DIFE (too_many_dife.hex)
- too many VIFE (too_many_vife.hex)
- too short variable header (too_short_header.hex)
2013-06-21 08:45:22 +02:00
c4ceb5c057 Merge pull request #50 from lategoodbye/master
Fixed correction in auxiliary function
2013-06-16 05:24:15 -07:00
687ea60f54 Fixed correction in mbus_vib_unit_normalize 2013-06-09 23:14:08 +02:00
73464cdc59 Merge pull request #49 from lategoodbye/master
Fix port and baudrate, add some checks
2013-05-13 01:53:55 -07:00
d7168a4ea4 Fix return value and error message 2013-05-13 08:47:19 +02:00
858aea33ab add more checks in lower layers
to avoid segmentation faults, out of bounds access and integer overflow
make parseable for splint
suppress splint warnings about datatype cc_t
fix type of return value for read()
add checks before accessing tty
2013-05-13 08:41:38 +02:00
a640295d1b Merge remote-tracking branch 'origin/master' 2013-05-12 21:27:55 +02:00
4d85dad403 change TCP port datatype from int to uint16_t
because int doesn't match the range
add range check in every TCP binary
2013-05-12 21:26:38 +02:00
ddd15c0373 extend baudrate from int to long
because 38400 baud could be bigger than INT_MAX
2013-05-12 16:23:27 +02:00
b0dff87093 Merge pull request #48 from lategoodbye/master
parseable for splint, fix memleaks, minor fixes
2013-05-12 01:26:39 -07:00
c59e763a84 minor fixes
remove unreachable code
add parameter checks to mbus_data_bcd_encode
init time structure in mbus_data_tm_decode as possible
mark falltrough for splint
remove unused variable val
fix removed realloc
2013-05-04 22:43:23 +02:00
ee209023b8 fix memleaks
avoid memleak if memory is full
fix "memleak" at the end of mbus_parse_hex
2013-05-04 19:17:27 +02:00
3935b4013e make parseable for splint
- replace non standard u_char with unsigned char (ANSI)
- advice splint to ignore variadic macros
- move declarations from the middle to top of functions (C90)
- replace local library includes <> to ""
2013-05-04 18:14:18 +02:00
d6ac241d2f Merge pull request #47 from lategoodbye/master
Add missing initialization
2013-05-04 07:21:23 -07:00
0d6bb583c2 add missing initialization (thanks to valgrind) 2013-05-03 17:23:18 +02:00
f7e5898636 Merge pull request #46 from lategoodbye/master
experimental feature application reset, better primary scan, equalize stderr output
2013-04-29 19:12:46 -07:00
e1657399ff add new function to send application reset incl. subcode
fix typo in comment
add new program to test experimental feature application reset
add mbus-tcp-application-reset to build process
2013-04-27 13:16:44 +02:00
f6601ca40f print all errors on stderr in all binaries 2013-04-26 08:18:17 +02:00
ea0c6c3455 add new parameter to specify retries for mbus-serial-scan and
mbus-tcp-scan
make primary scan to retransmit SND_NKE in case of timeout so it's more
reliable but also slowlier
keep default behaviour, no retransmission
equalize mbus-serial-scan and mbus-tcp-scan
update man page
2013-04-25 21:19:41 +02:00
65c036f0d2 Merge pull request #45 from lategoodbye/master
fixes for doxygen
2013-04-18 08:24:30 -07:00
153828268a combine typedef and struct to avoid same comments
combine enum and struct to avoid same comments
add comments for mbus_context_option
add missing parameters in comments
2013-04-17 22:46:04 +02:00
36223255b8 Merge pull request #44 from lategoodbye/master
fix some handling after memory allocation
2013-04-13 03:41:22 -07:00
5d4002f423 revert last commit 2013-04-11 22:17:53 +02:00
f07d4fc579 Merge remote-tracking branch 'upstream/master' 2013-04-11 22:12:16 +02:00
5500db0898 add missing checks after memory allocation
add missing memset after memory allocation
2013-04-11 22:05:08 +02:00
903460846a Merge pull request #41 from tpltnt/master
version info added
2013-04-09 07:39:48 -07:00
db72e2dd49 Merge pull request #43 from lategoodbye/master
fix for issue #42
2013-04-09 07:37:25 -07:00
72ee386e10 version string as const char* 2013-04-09 10:18:27 +02:00
a3018692dc mbus_ prefix added 2013-04-06 19:05:45 +02:00
8fcdf3bf3b function declaration added 2013-04-05 15:13:18 +02:00
450ac7b9f4 fix build error with automake 1.11 and should work with automake 1.12
too
2013-04-04 21:20:37 +02:00
c6fc41484f small function to get current version added 2013-04-04 00:49:03 +02:00
29b85226e1 Merge pull request #40 from lategoodbye/master
add rpm spec file
2013-03-30 19:29:07 -07:00
80df5ce086 Merge remote-tracking branch 'upstream/master' 2013-03-29 16:51:05 +01:00
31d8d829c6 add spec file for rpm based systems 2013-03-29 16:47:18 +01:00
43f8a2caf3 Merge pull request #39 from tpltnt/master
fixes for automake 1.12
2013-03-20 01:23:02 -07:00
55218f05ef AM_PROG_AR added 2013-03-19 23:33:51 +01:00
7bceca6c60 configure.ac improved after lots of hints 2013-03-19 23:28:54 +01:00
a7ac8c3136 Merge pull request #38 from keepfocus/master
Handle filler DIF
2013-03-17 01:40:14 -07:00
6166553755 Make my last change more readable.
As suggested by lategoodbye. Also make it more in line with the way
everything else is written.
2013-03-17 09:19:29 +01:00
363f59a149 Ignore filler DIF (= 0x2F) 2013-03-11 09:27:16 +01:00
91f0c87207 Merge pull request #37 from lategoodbye/master
replace magic numbers
2013-03-02 16:34:58 -08:00
b1063db3bc replace magic numbers with defines
fix MBUS_MAX_PRIMARY_SLAVES to 250
2013-03-02 18:03:31 +01:00
b67ed06ffc Merge pull request #36 from tmtom/pkgconfig
Updated pkgconfig - added math lib dependency
2013-02-09 20:04:50 -08:00
70a4ef7f92 Updated pkgconfig - added math lib dependency 2013-02-09 22:35:16 +01:00
be6e49db16 Merge pull request #35 from aleax/bugfix
Fix undeclared variable
2013-01-14 02:37:42 -08:00
4cd114e911 Fix undeclared variable 2013-01-14 12:28:14 +02:00
86a7305f5e Merge pull request #34 from lategoodbye/master
Address check functions
2013-01-01 06:18:42 -08:00
312eca72e5 fix logic of secondary address check 2012-12-31 13:53:40 +01:00
e248d6e421 replace address parameter checks with new helper functions 2012-12-31 13:44:03 +01:00
898ee57d41 replace address parameter checks with new helper functions 2012-12-31 13:42:27 +01:00
61fd2aa1c7 add new helper functions to check primary and secondary addresses 2012-12-31 13:37:17 +01:00
a8cc7b0acd Merge pull request #33 from aleax/debian
Add libmbus1-dbg package.
2012-12-29 23:44:51 -08:00
a409a917b9 Merge pull request #32 from lategoodbye/master
Fix segmentation fault
2012-12-29 23:44:40 -08:00
9c9c0201f9 add exploit for invalid length 2012-12-29 11:57:13 +01:00
94e5c93299 Add libmbus1-dbg package. 2012-12-25 11:49:20 +02:00
2335deb742 Fix segmentation fault
- check if L Field is at least 3 to avoid crash (MBDOC48.PDF, page 23)
2012-12-22 00:08:59 +01:00
ded841eeb5 Merge pull request #31 from lategoodbye/master
Some clean ups
2012-12-21 05:27:51 -08:00
1080031879 Merge remote-tracking branch 'origin/master'
Conflicts:
	mbus/mbus-protocol.c
2012-12-20 20:57:33 +01:00
404e245af5 replace magic number with define 2012-12-20 20:42:10 +01:00
a4e92f6eab replace magic number with define 2012-12-20 20:12:19 +01:00
b3a3dfec0b Merge remote-tracking branch 'origin/master' 2012-12-19 21:21:28 +01:00
48a5b2bab7 Extend clean up script (based on the changes from tmtom) 2012-12-19 21:20:38 +01:00
c5661ba35f Add mbus-tcp-raw-send to clean up script 2012-12-19 11:30:17 +01:00
6f2986ee79 Merge pull request #30 from lategoodbye/master
Context options, improved hex convertion, clean up
2012-12-17 03:23:56 -08:00
746e611236 Merge remote-tracking branch 'upstream/master'
Conflicts:
	mbus/mbus-protocol-aux.h
2012-12-12 18:06:40 +01:00
5dccbf4197 Merge pull request #29 from aleax/debian
Improve debian build scripts
2012-12-12 04:43:41 -08:00
343c62e503 Merge pull request #28 from aleax/cplusplus
Modify C header files to include from C++ code
2012-12-12 04:43:06 -08:00
59ed4e8612 Merge branch 'master' of git+ssh://git@github.com/lategoodbye/libmbus.git 2012-12-11 20:24:31 +01:00
9b94df16b9 - add new type for context options
- add new function mbus_context_set_option to set context specific
options like retransmission or echo cancelation
2012-12-11 20:22:26 +01:00
410471e248 correct doxygen comment 2012-12-10 21:55:13 +01:00
a266c96a2f - remove unnecessary POSIX header
- change file handling from POSIX to ANSI C
2012-12-10 21:37:42 +01:00
be68f84d38 remove unnecessary POSIX header 2012-12-10 21:35:02 +01:00
dc948566db remove unnecessary POSIX header 2012-12-10 21:26:48 +01:00
72868fdc3f add a new helper function ( mbus_hex2bin ) to convert hex values
into binary values
2012-12-10 21:16:46 +01:00
49c5c751ee Improve debian build scripts
1. Add calling autoreconf to debian/rules for purpose of automatic build
in chroot environment with pbuilder.
2. Copy missing pkg-config file libmbus.pc to /usr/lib/pkgconfig/
3. Remove unnecessary (IMHO) debian/files, becouse it automaticly deletes
by debian/rules clean action
2012-12-05 21:38:12 +02:00
72341baea5 Modify C header files to include from C++ code 2012-12-05 21:24:58 +02:00
ee6241c331 Merge pull request #26 from lategoodbye/master
Fixed parsing with custom VIFE
2012-10-25 07:39:08 -07:00
ad6297cb05 experimental command-line tool for sending raw (hex) frames to a select mbus unit 2012-10-23 21:34:38 +09:00
cfa35db086 Fixed potential segmentation fault 2012-10-22 23:35:45 +02:00
688f0d3bc0 Added product name mapping for Elvaco meters 2012-10-21 23:24:04 +02:00
bc2c85c378 Add custom VIFE handling with a corrective factor (from Jakob
Skov-Pedersen)
2012-10-21 11:21:07 +02:00
0c26bc17a7 Add VIF for digital input and output
Correct some cases
2012-10-21 11:09:21 +02:00
99d48d27b2 Extended mbus_data_variable_print to print out VIF/VIFE 2012-10-21 11:05:08 +02:00
cf297a56c3 New test frame for Elvaco temperature / humidity meter (from Jakob
Skov-Pedersen)
2012-10-21 10:55:48 +02:00
8fb44554c5 Merge pull request #25 from lategoodbye/master
simple echo cancelation
2012-10-13 04:11:10 -07:00
3de91c5eab Added product name mapping for Ista sensonic II mbus 2012-10-05 22:09:07 +02:00
30ab8dd643 handle direction of ACK correctly 2012-10-04 23:20:28 +02:00
da28505323 revert last commit 2012-10-04 22:59:09 +02:00
606d238a6d Merge branch 'master' of
git+ssh://git@github.com/lategoodbye/libmbus.git

Conflicts:
	mbus/mbus-protocol-aux.c
2012-10-04 22:43:06 +02:00
fef774d98d Purge behavior as new context parameter (default = purge master to
slave)
2012-10-04 22:33:22 +02:00
78f16f0248 New defines for purge behavior (echo cancelation) 2012-10-04 22:30:53 +02:00
f7e238afdd Extend mbus_recv_frame with simple echo cancelation 2012-10-03 23:31:37 +02:00
af80dda0d8 Revert "Extend mbus_recv_frame with simple echo cancelation"
This reverts commit 169e37d360.
2012-10-03 23:25:10 +02:00
169e37d360 Extend mbus_recv_frame with simple echo cancelation 2012-10-03 23:06:11 +02:00
d211c3cbcb new function mbus_frame_direction to get the direction of a frame
(slave to master or vice versa)
2012-10-03 23:03:05 +02:00
d6c5529247 new function mbus_frame_direction to get the direction of a frame
(slave to master or vice versa)
extended mbus_frame_data_parse to check the direction of a frame
2012-10-03 23:01:44 +02:00
923858eaee Merge pull request #23 from lategoodbye/master
Bugfix XML 1.0 conformity
2012-09-22 19:51:48 -07:00
fe4217772c Added product name mapping for Sensus PolluCom E 2012-09-17 21:01:53 +02:00
1ae8869d7b convert all control chars into spaces to be xml 1.0 conform 2012-09-16 18:15:55 +02:00
b5e98ba1bc Merge pull request #22 from lategoodbye/master
Fixed typo in VIF list
2012-09-15 18:37:34 -07:00
564483e092 new error message in case of unknown vif 2012-09-15 02:11:14 +02:00
b55d038899 fixed typo in vif list 2012-09-15 02:06:08 +02:00
d05b7b6582 Merge pull request #21 from lategoodbye/master
Unified slave init and allocation bugfixes
2012-09-04 17:18:27 -07:00
501b105d01 unify m-bus slave init 2012-09-01 22:52:55 +02:00
1a538e73aa New parameter for mbus_send_ping_frame to purge response 2012-09-01 22:51:44 +02:00
d2608d5de7 add allocation error handling 2012-09-01 22:14:21 +02:00
e653894bce Merge remote-tracking branch 'upstream/master' 2012-08-25 09:09:50 +02:00
dbd69e49f5 make sure that records are initialized to avoid potential core dumps after incomplete parsning and repacking 2012-08-12 19:08:14 +09:00
166b93a1b1 Added product name mapping for Kamstrup 382 2012-07-25 00:09:11 +02:00
d816a1c30f Merge branch 'master' of github.com:rscada/libmbus 2012-07-25 00:04:16 +09:00
543d3493d7 added test frame with float point value that was incorrectly decoded (now fixed) 2012-07-25 00:02:24 +09:00
ed61932579 fixed bug in float point decoding. previously failed when exponent<0. 2012-07-24 23:59:20 +09:00
989fdbd7ee added -lm in link flags (libmbus uses the pow function from libm) 2012-07-24 23:55:56 +09:00
4af9518ce5 correct fprintf format type for size_t 2012-07-24 23:11:02 +09:00
0ca0148bba Merge pull request #19 from lategoodbye/master
Small bugfixes (retry counter, command args)
2012-07-19 14:35:09 -07:00
418e6741ae Merge pull request #18 from tmtom/tmtom_fixes
Manpages, autotools cleanup
2012-07-19 14:34:31 -07:00
84dd8c2352 Expanded manpage 2012-07-19 22:56:22 +02:00
3bc701e995 Corrected pkgnames/dirnames 2012-07-19 22:34:03 +02:00
db6a1954f0 Added share/doc to be distributed as well. 2012-07-19 21:54:17 +02:00
632ff8c921 Updated schema, added KiCAD project. 2012-07-19 21:33:46 +02:00
5467679f66 Reset retry counter after valid frame to be conform with M-Bus
documentation
2012-07-19 21:08:07 +02:00
7a83f7931d Fixed command args handling of mbus-serial-scan-secondary 2012-07-19 20:09:24 +02:00
63959632e3 Added manpages to the deb package, added autottols call to build-deb.sh 2012-07-18 21:06:03 +02:00
67577dd2d9 Added cleanup script 2012-07-18 19:33:56 +02:00
1a449d8f36 Further cleanup. Need to check debian builds and possible provide cleanup script. 2012-07-18 19:18:11 +02:00
a901d94b44 Cleaned up the GIT repository (expanded .gitignore, removed autogenerated files). 2012-07-18 18:15:47 +02:00
db343cba2b First version of manpages. Added remaining baud rates for serial communication. 2012-07-17 21:50:02 +02:00
36c46d18c2 Merge pull request #17 from lategoodbye/master
Retransmission of request frames
2012-07-14 08:40:04 -07:00
555c627665 Removed unnecessary sleep 2012-07-14 16:25:52 +02:00
08a4c55443 - Initialize maximum retry counter to 3 for serial and tcp connections
- Retransmit request frame (just for mbus_sendrecv_request) in case of
timeout or invalid response
2012-07-14 16:22:25 +02:00
97f2ac34ba M-Bus handle extended by maximum retry counter (in case of transmission
errors)
2012-07-14 16:15:45 +02:00
3386f0a419 Merge pull request #16 from lategoodbye/master
Bugfixes for serial tools
2012-07-13 16:59:51 -07:00
c86ed10af7 Fixed result check for mbus_connect 2012-07-13 23:01:29 +02:00
5d724d9473 Initialize reply structures to avoid segmentation fault in debug 2012-07-13 22:59:26 +02:00
198e9afcef Merge pull request #15 from lategoodbye/master
Removed magic numbers and added new test frames
2012-07-12 16:59:51 -07:00
e6a52f97ea Replaced magic resultcodes from mbus_recv_frame with defines 2012-07-11 23:33:52 +02:00
ff37c4af8c Added test frames:
- ABB F95
- Allmess Megacontrol CF-50
- Elster TMP-A
- EMH DIZ
- NZR DMZ 5/63
2012-07-11 22:41:13 +02:00
9ef64d0fb5 added contributor 2012-07-10 19:52:47 +09:00
69373692b1 Merge pull request #14 from jakubovsky/master
Few improvements
2012-07-09 08:03:41 -07:00
b95f29fcc8 mbus_connect() and mbus_disconnect() return 0 on success and -1 otherwise 2012-07-09 12:33:32 +02:00
5f9052b284 Renamed mbus_recv_frame_dummy() to more descriptive mbus_purge_frames() 2012-07-09 10:48:13 +02:00
e70c07e8f3 TCP and serial specific data structs renamed. 2012-07-06 11:29:46 +02:00
78a6013d75 mbus_recv_dummy() instead of while loop. 2012-07-06 11:21:24 +02:00
6b2d43617f Merge remote-tracking branch 'upstream/master' 2012-07-06 11:14:47 +02:00
d7f63586c6 Merge pull request #13 from lategoodbye/master
Few bugfixes
2012-07-05 06:30:52 -07:00
433744c80a Fix problem with multiple selected devices (secondary address)
- resend SND_NKE to ensure all devices are deselected, because the first
SND_NKE could get lost
2012-07-04 21:21:01 +02:00
736181b35e Revert "Fix problem with multiple selected devices (secondary address) resend "
This reverts commit 1fa5e202fb.
2012-07-04 21:15:55 +02:00
1fa5e202fb Fix problem with multiple selected devices (secondary address)
resend
2012-07-04 21:14:00 +02:00
ec50ab9286 Examples from bin directory updated. API usage updated in mbus-protocol-aux.h. 2012-07-04 19:49:54 +02:00
34255c7237 free_auxdata() added to mbus_handle interface for freeing context specific data 2012-07-04 19:08:51 +02:00
645e5eb482 mbus_serial_connect() is ready 2012-07-04 18:38:50 +02:00
c848090f56 Rebuilding M-Bus context structs in progress
- changed local library file includes from <> to ""
- get rid of 'if (is_serial)' conditions
- mbus_context_serial() and mbus_context_tcp() allocates memory and initialize context specific function pointers
- simply mbus_connect() called instead of mbus_connect_tcp() or mbus_connect_serial()
- context specific data can still be accessed via (void* auxdata) pointer
- strdup(3) to copy host IP into TCP context struct
2012-07-04 17:18:36 +02:00
9f9e0fc008 Fixed mbus_recv_frame() return value to -1 when invalid m-bus handle 2012-07-03 17:17:10 +02:00
5d079254cc Extended mbus_recv_frame() error codes, improved collision handling
- handling TCP connection reset and read(2) timeout
2012-07-03 14:35:07 +02:00
2093b4a9c0 Merge remote-tracking branch 'upstream/master' 2012-06-23 14:29:14 +02:00
d025b27b07 - fixed check of mbus_sendrecv_request and mbus_recv_frame
- initialized memory in mbus_sendrecv_request
- used defines for special address instead of magic numbers
2012-06-20 00:23:25 +02:00
0d610b6a27 - fixed check of mbus_sendrecv_request and mbus_recv_frame
- initialize memory in mbus_sendrecv_request
- used defines for special address instead of magic numbers
2012-06-20 00:21:28 +02:00
138 changed files with 7157 additions and 76963 deletions

57
.gitignore vendored
View File

@ -1,3 +1,43 @@
# autoconf, etc.
Makefile.in
bin/Makefile.in
mbus/Makefile.in
test/Makefile.in
/INSTALL
/aclocal.m4
/autom4te.cache
/compile
config.guess
config.sub
config.h.in
configure
/depcomp
/install-sh
/libltdl/
/ltmain.sh
/missing
src/config.h.in
/m4
# configure stuff:
Makefile
bin/Makefile
mbus/Makefile
test/Makefile
config.log
config.status
libtool
stamp-h1
libmbus.pc
config.h
# make:
bin/.deps
mbus/.deps
test/.deps
# make stuff:
.project
*~
*.o
@ -5,3 +45,20 @@
*.la
*.lo
.libs/
bin/libmbus.1
bin/libmbus.1
bin/mbus-serial-request-data
bin/mbus-serial-request-data-multi-reply
bin/mbus-serial-scan
bin/mbus-serial-scan-secondary
bin/mbus-serial-select-secondary
bin/mbus-serial-switch-baudrate
bin/mbus-tcp-raw-send
bin/mbus-tcp-request-data
bin/mbus-tcp-request-data-multi-reply
bin/mbus-tcp-scan
bin/mbus-tcp-scan-secondary
bin/mbus-tcp-select-secondary
bin/mbus-tcp-application-reset
!*.c

7
.travis.yml Normal file
View File

@ -0,0 +1,7 @@
language: c
compiler:
- gcc
- clang
script: ./build.sh

10
COPYING
View File

@ -1,4 +1,4 @@
Copyright (C) 2010-2012, Raditex AB
Copyright (C) 2010-2012, Raditex AB and contributors
All rights reserved.
rSCADA
@ -11,20 +11,18 @@ Main developer and maintainer:
* Robert Johansson <rob@raditex.nu>
Major contributers:
Contributers:
* Stefan Wahren
* Tomas Menzl
Other contributers:
* Milosz Jakubowski
* Henry N.
* Pelle van der Heide
* James Michael DuPont
* Uwe Grohnwaldt
* Markus Bergkvist
LICENSE (the BSD lisence):
LICENSE (the BSD license):
Copyright (c) 2010-2012, Raditex Control AB
All rights reserved.

View File

@ -7,6 +7,14 @@ VERSION = @VERSION@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libmbus.pc
docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
dist_docdir = $(DESTDIR)$(docdir)
doc_DATA = README \
COPYING \
hardware/MBus_USB.pdf \
hardware/MBus_USB.txt
SUBDIRS = mbus bin
ACLOCAL = aclocal -I .
ACLOCAL_AMFLAGS = -Werror -I m4

956
aclocal.m4 vendored
View File

@ -1,956 +0,0 @@
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file 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.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
[m4_warning([this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file 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.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.11.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.11.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# Free Software Foundation, Inc.
#
# This file 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.
# serial 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
# Free Software Foundation, Inc.
#
# This file 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.
# serial 10
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file 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.
#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
#
# This file 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.
# serial 16
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES(OBJC)],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file 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.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
#
# This file 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.
# serial 4
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file 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.
# serial 6
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
#
# This file 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.
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
[[\\/$]]* | ?:[[\\/]]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file 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.
# serial 4
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
# Free Software Foundation, Inc.
#
# This file 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.
# serial 5
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
esac
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,356 +0,0 @@
# This file was generated.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@request = (
bless( [
'0',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'configure.ac'
],
{
'_LT_AC_TAGCONFIG' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'm4_pattern_forbid' => 1,
'AC_CANONICAL_TARGET' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'm4_sinclude' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_PROG_MOC' => 1,
'AM_SILENT_RULES' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'LT_INIT' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_PROG_AR' => 1,
'AC_LIBSOURCE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AM_PROG_CC_C_O' => 1,
'sinclude' => 1,
'm4_pattern_allow' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
'm4_include' => 1,
'_AM_COND_ELSE' => 1,
'AC_SUBST_TRACE' => 1
}
], 'Autom4te::Request' ),
bless( [
'1',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'/usr/share/aclocal/argz.m4',
'/usr/share/aclocal/ltdl.m4',
'/usr/share/aclocal-1.11/amversion.m4',
'/usr/share/aclocal-1.11/auxdir.m4',
'/usr/share/aclocal-1.11/cond.m4',
'/usr/share/aclocal-1.11/depend.m4',
'/usr/share/aclocal-1.11/depout.m4',
'/usr/share/aclocal-1.11/init.m4',
'/usr/share/aclocal-1.11/install-sh.m4',
'/usr/share/aclocal-1.11/lead-dot.m4',
'/usr/share/aclocal-1.11/make.m4',
'/usr/share/aclocal-1.11/missing.m4',
'/usr/share/aclocal-1.11/mkdirp.m4',
'/usr/share/aclocal-1.11/options.m4',
'/usr/share/aclocal-1.11/runlog.m4',
'/usr/share/aclocal-1.11/sanity.m4',
'/usr/share/aclocal-1.11/silent.m4',
'/usr/share/aclocal-1.11/strip.m4',
'/usr/share/aclocal-1.11/substnot.m4',
'/usr/share/aclocal-1.11/tar.m4',
'm4/libtool.m4',
'm4/ltoptions.m4',
'm4/ltsugar.m4',
'm4/ltversion.m4',
'm4/lt~obsolete.m4',
'configure.ac'
],
{
'AM_ENABLE_STATIC' => 1,
'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
'_LT_AC_SHELL_INIT' => 1,
'AC_DEFUN' => 1,
'_LT_AC_LANG_CXX_CONFIG' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_PROG_MKDIR_P' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_SUBST_NOTMAKE' => 1,
'AM_MISSING_PROG' => 1,
'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
'_LT_AC_LANG_C_CONFIG' => 1,
'AM_PROG_INSTALL_STRIP' => 1,
'_m4_warn' => 1,
'AC_LIBTOOL_OBJDIR' => 1,
'gl_FUNC_ARGZ' => 1,
'AM_SANITY_CHECK' => 1,
'LTOBSOLETE_VERSION' => 1,
'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
'LT_LIB_M' => 1,
'_LT_AC_CHECK_DLFCN' => 1,
'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
'LTSUGAR_VERSION' => 1,
'_LT_PROG_LTMAIN' => 1,
'LT_SYS_SYMBOL_USCORE' => 1,
'_AM_PROG_TAR' => 1,
'AC_LIBTOOL_GCJ' => 1,
'_LT_WITH_SYSROOT' => 1,
'LT_SYS_DLOPEN_DEPLIBS' => 1,
'LT_FUNC_DLSYM_USCORE' => 1,
'_LT_AC_LANG_F77' => 1,
'AC_LIBTOOL_CONFIG' => 1,
'AC_LTDL_DLLIB' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'_AM_AUTOCONF_VERSION' => 1,
'AM_DISABLE_SHARED' => 1,
'_LT_PROG_ECHO_BACKSLASH' => 1,
'_LTDL_SETUP' => 1,
'_LT_AC_LANG_CXX' => 1,
'AM_PROG_LIBTOOL' => 1,
'AM_PROG_LD' => 1,
'_LT_AC_FILE_LTDLL_C' => 1,
'AC_LIB_LTDL' => 1,
'AU_DEFUN' => 1,
'AC_PROG_NM' => 1,
'AC_LIBTOOL_DLOPEN' => 1,
'AC_PROG_LD' => 1,
'AC_PROG_LD_GNU' => 1,
'AC_ENABLE_FAST_INSTALL' => 1,
'AC_LIBTOOL_FC' => 1,
'LTDL_CONVENIENCE' => 1,
'_AM_SET_OPTION' => 1,
'AC_LTDL_PREOPEN' => 1,
'_LT_LINKER_BOILERPLATE' => 1,
'_LT_PREPARE_SED_QUOTE_VARS' => 1,
'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
'AC_LIBTOOL_PROG_CC_C_O' => 1,
'gl_PREREQ_ARGZ' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'LT_PROG_RC' => 1,
'LT_SYS_MODULE_EXT' => 1,
'AC_DEFUN_ONCE' => 1,
'_LT_AC_LANG_GCJ' => 1,
'AC_LTDL_OBJDIR' => 1,
'_LT_PATH_TOOL_PREFIX' => 1,
'AC_LIBTOOL_RC' => 1,
'_LT_AC_PROG_ECHO_BACKSLASH' => 1,
'AC_DISABLE_FAST_INSTALL' => 1,
'AM_SILENT_RULES' => 1,
'include' => 1,
'_LT_AC_TRY_DLOPEN_SELF' => 1,
'_LT_AC_SYS_LIBPATH_AIX' => 1,
'LT_AC_PROG_SED' => 1,
'AM_ENABLE_SHARED' => 1,
'LTDL_INSTALLABLE' => 1,
'_LT_AC_LANG_GCJ_CONFIG' => 1,
'AC_ENABLE_SHARED' => 1,
'_LT_REQUIRED_DARWIN_CHECKS' => 1,
'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
'AC_ENABLE_STATIC' => 1,
'_LT_AC_TAGVAR' => 1,
'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
'AM_CONDITIONAL' => 1,
'LT_LIB_DLLOAD' => 1,
'LTVERSION_VERSION' => 1,
'_LT_PROG_CXX' => 1,
'_LT_PROG_F77' => 1,
'LTDL_INIT' => 1,
'm4_include' => 1,
'AM_PROG_INSTALL_SH' => 1,
'AC_PROG_EGREP' => 1,
'AC_PATH_MAGIC' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
'AC_LTDL_SYSSEARCHPATH' => 1,
'AM_MAKE_INCLUDE' => 1,
'LT_CMD_MAX_LEN' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'_LT_LINKER_OPTION' => 1,
'AC_LIBTOOL_COMPILER_OPTION' => 1,
'AC_DISABLE_SHARED' => 1,
'_LT_COMPILER_BOILERPLATE' => 1,
'AC_LIBTOOL_WIN32_DLL' => 1,
'AC_LIBTOOL_SETUP' => 1,
'AC_PROG_LD_RELOAD_FLAG' => 1,
'AC_LTDL_DLSYM_USCORE' => 1,
'AM_MISSING_HAS_RUN' => 1,
'LT_LANG' => 1,
'LT_SYS_DLSEARCH_PATH' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_LIBTOOL_DLOPEN_SELF' => 1,
'LT_OUTPUT' => 1,
'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
'AC_WITH_LTDL' => 1,
'AC_LIBTOOL_LINKER_OPTION' => 1,
'LT_AC_PROG_RC' => 1,
'AC_LIBTOOL_CXX' => 1,
'LT_INIT' => 1,
'LT_AC_PROG_GCJ' => 1,
'LT_SYS_DLOPEN_SELF' => 1,
'AM_DEP_TRACK' => 1,
'AM_DISABLE_STATIC' => 1,
'_LT_AC_PROG_CXXCPP' => 1,
'_AC_PROG_LIBTOOL' => 1,
'_AM_IF_OPTION' => 1,
'AC_PATH_TOOL_PREFIX' => 1,
'm4_pattern_allow' => 1,
'AC_LIBTOOL_F77' => 1,
'AM_SET_LEADING_DOT' => 1,
'_LT_PROG_FC' => 1,
'LT_AC_PROG_EGREP' => 1,
'_AM_DEPENDENCIES' => 1,
'AC_LIBTOOL_LANG_C_CONFIG' => 1,
'LTOPTIONS_VERSION' => 1,
'_LT_AC_SYS_COMPILER' => 1,
'AM_PROG_NM' => 1,
'AC_LIBLTDL_CONVENIENCE' => 1,
'AC_DEPLIBS_CHECK_METHOD' => 1,
'AC_LIBLTDL_INSTALLABLE' => 1,
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
'AC_LTDL_ENABLE_INSTALL' => 1,
'LT_PROG_GCJ' => 1,
'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_DISABLE_STATIC' => 1,
'LT_PATH_NM' => 1,
'AC_LTDL_SHLIBEXT' => 1,
'_LT_AC_LOCK' => 1,
'_LT_AC_LANG_RC_CONFIG' => 1,
'LT_SYS_MODULE_PATH' => 1,
'LT_WITH_LTDL' => 1,
'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
'AC_LTDL_SHLIBPATH' => 1,
'AM_AUX_DIR_EXPAND' => 1,
'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
'_LT_AC_LANG_F77_CONFIG' => 1,
'_LT_COMPILER_OPTION' => 1,
'_AM_SET_OPTIONS' => 1,
'AM_RUN_LOG' => 1,
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'AC_LIBTOOL_PICMODE' => 1,
'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1,
'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1,
'AC_CHECK_LIBM' => 1,
'LT_PATH_LD' => 1,
'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
'_AM_MANGLE_OPTION' => 1,
'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
'AC_LTDL_SYMBOL_USCORE' => 1,
'AM_SET_DEPDIR' => 1,
'_LT_CC_BASENAME' => 1,
'_LT_LIBOBJ' => 1
}
], 'Autom4te::Request' ),
bless( [
'2',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'aclocal.m4',
'configure.ac'
],
{
'AM_PROG_F77_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1,
'AC_INIT' => 1,
'm4_pattern_forbid' => 1,
'AC_CANONICAL_TARGET' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'm4_sinclude' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'LT_INIT' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_PROG_AR' => 1,
'AC_LIBSOURCE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_PROG_CC_C_O' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
'm4_include' => 1,
'_AM_COND_ELSE' => 1,
'AC_SUBST_TRACE' => 1
}
], 'Autom4te::Request' )
);

View File

@ -1,201 +0,0 @@
m4trace:configure.ac:11: -1- AC_INIT([mbus], [0.7.0], [info@rscada.se], [mbus], [http://www.rscada.se/libmbus/])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:11: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.ac:11: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:11: -1- AC_SUBST([SHELL])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:11: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:11: -1- AC_SUBST([PATH_SEPARATOR])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PATH_SEPARATOR$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_NAME])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_STRING])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_URL])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:11: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([exec_prefix])
m4trace:configure.ac:11: -1- m4_pattern_allow([^exec_prefix$])
m4trace:configure.ac:11: -1- AC_SUBST([prefix], [NONE])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([prefix])
m4trace:configure.ac:11: -1- m4_pattern_allow([^prefix$])
m4trace:configure.ac:11: -1- AC_SUBST([program_transform_name], [s,x,x,])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([program_transform_name])
m4trace:configure.ac:11: -1- m4_pattern_allow([^program_transform_name$])
m4trace:configure.ac:11: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([bindir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^bindir$])
m4trace:configure.ac:11: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([sbindir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^sbindir$])
m4trace:configure.ac:11: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([libexecdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^libexecdir$])
m4trace:configure.ac:11: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([datarootdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^datarootdir$])
m4trace:configure.ac:11: -1- AC_SUBST([datadir], ['${datarootdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([datadir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^datadir$])
m4trace:configure.ac:11: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([sysconfdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^sysconfdir$])
m4trace:configure.ac:11: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([sharedstatedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^sharedstatedir$])
m4trace:configure.ac:11: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([localstatedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^localstatedir$])
m4trace:configure.ac:11: -1- AC_SUBST([includedir], ['${prefix}/include'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([includedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^includedir$])
m4trace:configure.ac:11: -1- AC_SUBST([oldincludedir], ['/usr/include'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([oldincludedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^oldincludedir$])
m4trace:configure.ac:11: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
['${datarootdir}/doc/${PACKAGE}'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([docdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^docdir$])
m4trace:configure.ac:11: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([infodir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^infodir$])
m4trace:configure.ac:11: -1- AC_SUBST([htmldir], ['${docdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([htmldir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^htmldir$])
m4trace:configure.ac:11: -1- AC_SUBST([dvidir], ['${docdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([dvidir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^dvidir$])
m4trace:configure.ac:11: -1- AC_SUBST([pdfdir], ['${docdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([pdfdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^pdfdir$])
m4trace:configure.ac:11: -1- AC_SUBST([psdir], ['${docdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([psdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^psdir$])
m4trace:configure.ac:11: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([libdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^libdir$])
m4trace:configure.ac:11: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([localedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^localedir$])
m4trace:configure.ac:11: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([mandir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
@%:@undef PACKAGE_NAME])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
@%:@undef PACKAGE_TARNAME])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
@%:@undef PACKAGE_VERSION])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
@%:@undef PACKAGE_STRING])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
@%:@undef PACKAGE_BUGREPORT])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
@%:@undef PACKAGE_URL])
m4trace:configure.ac:11: -1- AC_SUBST([DEFS])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([DEFS])
m4trace:configure.ac:11: -1- m4_pattern_allow([^DEFS$])
m4trace:configure.ac:11: -1- AC_SUBST([ECHO_C])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([ECHO_C])
m4trace:configure.ac:11: -1- m4_pattern_allow([^ECHO_C$])
m4trace:configure.ac:11: -1- AC_SUBST([ECHO_N])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([ECHO_N])
m4trace:configure.ac:11: -1- m4_pattern_allow([^ECHO_N$])
m4trace:configure.ac:11: -1- AC_SUBST([ECHO_T])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([ECHO_T])
m4trace:configure.ac:11: -1- m4_pattern_allow([^ECHO_T$])
m4trace:configure.ac:11: -1- AC_SUBST([LIBS])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:11: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:11: -1- AC_SUBST([build_alias])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([build_alias])
m4trace:configure.ac:11: -1- m4_pattern_allow([^build_alias$])
m4trace:configure.ac:11: -1- AC_SUBST([host_alias])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([host_alias])
m4trace:configure.ac:11: -1- m4_pattern_allow([^host_alias$])
m4trace:configure.ac:11: -1- AC_SUBST([target_alias])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([target_alias])
m4trace:configure.ac:11: -1- m4_pattern_allow([^target_alias$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CFLAGS])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CFLAGS])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CFLAGS$])
m4trace:configure.ac:22: -1- AC_SUBST([LDFLAGS])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([LDFLAGS])
m4trace:configure.ac:22: -1- m4_pattern_allow([^LDFLAGS$])
m4trace:configure.ac:22: -1- AC_SUBST([LIBS])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:22: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:22: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([ac_ct_CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^ac_ct_CC$])
m4trace:configure.ac:22: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([EXEEXT])
m4trace:configure.ac:22: -1- m4_pattern_allow([^EXEEXT$])
m4trace:configure.ac:22: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([OBJEXT])
m4trace:configure.ac:22: -1- m4_pattern_allow([^OBJEXT$])
m4trace:configure.ac:24: -1- AC_CONFIG_HEADERS([config.h])
m4trace:configure.ac:25: -1- AC_CONFIG_FILES([Makefile mbus/Makefile test/Makefile bin/Makefile libmbus.pc])
m4trace:configure.ac:26: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:26: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:26: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([LTLIBOBJS])
m4trace:configure.ac:26: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([top_builddir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([top_build_prefix])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([srcdir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([abs_srcdir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([top_srcdir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([abs_top_srcdir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([builddir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([abs_builddir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([abs_top_builddir])

File diff suppressed because it is too large Load Diff

View File

@ -1,537 +0,0 @@
m4trace:aclocal.m4:952: -1- m4_include([m4/libtool.m4])
m4trace:aclocal.m4:953: -1- m4_include([m4/ltoptions.m4])
m4trace:aclocal.m4:954: -1- m4_include([m4/ltsugar.m4])
m4trace:aclocal.m4:955: -1- m4_include([m4/ltversion.m4])
m4trace:aclocal.m4:956: -1- m4_include([m4/lt~obsolete.m4])
m4trace:configure.ac:11: -1- AC_INIT([mbus], [0.7.0], [info@rscada.se], [mbus], [http://www.rscada.se/libmbus/])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:11: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.ac:11: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:11: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:11: -1- AC_SUBST([SHELL])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:11: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:11: -1- AC_SUBST([PATH_SEPARATOR])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PATH_SEPARATOR$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_NAME])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_STRING])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:11: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([PACKAGE_URL])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:11: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([exec_prefix])
m4trace:configure.ac:11: -1- m4_pattern_allow([^exec_prefix$])
m4trace:configure.ac:11: -1- AC_SUBST([prefix], [NONE])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([prefix])
m4trace:configure.ac:11: -1- m4_pattern_allow([^prefix$])
m4trace:configure.ac:11: -1- AC_SUBST([program_transform_name], [s,x,x,])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([program_transform_name])
m4trace:configure.ac:11: -1- m4_pattern_allow([^program_transform_name$])
m4trace:configure.ac:11: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([bindir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^bindir$])
m4trace:configure.ac:11: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([sbindir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^sbindir$])
m4trace:configure.ac:11: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([libexecdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^libexecdir$])
m4trace:configure.ac:11: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([datarootdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^datarootdir$])
m4trace:configure.ac:11: -1- AC_SUBST([datadir], ['${datarootdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([datadir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^datadir$])
m4trace:configure.ac:11: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([sysconfdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^sysconfdir$])
m4trace:configure.ac:11: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([sharedstatedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^sharedstatedir$])
m4trace:configure.ac:11: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([localstatedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^localstatedir$])
m4trace:configure.ac:11: -1- AC_SUBST([includedir], ['${prefix}/include'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([includedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^includedir$])
m4trace:configure.ac:11: -1- AC_SUBST([oldincludedir], ['/usr/include'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([oldincludedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^oldincludedir$])
m4trace:configure.ac:11: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
['${datarootdir}/doc/${PACKAGE}'])])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([docdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^docdir$])
m4trace:configure.ac:11: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([infodir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^infodir$])
m4trace:configure.ac:11: -1- AC_SUBST([htmldir], ['${docdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([htmldir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^htmldir$])
m4trace:configure.ac:11: -1- AC_SUBST([dvidir], ['${docdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([dvidir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^dvidir$])
m4trace:configure.ac:11: -1- AC_SUBST([pdfdir], ['${docdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([pdfdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^pdfdir$])
m4trace:configure.ac:11: -1- AC_SUBST([psdir], ['${docdir}'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([psdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^psdir$])
m4trace:configure.ac:11: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([libdir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^libdir$])
m4trace:configure.ac:11: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([localedir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^localedir$])
m4trace:configure.ac:11: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([mandir])
m4trace:configure.ac:11: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
@%:@undef PACKAGE_NAME])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
@%:@undef PACKAGE_TARNAME])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
@%:@undef PACKAGE_VERSION])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
@%:@undef PACKAGE_STRING])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
@%:@undef PACKAGE_BUGREPORT])
m4trace:configure.ac:11: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
m4trace:configure.ac:11: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:11: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
@%:@undef PACKAGE_URL])
m4trace:configure.ac:11: -1- AC_SUBST([DEFS])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([DEFS])
m4trace:configure.ac:11: -1- m4_pattern_allow([^DEFS$])
m4trace:configure.ac:11: -1- AC_SUBST([ECHO_C])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([ECHO_C])
m4trace:configure.ac:11: -1- m4_pattern_allow([^ECHO_C$])
m4trace:configure.ac:11: -1- AC_SUBST([ECHO_N])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([ECHO_N])
m4trace:configure.ac:11: -1- m4_pattern_allow([^ECHO_N$])
m4trace:configure.ac:11: -1- AC_SUBST([ECHO_T])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([ECHO_T])
m4trace:configure.ac:11: -1- m4_pattern_allow([^ECHO_T$])
m4trace:configure.ac:11: -1- AC_SUBST([LIBS])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:11: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:11: -1- AC_SUBST([build_alias])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([build_alias])
m4trace:configure.ac:11: -1- m4_pattern_allow([^build_alias$])
m4trace:configure.ac:11: -1- AC_SUBST([host_alias])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([host_alias])
m4trace:configure.ac:11: -1- m4_pattern_allow([^host_alias$])
m4trace:configure.ac:11: -1- AC_SUBST([target_alias])
m4trace:configure.ac:11: -1- AC_SUBST_TRACE([target_alias])
m4trace:configure.ac:11: -1- m4_pattern_allow([^target_alias$])
m4trace:configure.ac:12: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign])
m4trace:configure.ac:12: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
m4trace:configure.ac:12: -1- AM_AUTOMAKE_VERSION([1.11.1])
m4trace:configure.ac:12: -1- AC_REQUIRE_AUX_FILE([install-sh])
m4trace:configure.ac:12: -1- AC_SUBST([INSTALL_PROGRAM])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
m4trace:configure.ac:12: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
m4trace:configure.ac:12: -1- AC_SUBST([INSTALL_SCRIPT])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
m4trace:configure.ac:12: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
m4trace:configure.ac:12: -1- AC_SUBST([INSTALL_DATA])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([INSTALL_DATA])
m4trace:configure.ac:12: -1- m4_pattern_allow([^INSTALL_DATA$])
m4trace:configure.ac:12: -1- AC_SUBST([am__isrc], [' -I$(srcdir)'])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([am__isrc])
m4trace:configure.ac:12: -1- m4_pattern_allow([^am__isrc$])
m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([am__isrc])
m4trace:configure.ac:12: -1- AC_SUBST([CYGPATH_W])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([CYGPATH_W])
m4trace:configure.ac:12: -1- m4_pattern_allow([^CYGPATH_W$])
m4trace:configure.ac:12: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PACKAGE])
m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE$])
m4trace:configure.ac:12: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([VERSION])
m4trace:configure.ac:12: -1- m4_pattern_allow([^VERSION$])
m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE$])
m4trace:configure.ac:12: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
@%:@undef PACKAGE])
m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
m4trace:configure.ac:12: -1- m4_pattern_allow([^VERSION$])
m4trace:configure.ac:12: -1- AH_OUTPUT([VERSION], [/* Version number of package */
@%:@undef VERSION])
m4trace:configure.ac:12: -1- AC_REQUIRE_AUX_FILE([missing])
m4trace:configure.ac:12: -1- AC_SUBST([ACLOCAL])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([ACLOCAL])
m4trace:configure.ac:12: -1- m4_pattern_allow([^ACLOCAL$])
m4trace:configure.ac:12: -1- AC_SUBST([AUTOCONF])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AUTOCONF])
m4trace:configure.ac:12: -1- m4_pattern_allow([^AUTOCONF$])
m4trace:configure.ac:12: -1- AC_SUBST([AUTOMAKE])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AUTOMAKE])
m4trace:configure.ac:12: -1- m4_pattern_allow([^AUTOMAKE$])
m4trace:configure.ac:12: -1- AC_SUBST([AUTOHEADER])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AUTOHEADER])
m4trace:configure.ac:12: -1- m4_pattern_allow([^AUTOHEADER$])
m4trace:configure.ac:12: -1- AC_SUBST([MAKEINFO])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MAKEINFO])
m4trace:configure.ac:12: -1- m4_pattern_allow([^MAKEINFO$])
m4trace:configure.ac:12: -1- AC_SUBST([install_sh])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([install_sh])
m4trace:configure.ac:12: -1- m4_pattern_allow([^install_sh$])
m4trace:configure.ac:12: -1- AC_SUBST([STRIP])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([STRIP])
m4trace:configure.ac:12: -1- m4_pattern_allow([^STRIP$])
m4trace:configure.ac:12: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
m4trace:configure.ac:12: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
m4trace:configure.ac:12: -1- AC_REQUIRE_AUX_FILE([install-sh])
m4trace:configure.ac:12: -1- AC_SUBST([MKDIR_P])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MKDIR_P])
m4trace:configure.ac:12: -1- m4_pattern_allow([^MKDIR_P$])
m4trace:configure.ac:12: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([mkdir_p])
m4trace:configure.ac:12: -1- m4_pattern_allow([^mkdir_p$])
m4trace:configure.ac:12: -1- AC_SUBST([AWK])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AWK])
m4trace:configure.ac:12: -1- m4_pattern_allow([^AWK$])
m4trace:configure.ac:12: -1- AC_SUBST([SET_MAKE])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([SET_MAKE])
m4trace:configure.ac:12: -1- m4_pattern_allow([^SET_MAKE$])
m4trace:configure.ac:12: -1- AC_SUBST([am__leading_dot])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([am__leading_dot])
m4trace:configure.ac:12: -1- m4_pattern_allow([^am__leading_dot$])
m4trace:configure.ac:12: -1- AC_SUBST([AMTAR])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AMTAR])
m4trace:configure.ac:12: -1- m4_pattern_allow([^AMTAR$])
m4trace:configure.ac:12: -1- AC_SUBST([am__tar])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([am__tar])
m4trace:configure.ac:12: -1- m4_pattern_allow([^am__tar$])
m4trace:configure.ac:12: -1- AC_SUBST([am__untar])
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([am__untar])
m4trace:configure.ac:12: -1- m4_pattern_allow([^am__untar$])
m4trace:configure.ac:16: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete.
You should run autoupdate.], [m4/libtool.m4:108: AM_PROG_LIBTOOL is expanded from...
configure.ac:16: the top level])
m4trace:configure.ac:16: -1- LT_INIT
m4trace:configure.ac:16: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$])
m4trace:configure.ac:16: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])
m4trace:configure.ac:16: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
m4trace:configure.ac:16: -1- AC_SUBST([LIBTOOL])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LIBTOOL])
m4trace:configure.ac:16: -1- m4_pattern_allow([^LIBTOOL$])
m4trace:configure.ac:16: -1- AC_CANONICAL_HOST
m4trace:configure.ac:16: -1- AC_CANONICAL_BUILD
m4trace:configure.ac:16: -1- AC_REQUIRE_AUX_FILE([config.sub])
m4trace:configure.ac:16: -1- AC_REQUIRE_AUX_FILE([config.guess])
m4trace:configure.ac:16: -1- AC_SUBST([build], [$ac_cv_build])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([build])
m4trace:configure.ac:16: -1- m4_pattern_allow([^build$])
m4trace:configure.ac:16: -1- AC_SUBST([build_cpu], [$[1]])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([build_cpu])
m4trace:configure.ac:16: -1- m4_pattern_allow([^build_cpu$])
m4trace:configure.ac:16: -1- AC_SUBST([build_vendor], [$[2]])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([build_vendor])
m4trace:configure.ac:16: -1- m4_pattern_allow([^build_vendor$])
m4trace:configure.ac:16: -1- AC_SUBST([build_os])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([build_os])
m4trace:configure.ac:16: -1- m4_pattern_allow([^build_os$])
m4trace:configure.ac:16: -1- AC_SUBST([host], [$ac_cv_host])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([host])
m4trace:configure.ac:16: -1- m4_pattern_allow([^host$])
m4trace:configure.ac:16: -1- AC_SUBST([host_cpu], [$[1]])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([host_cpu])
m4trace:configure.ac:16: -1- m4_pattern_allow([^host_cpu$])
m4trace:configure.ac:16: -1- AC_SUBST([host_vendor], [$[2]])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([host_vendor])
m4trace:configure.ac:16: -1- m4_pattern_allow([^host_vendor$])
m4trace:configure.ac:16: -1- AC_SUBST([host_os])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([host_os])
m4trace:configure.ac:16: -1- m4_pattern_allow([^host_os$])
m4trace:configure.ac:16: -1- AC_SUBST([CC])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:16: -1- AC_SUBST([CFLAGS])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CFLAGS])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CFLAGS$])
m4trace:configure.ac:16: -1- AC_SUBST([LDFLAGS])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LDFLAGS])
m4trace:configure.ac:16: -1- m4_pattern_allow([^LDFLAGS$])
m4trace:configure.ac:16: -1- AC_SUBST([LIBS])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:16: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:16: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:16: -1- AC_SUBST([CC])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:16: -1- AC_SUBST([CC])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:16: -1- AC_SUBST([CC])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:16: -1- AC_SUBST([CC])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:16: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([ac_ct_CC])
m4trace:configure.ac:16: -1- m4_pattern_allow([^ac_ct_CC$])
m4trace:configure.ac:16: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([EXEEXT])
m4trace:configure.ac:16: -1- m4_pattern_allow([^EXEEXT$])
m4trace:configure.ac:16: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([OBJEXT])
m4trace:configure.ac:16: -1- m4_pattern_allow([^OBJEXT$])
m4trace:configure.ac:16: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([DEPDIR])
m4trace:configure.ac:16: -1- m4_pattern_allow([^DEPDIR$])
m4trace:configure.ac:16: -1- AC_SUBST([am__include])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__include])
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__include$])
m4trace:configure.ac:16: -1- AC_SUBST([am__quote])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__quote])
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__quote$])
m4trace:configure.ac:16: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
m4trace:configure.ac:16: -1- AC_SUBST([AMDEP_TRUE])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AMDEP_TRUE])
m4trace:configure.ac:16: -1- m4_pattern_allow([^AMDEP_TRUE$])
m4trace:configure.ac:16: -1- AC_SUBST([AMDEP_FALSE])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AMDEP_FALSE])
m4trace:configure.ac:16: -1- m4_pattern_allow([^AMDEP_FALSE$])
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
m4trace:configure.ac:16: -1- AC_SUBST([AMDEPBACKSLASH])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
m4trace:configure.ac:16: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
m4trace:configure.ac:16: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CCDEPMODE])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CCDEPMODE$])
m4trace:configure.ac:16: -1- AM_CONDITIONAL([am__fastdepCC], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3])
m4trace:configure.ac:16: -1- AC_SUBST([am__fastdepCC_TRUE])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
m4trace:configure.ac:16: -1- AC_SUBST([am__fastdepCC_FALSE])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
m4trace:configure.ac:16: -1- AC_SUBST([SED])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([SED])
m4trace:configure.ac:16: -1- m4_pattern_allow([^SED$])
m4trace:configure.ac:16: -1- AC_SUBST([GREP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([GREP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^GREP$])
m4trace:configure.ac:16: -1- AC_SUBST([EGREP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([EGREP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^EGREP$])
m4trace:configure.ac:16: -1- AC_SUBST([FGREP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([FGREP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^FGREP$])
m4trace:configure.ac:16: -1- AC_SUBST([GREP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([GREP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^GREP$])
m4trace:configure.ac:16: -1- AC_SUBST([LD])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LD])
m4trace:configure.ac:16: -1- m4_pattern_allow([^LD$])
m4trace:configure.ac:16: -1- AC_SUBST([DUMPBIN])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([DUMPBIN])
m4trace:configure.ac:16: -1- m4_pattern_allow([^DUMPBIN$])
m4trace:configure.ac:16: -1- AC_SUBST([ac_ct_DUMPBIN])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN])
m4trace:configure.ac:16: -1- m4_pattern_allow([^ac_ct_DUMPBIN$])
m4trace:configure.ac:16: -1- AC_SUBST([DUMPBIN])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([DUMPBIN])
m4trace:configure.ac:16: -1- m4_pattern_allow([^DUMPBIN$])
m4trace:configure.ac:16: -1- AC_SUBST([NM])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([NM])
m4trace:configure.ac:16: -1- m4_pattern_allow([^NM$])
m4trace:configure.ac:16: -1- AC_SUBST([LN_S], [$as_ln_s])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LN_S])
m4trace:configure.ac:16: -1- m4_pattern_allow([^LN_S$])
m4trace:configure.ac:16: -1- AC_SUBST([OBJDUMP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([OBJDUMP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^OBJDUMP$])
m4trace:configure.ac:16: -1- AC_SUBST([OBJDUMP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([OBJDUMP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^OBJDUMP$])
m4trace:configure.ac:16: -1- AC_SUBST([DLLTOOL])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([DLLTOOL])
m4trace:configure.ac:16: -1- m4_pattern_allow([^DLLTOOL$])
m4trace:configure.ac:16: -1- AC_SUBST([DLLTOOL])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([DLLTOOL])
m4trace:configure.ac:16: -1- m4_pattern_allow([^DLLTOOL$])
m4trace:configure.ac:16: -1- AC_SUBST([AR])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AR])
m4trace:configure.ac:16: -1- m4_pattern_allow([^AR$])
m4trace:configure.ac:16: -1- AC_SUBST([ac_ct_AR])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([ac_ct_AR])
m4trace:configure.ac:16: -1- m4_pattern_allow([^ac_ct_AR$])
m4trace:configure.ac:16: -1- AC_SUBST([STRIP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([STRIP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^STRIP$])
m4trace:configure.ac:16: -1- AC_SUBST([RANLIB])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([RANLIB])
m4trace:configure.ac:16: -1- m4_pattern_allow([^RANLIB$])
m4trace:configure.ac:16: -1- m4_pattern_allow([LT_OBJDIR])
m4trace:configure.ac:16: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR])
m4trace:configure.ac:16: -1- m4_pattern_allow([^LT_OBJDIR$])
m4trace:configure.ac:16: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
@%:@undef LT_OBJDIR])
m4trace:configure.ac:16: -1- LT_SUPPORTED_TAG([CC])
m4trace:configure.ac:16: -1- AC_SUBST([MANIFEST_TOOL])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([MANIFEST_TOOL])
m4trace:configure.ac:16: -1- m4_pattern_allow([^MANIFEST_TOOL$])
m4trace:configure.ac:16: -1- AC_SUBST([DSYMUTIL])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([DSYMUTIL])
m4trace:configure.ac:16: -1- m4_pattern_allow([^DSYMUTIL$])
m4trace:configure.ac:16: -1- AC_SUBST([NMEDIT])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([NMEDIT])
m4trace:configure.ac:16: -1- m4_pattern_allow([^NMEDIT$])
m4trace:configure.ac:16: -1- AC_SUBST([LIPO])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LIPO])
m4trace:configure.ac:16: -1- m4_pattern_allow([^LIPO$])
m4trace:configure.ac:16: -1- AC_SUBST([OTOOL])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([OTOOL])
m4trace:configure.ac:16: -1- m4_pattern_allow([^OTOOL$])
m4trace:configure.ac:16: -1- AC_SUBST([OTOOL64])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([OTOOL64])
m4trace:configure.ac:16: -1- m4_pattern_allow([^OTOOL64$])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
@%:@undef HAVE_DLFCN_H])
m4trace:configure.ac:16: -1- AC_SUBST([CPP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:16: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:16: -1- AC_SUBST([CPP])
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:16: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:16: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
m4trace:configure.ac:16: -1- m4_pattern_allow([^STDC_HEADERS$])
m4trace:configure.ac:16: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
@%:@undef STDC_HEADERS])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
@%:@undef HAVE_SYS_TYPES_H])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
@%:@undef HAVE_SYS_STAT_H])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
@%:@undef HAVE_STDLIB_H])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
@%:@undef HAVE_STRING_H])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
@%:@undef HAVE_MEMORY_H])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
@%:@undef HAVE_STRINGS_H])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
@%:@undef HAVE_INTTYPES_H])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
@%:@undef HAVE_STDINT_H])
m4trace:configure.ac:16: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
@%:@undef HAVE_UNISTD_H])
m4trace:configure.ac:16: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
m4trace:configure.ac:16: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CFLAGS])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CFLAGS])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CFLAGS$])
m4trace:configure.ac:22: -1- AC_SUBST([LDFLAGS])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([LDFLAGS])
m4trace:configure.ac:22: -1- m4_pattern_allow([^LDFLAGS$])
m4trace:configure.ac:22: -1- AC_SUBST([LIBS])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:22: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:22: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:22: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([ac_ct_CC])
m4trace:configure.ac:22: -1- m4_pattern_allow([^ac_ct_CC$])
m4trace:configure.ac:22: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([CCDEPMODE])
m4trace:configure.ac:22: -1- m4_pattern_allow([^CCDEPMODE$])
m4trace:configure.ac:22: -1- AM_CONDITIONAL([am__fastdepCC], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3])
m4trace:configure.ac:22: -1- AC_SUBST([am__fastdepCC_TRUE])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
m4trace:configure.ac:22: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
m4trace:configure.ac:22: -1- AC_SUBST([am__fastdepCC_FALSE])
m4trace:configure.ac:22: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
m4trace:configure.ac:22: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
m4trace:configure.ac:22: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
m4trace:configure.ac:22: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
m4trace:configure.ac:24: -1- AC_CONFIG_HEADERS([config.h])
m4trace:configure.ac:25: -1- AC_CONFIG_FILES([Makefile mbus/Makefile test/Makefile bin/Makefile libmbus.pc])
m4trace:configure.ac:26: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:26: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:26: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([LTLIBOBJS])
m4trace:configure.ac:26: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:26: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
m4trace:configure.ac:26: -1- AC_SUBST([am__EXEEXT_TRUE])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
m4trace:configure.ac:26: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
m4trace:configure.ac:26: -1- AC_SUBST([am__EXEEXT_FALSE])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
m4trace:configure.ac:26: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
m4trace:configure.ac:26: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
m4trace:configure.ac:26: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([top_builddir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([top_build_prefix])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([srcdir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([abs_srcdir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([top_srcdir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([abs_top_srcdir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([builddir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([abs_builddir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([abs_top_builddir])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([INSTALL])
m4trace:configure.ac:26: -1- AC_SUBST_TRACE([MKDIR_P])
m4trace:configure.ac:26: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])

View File

@ -17,51 +17,81 @@ bin_PROGRAMS = mbus-tcp-scan mbus-tcp-request-data mbus-tcp-request-data-multi
mbus-tcp-select-secondary mbus-tcp-scan-secondary \
mbus-serial-scan mbus-serial-request-data mbus-serial-request-data-multi-reply \
mbus-serial-select-secondary mbus-serial-scan-secondary \
mbus-serial-switch-baudrate
mbus-serial-switch-baudrate mbus-tcp-raw-send mbus-tcp-application-reset
# tcp
mbus_tcp_scan_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_scan_LDADD = -lmbus
mbus_tcp_scan_LDADD = -lmbus -lm
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_LDADD = -lmbus -lm
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_LDADD = -lmbus -lm
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_LDADD = -lmbus -lm
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_LDADD = -lmbus -lm
mbus_tcp_scan_secondary_SOURCES = mbus-tcp-scan-secondary.c
mbus_tcp_raw_send_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_raw_send_LDADD = -lmbus -lm
mbus_tcp_raw_send_SOURCES = mbus-tcp-raw-send.c
mbus_tcp_application_reset_LDFLAGS = -L$(top_builddir)/mbus
mbus_tcp_application_reset_LDADD = -lmbus -lm
mbus_tcp_application_reset_SOURCES = mbus-tcp-application-reset.c
# serial
mbus_serial_scan_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_scan_LDADD = -lmbus
mbus_serial_scan_LDADD = -lmbus -lm
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_LDADD = -lmbus -lm
mbus_serial_request_data_SOURCES = mbus-serial-request-data.c
mbus_serial_request_data_multi_reply_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_request_data_multi_reply_LDADD = -lmbus
mbus_serial_request_data_multi_reply_LDADD = -lmbus -lm
mbus_serial_request_data_multi_reply_SOURCES = mbus-serial-request-data-multi-reply.c
mbus_serial_select_secondary_LDFLAGS = -L$(top_builddir)/mbus
mbus_serial_select_secondary_LDADD = -lmbus
mbus_serial_select_secondary_LDADD = -lmbus -lm
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_LDADD = -lmbus -lm
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_LDADD = -lmbus -lm
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-tcp-raw-send.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

159
bin/libmbus.pod Normal file
View File

@ -0,0 +1,159 @@
=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] [-r RETRIES] device
B<mbus-tcp-scan> [-d] [-r RETRIES] 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] [-f FRAMES] device mbus-address
B<mbus-tcp-request-data-multi-reply> [-d] [-f FRAMES] 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
B<mbus-tcp-raw-send> [-d] host port mbus-address [file]
=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 (default: 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.
B<mbus-tcp-raw-send> - send a single raw hex frame to a MBus device.
=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.
libmbus supports following baud rates: 300, 600, 1200, 2400, 4800, 9600, 19200,
38400.
Note that your MBus gateway and/or MBus device will most likely support only
a subset of these. The most commonlu used/supported rates are probably 9600, 2400
and 300.
=item B<-r> I<RETRIES>
Maximum retransmissions. In case a MBus device doesn't reply to a request or
the response is erroneous, the MBus master can send a retransmissions.
libmbus supports the following range of retransmission: 0 until 9
=item B<-f> I<FRAMES>
Maximum response frames.
=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).
An integer between 0 and 65535.
=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 or a secondary address (sixteen
digit hexadecimal number).
The primary address should be an integer between 1 and 250 for addressing
individual devices. However the program does allow using any one byte number (i.e.
0 to 255) so that you can also use addresses reserved for physical or data link
layers management, secondary addressing, broadcasts, etc.
=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.
=item B<file>
Path to an file with hex values.
=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
Readout a MBus device on address 59 at 2400Bd:
mbus-serial-request-data-multi-reply -b 2400 /dev/ttyS0 59
=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>

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

197
bin/mbus-serial-request-data-multi-reply.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -19,100 +15,129 @@
static int debug = 0;
// Default value for the maximum number of frames
#define MAXFRAMES 16
//
// init slave to get really the beginning of the records
//
static int
init_slaves(mbus_handle *handle)
{
if (debug)
printf("%s: debug: sending init frame #1\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
//
// resend SND_NKE, maybe the first get lost
//
if (debug)
printf("%s: debug: sending init frame #2\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
return 1;
}
//------------------------------------------------------------------------------
// Wrapper for argument parsing errors
//------------------------------------------------------------------------------
static void
parse_abort(char **argv)
{
fprintf(stderr, "usage: %s [-d] [-b BAUDRATE] [-f FRAMES] device mbus-address\n", argv[0]);
fprintf(stderr, " optional flag -d for debug printout\n");
fprintf(stderr, " optional flag -b for selecting baudrate\n");
fprintf(stderr, " optional flag -f for selecting the maximal number of frames\n");
exit(1);
}
//------------------------------------------------------------------------------
// Scan for devices using secondary addressing.
//------------------------------------------------------------------------------
int
main(int argc, char **argv)
{
mbus_frame *frame, reply;
mbus_frame_data reply_data;
mbus_frame reply;
mbus_handle *handle = NULL;
char *device, *addr_str, *xml_result;
int address, baudrate = 9600;
int address;
long baudrate = 9600;
int maxframes = MAXFRAMES;
memset((void *)&reply, 0, sizeof(mbus_frame));
memset((void *)&reply_data, 0, sizeof(mbus_frame_data));
if (argc == 3)
int c;
for (c=1; c<argc-2; c++)
{
device = argv[1];
addr_str = argv[2];
if (strcmp(argv[c], "-d") == 0)
{
debug = 1;
}
else if (strcmp(argv[c], "-b") == 0)
{
c++;
baudrate = atol(argv[c]);
}
else if (strcmp(argv[c], "-f") == 0)
{
c++;
maxframes = atoi(argv[c]);
}
else
{
parse_abort(argv);
}
}
else if (argc == 4 && strcmp(argv[1], "-d") == 0)
if (c > argc-2)
{
device = argv[2];
addr_str = argv[3];
debug = 1;
parse_abort(argv);
}
else if (argc == 5 && strcmp(argv[1], "-b") == 0)
device = argv[c];
addr_str = argv[c+1];
if ((handle = mbus_context_serial(device)) == NULL)
{
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;
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if ((handle = mbus_connect_serial(device)) == NULL)
if (mbus_connect(handle) == -1)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
fprintf(stderr,"Failed to setup connection to M-bus gateway\n");
mbus_context_free(handle);
return 1;
}
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
if (mbus_serial_set_baudrate(handle, baudrate) == -1)
{
printf("Failed to set baud rate.\n");
fprintf(stderr,"Failed to set baud rate.\n");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
//
// init slave to get really the beginning of the records
//
frame = mbus_frame_new(MBUS_FRAME_TYPE_SHORT);
if (frame == NULL)
if (init_slaves(handle) == 0)
{
fprintf(stderr, "Failed to allocate mbus frame.\n");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
frame->control = MBUS_CONTROL_MASK_SND_NKE | MBUS_CONTROL_MASK_DIR_M2S;
frame->address = MBUS_ADDRESS_BROADCAST_NOREPLY;
if (debug)
printf("%s: debug: sending init frame\n", __PRETTY_FUNCTION__);
if (mbus_send_frame(handle, frame) == -1)
{
fprintf(stderr, "Failed to send mbus frame.\n");
mbus_frame_free(frame);
return 1;
}
mbus_recv_frame(handle, &reply);
if (strlen(addr_str) == 16)
if (mbus_is_secondary_address(addr_str))
{
// secondary addressing
@ -123,33 +148,42 @@ main(int argc, char **argv)
if (ret == MBUS_PROBE_COLLISION)
{
fprintf(stderr, "%s: Error: The address mask [%s] matches more than one device.\n", __PRETTY_FUNCTION__, addr_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_NOTHING)
{
fprintf(stderr, "%s: Error: The selected secondary address does not match any device [%s].\n", __PRETTY_FUNCTION__, addr_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_ERROR)
{
fprintf(stderr, "%s: Error: Failed to select secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
return 1;
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
// else MBUS_PROBE_SINGLE
address = 253;
}
address = MBUS_ADDRESS_NETWORK_LAYER;
}
else
{
// primary addressing
address = atoi(addr_str);
}
// instead of the send and recv, use this sendrecv function that
}
// 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)
if (mbus_sendrecv_request(handle, address, &reply, maxframes) != 0)
{
fprintf(stderr, "Failed to send/receive M-Bus request.\n");
mbus_disconnect(handle);
mbus_context_free(handle);
mbus_frame_free(reply.next);
return 1;
}
@ -167,15 +201,18 @@ main(int argc, char **argv)
if ((xml_result = mbus_frame_xml(&reply)) == NULL)
{
fprintf(stderr, "Failed to generate XML representation of MBUS frames: %s\n", mbus_error_str());
mbus_disconnect(handle);
mbus_context_free(handle);
mbus_frame_free(reply.next);
return 1;
}
printf("%s", xml_result);
free(xml_result);
mbus_disconnect(handle);
mbus_context_free(handle);
mbus_frame_free(reply.next);
return 0;
}

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

146
bin/mbus-serial-request-data.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -19,6 +15,35 @@
static int debug = 0;
//
// init slave to get really the beginning of the records
//
static int
init_slaves(mbus_handle *handle)
{
if (debug)
printf("%s: debug: sending init frame #1\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
//
// resend SND_NKE, maybe the first get lost
//
if (debug)
printf("%s: debug: sending init frame #2\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
return 1;
}
//------------------------------------------------------------------------------
// Scan for devices using secondary addressing.
//------------------------------------------------------------------------------
@ -30,60 +55,80 @@ main(int argc, char **argv)
mbus_handle *handle = NULL;
char *device, *addr_str, *xml_result;
int address, baudrate = 9600;
int address;
char fcb;
long baudrate = 9600;
memset((void *)&reply, 0, sizeof(mbus_frame));
memset((void *)&reply_data, 0, sizeof(mbus_frame_data));
if (argc == 3)
{
device = argv[1];
device = argv[1];
addr_str = argv[2];
}
else if (argc == 4 && strcmp(argv[1], "-d") == 0)
{
device = argv[2];
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];
baudrate = atol(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];
baudrate = atol(argv[3]);
device = argv[4];
addr_str = argv[5];
debug = 1;
}
else
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_context_serial(device)) == NULL)
{
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if ((handle = mbus_connect_serial(device)) == NULL)
if (mbus_connect(handle) == -1)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
fprintf(stderr,"Failed to setup connection to M-bus gateway\n");
mbus_context_free(handle);
return 1;
}
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
if (mbus_serial_set_baudrate(handle, baudrate) == -1)
{
printf("Failed to set baud rate.\n");
fprintf(stderr,"Failed to set baud rate.\n");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
if (init_slaves(handle) == 0)
{
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
if (strlen(addr_str) == 16)
if (mbus_is_secondary_address(addr_str))
{
// secondary addressing
@ -94,64 +139,80 @@ main(int argc, char **argv)
if (ret == MBUS_PROBE_COLLISION)
{
fprintf(stderr, "%s: Error: The address mask [%s] matches more than one device.\n", __PRETTY_FUNCTION__, addr_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_NOTHING)
{
fprintf(stderr, "%s: Error: The selected secondary address does not match any device [%s].\n", __PRETTY_FUNCTION__, addr_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_ERROR)
{
fprintf(stderr, "%s: Error: Failed to select 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");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
}
// else MBUS_PROBE_SINGLE
address = MBUS_ADDRESS_NETWORK_LAYER;
fcb = 0;
}
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;
}
}
fcb = 1;
}
if (mbus_recv_frame(handle, &reply) == -1)
if (mbus_send_request_frame(handle, address, fcb) == -1)
{
fprintf(stderr, "Failed to send M-Bus request frame.\n");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
if (mbus_recv_frame(handle, &reply) != MBUS_RECV_RESULT_OK)
{
fprintf(stderr, "Failed to receive M-Bus response frame.\n");
return 1;
}
}
//
// parse data and print in XML format
// dump hex data if debug is true
//
if (debug)
{
mbus_frame_print(&reply);
}
//
// parse data
//
if (mbus_frame_data_parse(&reply, &reply_data) == -1)
{
fprintf(stderr, "M-bus data parse error.\n");
fprintf(stderr, "M-bus data parse error: %s\n", mbus_error_str());
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
//
// generate XML and print to standard output
//
if ((xml_result = mbus_frame_data_xml(&reply_data)) == NULL)
{
fprintf(stderr, "Failed to generate XML representation of MBUS frame: %s\n", mbus_error_str());
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
printf("%s", xml_result);
free(xml_result);
@ -162,6 +223,7 @@ main(int argc, char **argv)
}
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

134
bin/mbus-serial-scan-secondary.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -19,68 +15,98 @@
static int debug = 0;
//
// init slave to get really the beginning of the records
//
int
init_slaves(mbus_handle *handle)
{
if (debug)
printf("%s: debug: sending init frame #1\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
//
// resend SND_NKE, maybe the first get lost
//
if (debug)
printf("%s: debug: sending init frame #2\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_BROADCAST_NOREPLY, 1) == -1)
{
return 0;
}
return 1;
}
//------------------------------------------------------------------------------
// Scan for devices using secondary addressing.
//------------------------------------------------------------------------------
int
main(int argc, char **argv)
{
char *device, *addr_mask;
int baudrate = 9600;
char *device, *addr_mask = NULL;
long baudrate = 9600;
mbus_handle *handle = NULL;
mbus_frame *frame = NULL, reply;
memset((void *)&reply, 0, sizeof(mbus_frame));
if (argc == 2)
{
device = argv[1];
device = argv[1];
addr_mask = strdup("FFFFFFFFFFFFFFFF");
}
else if (argc == 3 && strcmp(argv[1], "-d") == 0)
{
device = argv[2];
device = argv[2];
addr_mask = strdup("FFFFFFFFFFFFFFFF");
debug = 1;
}
else if (argc == 3)
{
device = argv[1];
device = argv[1];
addr_mask = strdup(argv[2]);
}
else if (argc == 4 && strcmp(argv[1], "-d") == 0)
{
device = argv[1];
addr_mask = strdup(argv[2]);
device = argv[2];
addr_mask = strdup(argv[3]);
debug = 1;
}
else if (argc == 4 && strcmp(argv[1], "-b") == 0)
{
baudrate = atoi(argv[2]);
device = argv[3];
baudrate = atol(argv[2]);
device = argv[3];
addr_mask = strdup("FFFFFFFFFFFFFFFF");
}
else if (argc == 5 && strcmp(argv[1], "-d") == 0)
else if (argc == 5 && strcmp(argv[1], "-d") == 0 && strcmp(argv[2], "-b") == 0)
{
baudrate = atoi(argv[3]);
device = argv[4];
baudrate = atol(argv[3]);
device = argv[4];
addr_mask = strdup("FFFFFFFFFFFFFFFF");
debug = 1;
}
else if (argc == 5 && strcmp(argv[1], "-b") == 0)
{
baudrate = atoi(argv[2]);
device = argv[3];
baudrate = atol(argv[2]);
device = argv[3];
addr_mask = strdup(argv[4]);
}
else if (argc == 6 && strcmp(argv[1], "-d") == 0)
{
baudrate = atoi(argv[3]);
device = argv[4];
baudrate = atol(argv[3]);
device = argv[4];
addr_mask = strdup(argv[5]);
debug = 1;
}
else
else
{
fprintf(stderr, "usage: %s [-d] [-b BAUDRATE] device [address-mask]\n", argv[0]);
fprintf(stderr, "\toptional flag -d for debug printout\n");
@ -89,28 +115,44 @@ main(int argc, char **argv)
fprintf(stderr, "\t'FFFFFFFFFFFFFFFF' where F is a wildcard character\n");
return 0;
}
if (debug)
if (addr_mask == NULL)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
fprintf(stderr, "Failed to allocate address mask.\n");
return 1;
}
if (strlen(addr_mask) != 16)
if (mbus_is_secondary_address(addr_mask) == 0)
{
fprintf(stderr, "Misformatted secondary address mask. Must be 16 character HEX number.\n");
free(addr_mask);
return 1;
}
if ((handle = mbus_connect_serial(device)) == NULL)
if ((handle = mbus_context_serial(device)) == NULL)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway: %s\n", mbus_error_str());
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
free(addr_mask);
return 1;
}
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
if (debug)
{
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr,"Failed to setup connection to M-bus gateway\n");
free(addr_mask);
return 1;
}
if (mbus_serial_set_baudrate(handle, baudrate) == -1)
{
fprintf(stderr, "Failed to set baud rate.\n");
free(addr_mask);
return 1;
}
@ -120,40 +162,20 @@ main(int argc, char **argv)
if (frame == NULL)
{
fprintf(stderr, "Failed to allocate mbus frame.\n");
free(addr_mask);
return 1;
}
//
// init slaves
//
frame->control = MBUS_CONTROL_MASK_SND_NKE | MBUS_CONTROL_MASK_DIR_M2S;
frame->address = 0xFD;
if (mbus_send_frame(handle, frame) == -1)
if (init_slaves(handle) == 0)
{
fprintf(stderr, "Failed to send SND_NKE #1.\n");
mbus_frame_free(frame);
free(addr_mask);
return 1;
}
(void) mbus_recv_frame(handle, &reply);
frame->control = MBUS_CONTROL_MASK_SND_NKE | MBUS_CONTROL_MASK_DIR_M2S;
frame->address = 0xFF;
if (mbus_send_frame(handle, frame) == -1)
{
fprintf(stderr, "Failed to send SND_NKE #2.\n");
mbus_frame_free(frame);
return 1;
}
(void) mbus_recv_frame(handle, &reply);
mbus_scan_2nd_address_range(handle, 0, addr_mask);
mbus_disconnect(handle);
mbus_context_free(handle);
//printf("Summary: Tried %ld address masks and found %d devices.\n", probe_count, match_count);
free(addr_mask);

2
bin/mbus-serial-scan.1 Normal file
View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

150
bin/mbus-serial-scan.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -19,6 +15,37 @@
static int debug = 0;
int ping_address(mbus_handle *handle, mbus_frame *reply, int address)
{
int i, ret = MBUS_RECV_RESULT_ERROR;
memset((void *)reply, 0, sizeof(mbus_frame));
for (i = 0; i <= handle->max_search_retry; i++)
{
if (debug)
{
printf("%d ", address);
fflush(stdout);
}
if (mbus_send_ping_frame(handle, address, 0) == -1)
{
fprintf(stderr,"Scan failed. Could not send ping frame: %s\n", mbus_error_str());
return MBUS_RECV_RESULT_ERROR;
}
ret = mbus_recv_frame(handle, reply);
if (ret != MBUS_RECV_RESULT_TIMEOUT)
{
return ret;
}
}
return ret;
}
//------------------------------------------------------------------------------
// Primary addressing scanning of mbus devices.
//------------------------------------------------------------------------------
@ -27,7 +54,8 @@ main(int argc, char **argv)
{
mbus_handle *handle;
char *device;
int address, baudrate = 9600;
int address, retries = 0;
long baudrate = 9600;
int ret;
if (argc == 2)
@ -41,100 +69,112 @@ main(int argc, char **argv)
}
else if (argc == 4 && strcmp(argv[1], "-b") == 0)
{
baudrate = atoi(argv[2]);
baudrate = atol(argv[2]);
device = argv[3];
}
else if (argc == 4 && strcmp(argv[1], "-r") == 0)
{
retries = atoi(argv[2]);
device = argv[3];
}
else if (argc == 5 && strcmp(argv[1], "-d") == 0 && strcmp(argv[2], "-b") == 0)
{
debug = 1;
baudrate = atoi(argv[3]);
debug = 1;
baudrate = atol(argv[3]);
device = argv[4];
}
else if (argc == 5 && strcmp(argv[1], "-d") == 0 && strcmp(argv[2], "-r") == 0)
{
debug = 1;
retries = atoi(argv[3]);
device = argv[4];
}
else if (argc == 6 && strcmp(argv[1], "-b") == 0 && strcmp(argv[3], "-r") == 0)
{
baudrate = atol(argv[2]);
retries = atoi(argv[4]);
device = argv[5];
}
else if (argc == 7 && strcmp(argv[1], "-d") == 0 && strcmp(argv[2], "-b") == 0 && strcmp(argv[4], "-r") == 0)
{
debug = 1;
baudrate = atol(argv[3]);
retries = atoi(argv[5]);
device = argv[6];
}
else
{
fprintf(stderr, "usage: %s [-d] [-b BAUDRATE] device\n", argv[0]);
fprintf(stderr,"usage: %s [-d] [-b BAUDRATE] [-r RETRIES] device\n", argv[0]);
return 0;
}
if (debug)
if ((handle = mbus_context_serial(device)) == NULL)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
}
if ((handle = mbus_connect_serial(device)) == NULL)
{
printf("Failed to setup connection to M-bus gateway\n");
fprintf(stderr,"Scan failed: Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
if (debug)
{
printf("Failed to set baud rate.\n");
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr,"Scan failed: Could not setup connection to M-bus gateway: %s\n", mbus_error_str());
return 1;
}
if (mbus_context_set_option(handle, MBUS_OPTION_MAX_SEARCH_RETRY, retries) == -1)
{
fprintf(stderr,"Failed to set retry count\n");
return 1;
}
if (mbus_serial_set_baudrate(handle, baudrate) == -1)
{
fprintf(stderr,"Failed to set baud rate.\n");
return 1;
}
if (debug)
printf("Scanning primary addresses:\n");
for (address = 0; address <= 250; address++)
for (address = 0; address <= MBUS_MAX_PRIMARY_SLAVES; address++)
{
mbus_frame reply;
memset((void *)&reply, 0, sizeof(mbus_frame));
ret = ping_address(handle, &reply, address);
if (debug)
{
printf("%d ", address);
fflush(stdout);
}
if (mbus_send_ping_frame(handle, address) == -1)
{
printf("Scan failed. Could not send ping frame: %s\n", mbus_error_str());
return 1;
}
ret = mbus_recv_frame(handle, &reply);
if (ret == -1)
if (ret == MBUS_RECV_RESULT_TIMEOUT)
{
continue;
}
if (debug)
printf("\n");
if (ret == -2)
if (ret == MBUS_RECV_RESULT_INVALID)
{
/* check for more data (collision) */
while (mbus_recv_frame(handle, &reply) != -1);
mbus_purge_frames(handle);
printf("Collision at address %d\n", address);
continue;
}
}
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
{
/* check for more data (collision) */
while (mbus_recv_frame(handle, &reply) != -1)
{
ret = -2;
}
if (ret == -2)
if (mbus_purge_frames(handle))
{
printf("Collision at address %d\n", address);
continue;
}
printf("Found a M-Bus device at address %d\n", address);
}
}
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

74
bin/mbus-serial-select-secondary.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -26,18 +22,19 @@ main(int argc, char **argv)
{
mbus_handle *handle;
mbus_frame reply;
char *device, *addr;
int ret, baudrate = 9600;
char *device, *addr = NULL;
int ret;
long baudrate = 9600;
if (argc == 3)
{
device = argv[1];
device = argv[1];
addr = strdup(argv[2]);
}
}
else if (argc == 5 && strcmp(argv[1], "-b") == 0)
{
baudrate = atoi(argv[2]);
device = argv[3];
baudrate = atol(argv[2]);
device = argv[3];
addr = strdup(argv[4]);
}
else
@ -46,56 +43,68 @@ main(int argc, char **argv)
fprintf(stderr, " optional flag -b for selecting baudrate\n");
return 0;
}
if (strlen(addr) != 16)
if (addr == NULL)
{
printf("Misformatted secondary address. Must be 16 character HEX number.\n");
fprintf(stderr, "Failed to allocate address.\n");
return 1;
}
if ((handle = mbus_connect_serial(device)) == NULL)
if (mbus_is_secondary_address(addr) == 0)
{
printf("Failed to setup connection to M-bus device: %s\n", mbus_error_str());
fprintf(stderr,"Misformatted secondary address. Must be 16 character HEX number.\n");
return 1;
}
if (mbus_serial_set_baudrate(handle->m_serial_handle, baudrate) == -1)
if ((handle = mbus_context_serial(device)) == NULL)
{
printf("Failed to set baud rate.\n");
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr,"Failed to setup connection to M-bus gateway\n");
return 1;
}
if (mbus_serial_set_baudrate(handle, baudrate) == -1)
{
fprintf(stderr,"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;
fprintf(stderr,"Failed to send selection frame: %s\n", mbus_error_str());
return 1;
}
ret = mbus_recv_frame(handle, &reply);
if (ret == -1)
if (ret == MBUS_RECV_RESULT_TIMEOUT)
{
printf("No reply from device with secondary address %s: %s\n", argv[2], mbus_error_str());
fprintf(stderr,"No reply from device with secondary address %s: %s\n", argv[2], mbus_error_str());
return 1;
}
}
if (ret == -2)
if (ret == MBUS_RECV_RESULT_INVALID)
{
printf("Invalid reply from %s: The address address probably match more than one device: %s\n", argv[2], mbus_error_str());
fprintf(stderr,"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());
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 0) == -1)
{
fprintf(stderr,"Failed to send request to selected secondary device: %s\n", mbus_error_str());
return 1;
}
if (mbus_recv_frame(handle, &reply) == -1)
if (mbus_recv_frame(handle, &reply) != MBUS_RECV_RESULT_OK)
{
printf("Failed to recieve reply from selected secondary device: %s\n", mbus_error_str());
fprintf(stderr,"Failed to recieve reply from selected secondary device: %s\n", mbus_error_str());
return 1;
}
@ -107,12 +116,13 @@ main(int argc, char **argv)
}
else
{
printf("Unknown reply:\n");
fprintf(stderr,"Unknown reply:\n");
mbus_frame_print(&reply);
}
free(addr);
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

49
bin/mbus-serial-switch-baudrate.c Normal file → Executable file
View File

@ -2,7 +2,7 @@
// Copyright (C) 2010-2012, Robert Johansson and contributors, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
@ -11,10 +11,6 @@
//
//------------------------------------------------------------------------------
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
@ -31,20 +27,20 @@ main(int argc, char **argv)
mbus_frame reply;
char *device;
int address, ret;
int source_baudrate = 9600, target_baudrate;
long source_baudrate = 9600, target_baudrate;
if (argc == 4)
{
device = argv[1];
address = atoi(argv[2]);
target_baudrate = atoi(argv[3]);
target_baudrate = atol(argv[3]);
}
else if (argc == 6 && strcmp(argv[1], "-b") == 0)
{
source_baudrate = atoi(argv[2]);
source_baudrate = atol(argv[2]);
device = argv[3];
address = atoi(argv[4]);
target_baudrate = atoi(argv[5]);
target_baudrate = atol(argv[5]);
}
else
{
@ -52,42 +48,49 @@ main(int argc, char **argv)
return 0;
}
if ((handle = mbus_connect_serial(device)) == NULL)
if ((handle = mbus_context_serial(device)) == NULL)
{
printf("Failed to setup connection to M-bus device: %s\n", mbus_error_str());
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (mbus_serial_set_baudrate(handle->m_serial_handle, source_baudrate) == -1)
if (mbus_connect(handle) == -1)
{
printf("Failed to set baud rate.\n");
fprintf(stderr,"Failed to setup connection to M-bus gateway\n");
return 1;
}
if (mbus_serial_set_baudrate(handle, source_baudrate) == -1)
{
fprintf(stderr,"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;
fprintf(stderr,"Failed to send switch baudrate frame: %s\n", mbus_error_str());
return 1;
}
ret = mbus_recv_frame(handle, &reply);
if (ret == -1)
ret = mbus_recv_frame(handle, &reply);
if (ret == MBUS_RECV_RESULT_TIMEOUT)
{
printf("No reply from device\n");
fprintf(stderr,"No reply from device\n");
return 1;
}
else if (mbus_frame_type(&reply) != MBUS_FRAME_TYPE_ACK)
{
printf("Unknown reply:\n");
fprintf(stderr,"Unknown reply:\n");
mbus_frame_print(&reply);
}
else
{
printf("Switched baud rate of device to %d\n", target_baudrate);
printf("Switched baud rate of device to %lu\n", target_baudrate);
}
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

168
bin/mbus-tcp-application-reset.c Executable file
View File

@ -0,0 +1,168 @@
//------------------------------------------------------------------------------
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#include <string.h>
#include <stdio.h>
#include <mbus/mbus.h>
static int debug = 0;
//------------------------------------------------------------------------------
// Execution starts here:
//------------------------------------------------------------------------------
int
main(int argc, char **argv)
{
mbus_handle *handle;
mbus_frame reply;
char *host, *addr = NULL;
int ret;
long port;
int address, subcode = -1;
if (argc == 4)
{
host = argv[1];
port = atol(argv[2]);
addr = argv[3];
}
else if (argc == 5 && strcmp(argv[1], "-d") == 0)
{
debug = 1;
host = argv[2];
port = atol(argv[3]);
addr = argv[4];
}
else if (argc == 5)
{
host = argv[1];
port = atol(argv[2]);
addr = argv[3];
subcode = atoi(argv[4]);
}
else if (argc == 6 && strcmp(argv[1], "-d") == 0)
{
debug = 1;
host = argv[2];
port = atol(argv[3]);
addr = argv[4];
subcode = atoi(argv[5]);
}
else
{
fprintf(stderr, "usage: %s [-d] host port mbus-address [subcode]\n", argv[0]);
return 0;
}
if ((port < 0) || (port > 0xFFFF))
{
fprintf(stderr, "Invalid port: %ld\n", port);
return 1;
}
if ((handle = mbus_context_tcp(host, port)) == NULL)
{
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
mbus_context_free(handle);
return 1;
}
if (mbus_is_secondary_address(addr))
{
// secondary addressing
int ret;
ret = mbus_select_secondary_address(handle, addr);
if (ret == MBUS_PROBE_COLLISION)
{
fprintf(stderr, "The address mask [%s] matches more than one device.\n", addr);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_NOTHING)
{
fprintf(stderr, "The selected secondary address does not match any device [%s].\n", addr);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_ERROR)
{
fprintf(stderr, "Failed to select secondary address [%s].\n", addr);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
// else MBUS_PROBE_SINGLE
address = MBUS_ADDRESS_NETWORK_LAYER;
}
else
{
// primary addressing
address = atoi(addr);
}
if (mbus_send_application_reset_frame(handle, address, subcode) == -1)
{
fprintf(stderr,"Failed to send reset frame: %s\n", mbus_error_str());
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
ret = mbus_recv_frame(handle, &reply);
if (ret == MBUS_RECV_RESULT_TIMEOUT)
{
fprintf(stderr,"No reply from device\n");
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (mbus_frame_type(&reply) != MBUS_FRAME_TYPE_ACK)
{
fprintf(stderr,"Unknown reply:\n");
mbus_frame_print(&reply);
}
else
{
if (subcode > -1)
{
printf("Successful reset device (Subcode: %d)\n", subcode);
}
else
{
printf("Successful reset device\n");
}
}
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

2
bin/mbus-tcp-raw-send.1 Normal file
View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

194
bin/mbus-tcp-raw-send.c Normal file
View File

@ -0,0 +1,194 @@
//------------------------------------------------------------------------------
// Copyright (C) 2012, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#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, request;
mbus_frame_data reply_data;
mbus_handle *handle = NULL;
char *host, *addr_str, matching_addr[16], *file = NULL;
long port;
int address, result;
FILE *fp = NULL;
size_t buff_len, len;
unsigned char raw_buff[4096], buff[4096];
memset((void *)&reply, 0, sizeof(mbus_frame));
memset((void *)&reply_data, 0, sizeof(mbus_frame_data));
if (argc == 4)
{
host = argv[1];
port = atol(argv[2]);
addr_str = argv[3];
debug = 0;
}
else if (argc == 5 && strcmp(argv[1], "-d") == 0)
{
host = argv[2];
port = atol(argv[3]);
addr_str = argv[4];
debug = 1;
}
else if (argc == 5)
{
host = argv[1];
port = atol(argv[2]);
addr_str = argv[3];
file = argv[4];
debug = 0;
}
else if (argc == 6 && strcmp(argv[1], "-d") == 0)
{
host = argv[2];
port = atol(argv[3]);
addr_str = argv[4];
file = argv[5];
debug = 1;
}
else
{
fprintf(stderr, "usage: %s [-d] host port mbus-address [file]\n", argv[0]);
fprintf(stderr, " optional flag -d for debug printout\n");
fprintf(stderr, " optional argument file for file. if omitted read from stdin\n");
return 0;
}
if ((port < 0) || (port > 0xFFFF))
{
fprintf(stderr, "Invalid port: %ld\n", port);
return 1;
}
if ((handle = mbus_context_tcp(host, port)) == NULL)
{
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway\n%s\n", mbus_error_str());
return 1;
}
if (mbus_is_secondary_address(addr_str))
{
// secondary addressing
int ret;
ret = mbus_select_secondary_address(handle, addr_str);
if (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 (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 (ret == MBUS_PROBE_ERROR)
{
fprintf(stderr, "%s: Error: Failed to select secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
return 1;
}
address = MBUS_ADDRESS_NETWORK_LAYER;
}
else
{
// primary addressing
address = atoi(addr_str);
}
//
// read hex data from file or stdin
//
if (file != NULL)
{
if ((fp = fopen(file, "r")) == NULL)
{
fprintf(stderr, "%s: failed to open '%s'\n", __PRETTY_FUNCTION__, file);
return 1;
}
}
else
{
fp = stdin;
}
memset(raw_buff, 0, sizeof(raw_buff));
len = fread(raw_buff, 1, sizeof(raw_buff), fp);
if (fp != stdin)
{
fclose(fp);
}
buff_len = mbus_hex2bin(buff,sizeof(buff),raw_buff,sizeof(raw_buff));
//
// attempt to parse the input data
//
result = mbus_parse(&request, buff, buff_len);
if (result < 0)
{
fprintf(stderr, "mbus_parse: %s\n", mbus_error_str());
return 1;
}
else if (result > 0)
{
fprintf(stderr, "mbus_parse: need %d more bytes\n", result);
return 1;
}
//
// send the request
//
if (mbus_send_frame(handle, &request) == -1)
{
fprintf(stderr, "Failed to send mbus frame: %s\n", mbus_error_str());
return 1;
}
//
// this should be option:
//
if (mbus_recv_frame(handle, &reply) != MBUS_RECV_RESULT_OK)
{
fprintf(stderr, "Failed to receive M-Bus response frame: %s\n", mbus_error_str());
return 1;
}
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

215
bin/mbus-tcp-request-data-multi-reply.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -19,83 +15,123 @@
static int debug = 0;
// Default value for the maximum number of frames
#define MAXFRAMES 16
//
// init slave to get really the beginning of the records
//
static int
init_slaves(mbus_handle *handle)
{
if (debug)
printf("%s: debug: sending init frame #1\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
//
// resend SND_NKE, maybe the first get lost
//
if (debug)
printf("%s: debug: sending init frame #2\n", __PRETTY_FUNCTION__);
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
return 0;
}
return 1;
}
//------------------------------------------------------------------------------
// Wrapper for argument parsing errors
//------------------------------------------------------------------------------
static void
parse_abort(char **argv)
{
fprintf(stderr, "usage: %s [-d] [-f FRAMES] host port mbus-address\n", argv[0]);
fprintf(stderr, " optional flag -d for debug printout\n");
fprintf(stderr, " optional flag -f for selecting the maximal number of frames\n");
exit(1);
}
//------------------------------------------------------------------------------
// Scan for devices using secondary addressing.
//------------------------------------------------------------------------------
int
main(int argc, char **argv)
{
mbus_frame *frame, reply;
mbus_frame_data reply_data;
mbus_frame reply;
mbus_handle *handle = NULL;
char *host, *addr_str, matching_addr[16], *xml_result;
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 (debug)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
}
if ((handle = mbus_connect_tcp(host, port)) == NULL)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
return 1;
}
//
// init slave to get really the beginning of the records
//
frame = mbus_frame_new(MBUS_FRAME_TYPE_SHORT);
if (frame == NULL)
{
fprintf(stderr, "Failed to allocate mbus frame.\n");
return 1;
}
frame->control = MBUS_CONTROL_MASK_SND_NKE | MBUS_CONTROL_MASK_DIR_M2S;
frame->address = MBUS_ADDRESS_BROADCAST_NOREPLY;
if (debug)
printf("%s: debug: sending init frame\n", __PRETTY_FUNCTION__);
if (mbus_send_frame(handle, frame) == -1)
{
fprintf(stderr, "Failed to send mbus frame.\n");
mbus_frame_free(frame);
return 1;
}
mbus_recv_frame(handle, &reply);
char *host, *addr_str, *xml_result;
int address;
long port;
int maxframes = MAXFRAMES;
int c = 0;
if (strlen(addr_str) == 16)
memset((void *)&reply, 0, sizeof(mbus_frame));
for (c=1; c<argc-3; c++)
{
if (strcmp(argv[c], "-d") == 0)
{
debug = 1;
}
else if (strcmp(argv[c], "-f") == 0)
{
c++;
maxframes = atoi(argv[c]);
}
else
{
parse_abort(argv);
}
}
if (c > argc-3)
{
parse_abort(argv);
}
host = argv[c];
port = atol(argv[c+1]);
addr_str = argv[c+2];
if ((port < 0) || (port > 0xFFFF))
{
fprintf(stderr, "Invalid port: %ld\n", port);
return 1;
}
if ((handle = mbus_context_tcp(host, port)) == NULL)
{
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr,"Failed to setup connection to M-bus gateway\n");
mbus_context_free(handle);
return 1;
}
if (init_slaves(handle) == 0)
{
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
if (mbus_is_secondary_address(addr_str))
{
// secondary addressing
@ -106,33 +142,42 @@ main(int argc, char **argv)
if (ret == MBUS_PROBE_COLLISION)
{
fprintf(stderr, "%s: Error: The address mask [%s] matches more than one device.\n", __PRETTY_FUNCTION__, addr_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_NOTHING)
{
fprintf(stderr, "%s: Error: The selected secondary address does not match any device [%s].\n", __PRETTY_FUNCTION__, addr_str);
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
else if (ret == MBUS_PROBE_ERROR)
{
fprintf(stderr, "%s: Error: Failed to select secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
return 1;
mbus_disconnect(handle);
mbus_context_free(handle);
return 1;
}
// else MBUS_PROBE_SINGLE
address = 253;
}
address = MBUS_ADDRESS_NETWORK_LAYER;
}
else
{
// primary addressing
address = atoi(addr_str);
}
// instead of the send and recv, use this sendrecv function that
}
// 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)
if (mbus_sendrecv_request(handle, address, &reply, maxframes) != 0)
{
fprintf(stderr, "Failed to send/receive M-Bus request.\n");
mbus_disconnect(handle);
mbus_context_free(handle);
mbus_frame_free(reply.next);
return 1;
}
@ -150,13 +195,19 @@ main(int argc, char **argv)
if ((xml_result = mbus_frame_xml(&reply)) == NULL)
{
fprintf(stderr, "Failed to generate XML representation of MBUS frames: %s\n", mbus_error_str());
mbus_disconnect(handle);
mbus_context_free(handle);
mbus_frame_free(reply.next);
return 1;
}
printf("%s", xml_result);
free(xml_result);
mbus_disconnect(handle);
mbus_context_free(handle);
mbus_frame_free(reply.next);
return 0;
}

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

66
bin/mbus-tcp-request-data.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -30,22 +26,23 @@ main(int argc, char **argv)
mbus_handle *handle = NULL;
char *host, *addr_str, matching_addr[16], *xml_result;
int port, address;
int address;
long port;
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]);
host = argv[1];
port = atol(argv[2]);
addr_str = argv[3];
debug = 0;
}
else if (argc == 5 && strcmp(argv[1], "-d") == 0)
{
host = argv[2];
port = atoi(argv[3]);
host = argv[2];
port = atol(argv[3]);
addr_str = argv[4];
debug = 1;
}
@ -55,20 +52,32 @@ main(int argc, char **argv)
fprintf(stderr, " optional flag -d for debug printout\n");
return 0;
}
if ((port < 0) || (port > 0xFFFF))
{
fprintf(stderr, "Invalid port: %ld\n", port);
return 1;
}
if ((handle = mbus_context_tcp(host, port)) == NULL)
{
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if ((handle = mbus_connect_tcp(host, port)) == NULL)
if (mbus_connect(handle) == -1)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
return 1;
}
if (strlen(addr_str) == 16)
if (mbus_is_secondary_address(addr_str))
{
// secondary addressing
@ -89,33 +98,33 @@ main(int argc, char **argv)
else if (ret == MBUS_PROBE_ERROR)
{
fprintf(stderr, "%s: Error: Failed to select secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
return 1;
return 1;
}
// else MBUS_PROBE_SINGLE
if (mbus_send_request_frame(handle, 253) == -1)
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 0) == -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)
if (mbus_send_request_frame(handle, address, 1) == -1)
{
fprintf(stderr, "Failed to send M-Bus request frame.\n");
return 1;
}
}
}
if (mbus_recv_frame(handle, &reply) == -1)
if (mbus_recv_frame(handle, &reply) != MBUS_RECV_RESULT_OK)
{
fprintf(stderr, "Failed to receive M-Bus response frame.\n");
fprintf(stderr, "Failed to receive M-Bus response frame: %s\n", mbus_error_str());
return 1;
}
}
//
// parse data and print in XML format
@ -127,16 +136,16 @@ main(int argc, char **argv)
if (mbus_frame_data_parse(&reply, &reply_data) == -1)
{
fprintf(stderr, "M-bus data parse error.\n");
fprintf(stderr, "M-bus data parse error: %s\n", mbus_error_str());
return 1;
}
if ((xml_result = mbus_frame_data_xml(&reply_data)) == NULL)
{
fprintf(stderr, "Failed to generate XML representation of MBUS frame: %s\n", mbus_error_str());
return 1;
}
printf("%s", xml_result);
free(xml_result);
@ -147,6 +156,7 @@ main(int argc, char **argv)
}
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

70
bin/mbus-tcp-scan-secondary.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -25,11 +21,11 @@ static int debug = 0;
int
main(int argc, char **argv)
{
char *host, *addr_mask;
int port;
char *host, *addr_mask = NULL;
long port;
mbus_handle *handle = NULL;
mbus_frame *frame = NULL, reply;
memset((void *)&reply, 0, sizeof(mbus_frame));
if (argc != 4 && argc != 3)
@ -39,9 +35,9 @@ main(int argc, char **argv)
fprintf(stderr, "\t'FFFFFFFFFFFFFFFF' where F is a wildcard character\n");
return 0;
}
host = argv[1];
port = atoi(argv[2]);
host = argv[1];
port = atol(argv[2]);
if (argc == 4)
{
addr_mask = strdup(argv[3]);
@ -51,58 +47,64 @@ main(int argc, char **argv)
addr_mask = strdup("FFFFFFFFFFFFFFFF");
}
if (strlen(addr_mask) != 16)
if (addr_mask == NULL)
{
fprintf(stderr, "Failed to allocate address mask.\n");
return 1;
}
if ((port < 0) || (port > 0xFFFF))
{
fprintf(stderr, "Invalid port: %ld\n", port);
return 1;
}
if (mbus_is_secondary_address(addr_mask) == 0)
{
fprintf(stderr, "Misformatted secondary address mask. Must be 16 character HEX number.\n");
return 1;
}
if ((handle = mbus_connect_tcp(host, port)) == NULL)
if ((handle = mbus_context_tcp(host, port)) == NULL)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway: %s\n", mbus_error_str());
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
frame = mbus_frame_new(MBUS_FRAME_TYPE_SHORT);
if (frame == NULL)
if (mbus_connect(handle) == -1)
{
fprintf(stderr, "Failed to allocate mbus frame.\n");
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
return 1;
}
//
// init slaves
//
frame->control = MBUS_CONTROL_MASK_SND_NKE | MBUS_CONTROL_MASK_DIR_M2S;
frame->address = 0xFD;
if (debug)
printf("%s: debug: sending init frame #1\n", __PRETTY_FUNCTION__);
if (mbus_send_frame(handle, frame) == -1)
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 1) == -1)
{
fprintf(stderr, "Failed to send SND_NKE #1.\n");
mbus_frame_free(frame);
free(addr_mask);
return 1;
}
(void) mbus_recv_frame(handle, &reply);
sleep(1);
//
// resend SND_NKE, maybe the first get lost
//
if (debug)
printf("%s: debug: sending init frame #2\n", __PRETTY_FUNCTION__);
frame->control = MBUS_CONTROL_MASK_SND_NKE | MBUS_CONTROL_MASK_DIR_M2S;
frame->address = 0xFF;
if (mbus_send_frame(handle, frame) == -1)
if (mbus_send_ping_frame(handle, MBUS_ADDRESS_BROADCAST_NOREPLY, 1) == -1)
{
fprintf(stderr, "Failed to send SND_NKE #2.\n");
mbus_frame_free(frame);
free(addr_mask);
return 1;
}
(void) mbus_recv_frame(handle, &reply);
sleep(1);
mbus_scan_2nd_address_range(handle, 0, addr_mask);
mbus_disconnect(handle);
mbus_context_free(handle);
//printf("Summary: Tried %ld address masks and found %d devices.\n", probe_count, match_count);

2
bin/mbus-tcp-scan.1 Normal file
View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

184
bin/mbus-tcp-scan.c Normal file → Executable file
View File

@ -2,123 +2,159 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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)
int ping_address(mbus_handle *handle, mbus_frame *reply, int address)
{
mbus_handle *handle;
char *host;
int port, address, debug = 0;
int ret;
int i, ret = MBUS_RECV_RESULT_ERROR;
if (argc == 3)
{
host = argv[1];
port = atoi(argv[2]);
}
else if (argc == 4 && strcmp(argv[1], "-d") == 0)
{
debug = 1;
host = argv[2];
port = atoi(argv[3]);
}
else
{
printf("usage: %s [-d] host port\n", argv[0]);
return 0;
}
if (debug)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
}
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;
}
memset((void *)reply, 0, sizeof(mbus_frame));
if (debug)
printf("Scanning primary addresses:\n");
for (address = 0; address <= 250; address++)
for (i = 0; i <= handle->max_search_retry; i++)
{
mbus_frame reply;
memset((void *)&reply, 0, sizeof(mbus_frame));
if (debug)
{
printf("%d ", address);
fflush(stdout);
}
if (mbus_send_ping_frame(handle, address) == -1)
if (mbus_send_ping_frame(handle, address, 0) == -1)
{
printf("Scan failed. Could not send ping frame: %s\n", mbus_error_str());
return 1;
}
ret = mbus_recv_frame(handle, &reply);
fprintf(stderr,"Scan failed. Could not send ping frame: %s\n", mbus_error_str());
return MBUS_RECV_RESULT_ERROR;
}
if (ret == -1)
ret = mbus_recv_frame(handle, reply);
if (ret != MBUS_RECV_RESULT_TIMEOUT)
{
return ret;
}
}
return ret;
}
//------------------------------------------------------------------------------
// Primary addressing scanning of mbus devices.
//------------------------------------------------------------------------------
int
main(int argc, char **argv)
{
mbus_handle *handle;
char *host;
int address, retries = 0;
long port;
int ret;
if (argc == 3)
{
host = argv[1];
port = atol(argv[2]);
}
else if (argc == 4 && strcmp(argv[1], "-d") == 0)
{
debug = 1;
host = argv[2];
port = atol(argv[3]);
}
else if (argc == 5 && strcmp(argv[1], "-r") == 0)
{
retries = atoi(argv[2]);
host = argv[3];
port = atol(argv[4]);
}
else if (argc == 6 && strcmp(argv[1], "-d") == 0 && strcmp(argv[2], "-r") == 0)
{
debug = 1;
retries = atoi(argv[3]);
host = argv[4];
port = atol(argv[5]);
}
else
{
fprintf(stderr,"usage: %s [-d] [-r RETRIES] host port\n", argv[0]);
return 0;
}
if ((port < 0) || (port > 0xFFFF))
{
fprintf(stderr, "Invalid port: %ld\n", port);
return 1;
}
if ((handle = mbus_context_tcp(host, port)) == NULL)
{
fprintf(stderr,"Scan failed: Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (debug)
{
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr,"Scan failed: Could not setup connection to M-bus gateway: %s\n", mbus_error_str());
return 1;
}
if (mbus_context_set_option(handle, MBUS_OPTION_MAX_SEARCH_RETRY, retries) == -1)
{
fprintf(stderr,"Failed to set retry count\n");
return 1;
}
if (debug)
printf("Scanning primary addresses:\n");
for (address = 0; address <= MBUS_MAX_PRIMARY_SLAVES; address++)
{
mbus_frame reply;
ret = ping_address(handle, &reply, address);
if (ret == MBUS_RECV_RESULT_TIMEOUT)
{
continue;
}
if (debug)
printf("\n");
if (ret == -2)
if (ret == MBUS_RECV_RESULT_INVALID)
{
/* check for more data (collision) */
while (mbus_recv_frame(handle, &reply) != -1);
mbus_purge_frames(handle);
printf("Collision at address %d\n", address);
continue;
}
}
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
{
/* check for more data (collision) */
while (mbus_recv_frame(handle, &reply) != -1)
{
ret = -2;
}
if (ret == -2)
if (mbus_purge_frames(handle))
{
printf("Collision at address %d\n", address);
continue;
}
printf("Found a M-Bus device at address %d\n", address);
}
}
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

View File

@ -0,0 +1,2 @@
.so man1/libmbus.1

75
bin/mbus-tcp-select-secondary.c Normal file → Executable file
View File

@ -2,16 +2,12 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// 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>
@ -26,62 +22,80 @@ main(int argc, char **argv)
{
mbus_handle *handle;
mbus_frame reply;
char *host, *addr;
int port, ret;
char *host, *addr = NULL;
int ret;
long port;
if (argc != 4)
{
printf("usage: %s host port secondary-mbus-address\n", argv[0]);
fprintf(stderr,"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)
host = argv[1];
port = atol(argv[2]);
if ((port < 0) || (port > 0xFFFF))
{
printf("Misformatted secondary address. Must be 16 character HEX number.\n");
fprintf(stderr, "Invalid port: %ld\n", port);
return 1;
}
if ((handle = mbus_connect_tcp(host, port)) == NULL)
if ((addr = strdup(argv[3])) == NULL)
{
printf("Failed to setup connection to M-bus gateway: %s\n", mbus_error_str());
fprintf(stderr, "Failed to allocate address.\n");
return 1;
}
if (mbus_is_secondary_address(addr) == 0)
{
fprintf(stderr,"Misformatted secondary address. Must be 16 character HEX number.\n");
return 1;
}
if ((handle = mbus_context_tcp(host, port)) == NULL)
{
fprintf(stderr, "Could not initialize M-Bus context: %s\n", mbus_error_str());
return 1;
}
if (mbus_connect(handle) == -1)
{
fprintf(stderr, "Failed to setup connection to M-bus gateway\n");
return 1;
}
if (mbus_send_select_frame(handle, addr) == -1)
{
printf("Failed to send selection frame: %s\n", mbus_error_str());
return 1;
fprintf(stderr,"Failed to send selection frame: %s\n", mbus_error_str());
return 1;
}
ret = mbus_recv_frame(handle, &reply);
if (ret == -1)
if (ret == MBUS_RECV_RESULT_TIMEOUT)
{
printf("No reply from device with secondary address %s: %s\n", argv[3], mbus_error_str());
fprintf(stderr,"No reply from device with secondary address %s: %s\n", argv[3], mbus_error_str());
return 1;
}
}
if (ret == -2)
if (ret == MBUS_RECV_RESULT_INVALID)
{
printf("Invalid reply from %s: The address address probably match more than one device: %s\n", argv[3], mbus_error_str());
fprintf(stderr,"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());
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER, 0) == -1)
{
fprintf(stderr,"Failed to send request to selected secondary device: %s\n", mbus_error_str());
return 1;
}
if (mbus_recv_frame(handle, &reply) == -1)
if (mbus_recv_frame(handle, &reply) != MBUS_RECV_RESULT_OK)
{
printf("Failed to recieve reply from selected secondary device: %s\n", mbus_error_str());
fprintf(stderr,"Failed to recieve reply from selected secondary device: %s\n", mbus_error_str());
return 1;
}
@ -93,12 +107,13 @@ main(int argc, char **argv)
}
else
{
printf("Unknown reply:\n");
fprintf(stderr,"Unknown reply:\n");
mbus_frame_print(&reply);
}
free(addr);
mbus_disconnect(handle);
mbus_context_free(handle);
return 0;
}

13
build-deb.sh Normal file → Executable file
View File

@ -8,5 +8,18 @@
#
# ------------------------------------------------------------------------------
if [ ! -f Makefile ]; then
#
# regenerate automake files
#
echo "Running autotools..."
autoheader \
&& aclocal \
&& libtoolize --ltdl --copy --force \
&& automake --add-missing --copy \
&& autoconf
fi
debuild -i -us -uc -b
#sudo pbuilder build $(NAME)_$(VERSION)-1.dsc

11
build.sh Normal file → Executable file
View File

@ -10,9 +10,14 @@ else
#
# regenerate automake files
#
automake --add-missing
autoreconf --install
./configure
echo "Running autotools..."
autoheader \
&& aclocal \
&& libtoolize --ltdl --copy --force \
&& automake --add-missing --copy \
&& autoconf \
&& ./configure
fi
make

72
clean.sh Executable file
View File

@ -0,0 +1,72 @@
#!/bin/sh
set -x
true \
&& rm -f Makefile \
&& rm -f Makefile.in \
&& rm -f aclocal.m4 \
&& rm -f config.guess \
&& rm -f config.h \
&& rm -f config.h.in \
&& rm -f config.log \
&& rm -f config.status \
&& rm -f config.sub \
&& rm -f configure \
&& rm -f depcomp \
&& rm -f install-sh \
&& rm -f libmbus.pc \
&& rm -f libtool \
&& rm -f ltmain.sh \
&& rm -f missing \
&& rm -f stamp-h1 \
&& rm -f *~ \
&& rm -f -r autom4te.cache \
&& rm -f -r libltdl \
&& rm -f -r m4 \
&& rm -f -r bin/.deps \
&& rm -f -r bin/.libs \
&& rm -f bin/Makefile \
&& rm -f bin/Makefile.in \
&& rm -f bin/*.o \
&& rm -f bin/*~ \
&& rm -f bin/libmbus.1 \
&& rm -f bin/mbus-serial-request-data \
&& rm -f bin/mbus-serial-request-data-multi-reply \
&& rm -f bin/mbus-serial-scan \
&& rm -f bin/mbus-serial-scan-secondary \
&& rm -f bin/mbus-serial-select-secondary \
&& rm -f bin/mbus-serial-switch-baudrate \
&& rm -f bin/mbus-tcp-raw-send \
&& rm -f bin/mbus-tcp-request-data \
&& rm -f bin/mbus-tcp-request-data-multi-reply \
&& rm -f bin/mbus-tcp-scan \
&& rm -f bin/mbus-tcp-scan-secondary \
&& rm -f bin/mbus-tcp-select-secondary \
&& rm -f -r mbus/.deps \
&& rm -f -r mbus/.libs \
&& rm -f mbus/Makefile \
&& rm -f mbus/Makefile.in \
&& rm -f mbus/*.o \
&& rm -f mbus/*.lo \
&& rm -f mbus/*.la \
&& rm -f mbus/*~ \
&& rm -f -r test/.deps \
&& rm -f -r test/.libs \
&& rm -f test/Makefile \
&& rm -f test/Makefile.in \
&& rm -f test/*.o \
&& rm -f test/*.lo \
&& rm -f test/*.la \
&& rm -f test/*~ \
&& rm -f test/mbus_parse \
&& rm -f test/mbus_parse_hex \
&& rm -f test/mbus_unit_test1 \
&& rm -f -r debian/libmbus-dev \
&& rm -f -r debian/libmbus1 \
&& rm -f -r debian/tmp \
&& rm -f -r debian/*.log \
&& rm -f -r debian/*.substvars \
&& rm -f -r debian/*.debhelper

1517
config.guess vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,62 +0,0 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION

1760
config.sub vendored

File diff suppressed because it is too large Load Diff

14187
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -8,12 +8,15 @@ dnl info@rscada.se
dnl
dnl ----------------------------------------------------------------------------
AC_INIT([mbus], [0.8.0], [info@rscada.se], [mbus], [http://www.rscada.se/libmbus/])
LT_CONFIG_LTDL_DIR([libltdl])
AC_INIT([libmbus], [0.8.0], [info@rscada.se], [libmbus], [http://www.rscada.se/libmbus/])
AC_CONFIG_AUX_DIR([libltdl/config])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_MACRO_DIR([m4])
AM_PROG_LIBTOOL
# fix for automake 1.11 & 1.12
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LDFLAGS="$LDFLAGS -version-info 0:8:0"

12
debian/control vendored
View File

@ -1,7 +1,7 @@
Source: libmbus
Priority: extra
Maintainer: Robert Johansson <rob@raditex.nu>
Build-Depends: debhelper (>= 7.0.50~), autotools-dev, autoconf
Build-Depends: debhelper (>= 7.0.50~), dh-autoreconf
Standards-Version: 3.8.4
Section: libs
Homepage: http://www.rscada.se/libmbus
@ -20,3 +20,13 @@ Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libc6
Description: FreeSCADA M-Bus Library.
A free and open-source library for M-Bus (Meter Bus) from the rSCADA project.
Package: libmbus1-dbg
Architecture: any
Section: debug
Priority: extra
Depends: libmbus1 (= ${binary:Version}), ${misc:Depends}
Description: debugging symbols for libmbus1
A free and open-source library for M-Bus (Meter Bus) from the rSCADA project,
including debugging symbols.

2
debian/files vendored
View File

@ -1,2 +0,0 @@
libmbus-dev_0.8.0_amd64.deb libdevel extra
libmbus1_0.8.0_amd64.deb libs extra

View File

@ -2,3 +2,4 @@ usr/include/*
usr/lib/lib*.a
usr/lib/lib*.so
usr/lib/*.la
usr/lib/pkgconfig/libmbus.pc

View File

@ -1,2 +1,3 @@
usr/lib/lib*.so.*
usr/bin/*
usr/share/*

6
debian/rules vendored
View File

@ -3,7 +3,11 @@
#export DH_VERBOSE=1
%:
dh $@
dh --with autoreconf $@
.PHONY: override_dh_strip
override_dh_strip:
dh_strip --dbg-package=libmbus1-dbg
#override_dh_auto_configure:
# dh_auto_configure -- --prefix=/usr/local/freescada

630
depcomp
View File

@ -1,630 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
# Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u="sed s,\\\\\\\\,/,g"
depmode=msvisualcpp
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

144
hardware/KiCAD/MBus_USB.pro Normal file
View File

@ -0,0 +1,144 @@
update=19/07/2012 21:21:54
version=1
last_client=eeschema
[cvpcb]
version=1
NetITyp=0
NetIExt=.net
PkgIExt=.pkg
NetDir=
LibDir=
NetType=0
[cvpcb/libraries]
EquName1=devcms
[pcbnew]
version=1
PadDrlX=320
PadDimH=600
PadDimV=600
PadForm=1
PadMask=14745599
ViaDiam=450
ViaDril=250
Isol=60
Countlayer=2
Lpiste=170
RouteTo=15
RouteBo=0
TypeVia=3
Segm45=1
Racc45=1
Unite=0
SegFill=1
SegAffG=0
NewAffG=1
PadFill=1
PadAffG=1
PadSNum=1
ModAffC=0
ModAffT=0
PcbAffT=0
SgPcb45=1
TxtPcbV=800
TxtPcbH=600
TxtModV=600
TxtModH=600
TxtModW=120
HPGLnum=1
HPGdiam=15
HPGLSpd=20
HPGLrec=2
HPGLorg=0
GERBmin=15
VEgarde=100
DrawLar=150
EdgeLar=150
TxtLar=120
MSegLar=150
ForPlot=1
WpenSer=10
UserGrX=0,01
UserGrY=0,01
UserGrU=1
DivGrPc=1
TimeOut=600
MaxLnkS=3
ShowRat=0
ShowMRa=1
[pcbnew/libraries]
LibDir=
LibName1=sockets
LibName2=connect
LibName3=discret
LibName4=pin_array
LibName5=divers
LibName6=libcms
LibName7=display
LibName8=valves
LibName9=led
LibName10=dip_sockets
[general]
version=1
[eeschema]
version=1
LibDir=
NetFmt=1
HPGLSpd=20
HPGLDm=15
HPGLNum=1
offX_A4=0
offY_A4=0
offX_A3=0
offY_A3=0
offX_A2=0
offY_A2=0
offX_A1=0
offY_A1=0
offX_A0=0
offY_A0=0
offX_A=0
offY_A=0
offX_B=0
offY_B=0
offX_C=0
offY_C=0
offX_D=0
offY_D=0
offX_E=0
offY_E=0
RptD_X=0
RptD_Y=100
RptLab=1
LabSize=60
[eeschema/libraries]
LibName1=prolific
LibName2=power
LibName3=device
LibName4=transistors
LibName5=conn
LibName6=linear
LibName7=regul
LibName8=74xx
LibName9=cmos4000
LibName10=adc-dac
LibName11=memory
LibName12=xilinx
LibName13=special
LibName14=microcontrollers
LibName15=dsp
LibName16=microchip
LibName17=analog_switches
LibName18=motorola
LibName19=texas
LibName20=intel
LibName21=audio
LibName22=interface
LibName23=digital-audio
LibName24=philips
LibName25=display
LibName26=cypress
LibName27=siliconi
LibName28=opto
LibName29=atmel
LibName30=contrib
LibName31=valves

1234
hardware/KiCAD/MBus_USB.sch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
EESchema-LIBRARY Version 2.3 Date: 19/07/2012 18:59:01
#encoding utf-8
#
# PL2303
#
DEF PL2303 U 0 40 Y Y 1 F N
F0 "U" -350 700 60 H V C CNN
F1 "PL2303" 200 700 60 H V C CNN
DRAW
S -450 650 400 -750 0 1 0 N
X TxD 1 -750 600 300 R 50 50 1 1 I
X DTR_N 2 -750 500 300 R 50 50 1 1 I
X RTS_N 3 -750 400 300 R 50 50 1 1 I
X Vdd_232 4 -750 300 300 R 50 50 1 1 I
X RxD 5 -750 200 300 R 50 50 1 1 I
X RI_N 6 -750 100 300 R 50 50 1 1 I
X GND 7 -750 0 300 R 50 50 1 1 I
X Vdd 8 -750 -100 300 R 50 50 1 1 I
X DSR_N 9 -750 -200 300 R 50 50 1 1 I
X DCD_N 10 -750 -300 300 R 50 50 1 1 I
X VDD 20 700 -200 300 L 50 50 1 1 I
X CTS_N 11 -750 -400 300 R 50 50 1 1 I
X GND 21 700 -100 300 L 50 50 1 1 I
X SHTD_N 12 -750 -500 300 R 50 50 1 1 I
X TRI_MODE 22 700 0 300 L 50 50 1 1 I
X EE_CLK 13 -750 -600 300 R 50 50 1 1 I
X LD_MODE 23 700 100 300 L 50 50 1 1 I
X EE_DATA 14 -750 -700 300 R 50 50 1 1 I
X VDD_PLL 24 700 200 300 L 50 50 1 1 I
X DP 15 700 -700 300 L 50 50 1 1 I
X GND_PLL 25 700 300 300 L 50 50 1 1 I
X DM 16 700 -600 300 L 50 50 1 1 I
X PLL_TEST 26 700 400 300 L 50 50 1 1 I
X VDD_3V3 17 700 -500 300 L 50 50 1 1 I
X OSC1 27 700 500 300 L 50 50 1 1 I
X GND_3V3 18 700 -400 300 L 50 50 1 1 I
X OSC2 28 700 600 300 L 50 50 1 1 I
X RESET 19 700 -300 300 L 50 50 1 1 I
ENDDRAW
ENDDEF
#
#End Library

View File

@ -1,654 +0,0 @@
EESchema Schematic File Version 2 date 07/12/2011 21:02:04
LIBS:power
LIBS:device
LIBS:transistors
LIBS:conn
LIBS:linear
LIBS:regul
LIBS:74xx
LIBS:cmos4000
LIBS:adc-dac
LIBS:memory
LIBS:xilinx
LIBS:special
LIBS:microcontrollers
LIBS:dsp
LIBS:microchip
LIBS:analog_switches
LIBS:motorola
LIBS:texas
LIBS:intel
LIBS:audio
LIBS:interface
LIBS:digital-audio
LIBS:philips
LIBS:display
LIBS:cypress
LIBS:siliconi
LIBS:opto
LIBS:atmel
LIBS:contrib
LIBS:valves
LIBS:MBus-cache
EELAYER 25 0
EELAYER END
$Descr A4 11700 8267
encoding utf-8
Sheet 1 1
Title ""
Date "7 dec 2011"
Rev ""
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
Text Notes 5550 2900 0 60 ~ 0
approx 34V
Text Notes 1300 1600 0 60 ~ 0
Optional external\npower supply
Text Notes 9700 3150 0 60 ~ 0
MBus
Text Label 8900 3250 0 60 ~ 0
MBus-
Wire Wire Line
9200 3250 8900 3250
Wire Wire Line
8900 3250 8900 3500
Connection ~ 8700 3500
Wire Wire Line
8900 3500 8700 3500
Connection ~ 7700 2900
Wire Wire Line
7700 2950 7700 2900
Wire Wire Line
5450 3050 5450 2900
Wire Wire Line
5450 2900 8900 2900
Wire Wire Line
8900 2900 8900 3050
Wire Wire Line
6050 4050 5750 4050
Wire Wire Line
5750 4050 5750 5050
Wire Wire Line
5750 5050 3500 5050
Wire Wire Line
3550 5300 3550 5250
Wire Wire Line
3550 5250 3500 5250
Wire Wire Line
2700 3200 2700 1800
Wire Wire Line
2150 1800 2250 1800
Connection ~ 7700 3900
Wire Wire Line
7700 3950 7700 3450
Wire Wire Line
6600 4050 6550 4050
Connection ~ 7300 3750
Wire Wire Line
6900 4250 6900 4450
Wire Wire Line
7700 4450 7700 4550
Wire Wire Line
8350 4150 8500 4150
Connection ~ 8700 4000
Wire Wire Line
8700 4000 8500 4000
Wire Wire Line
8700 3950 8700 4050
Connection ~ 5450 3900
Wire Wire Line
5400 3900 5450 3900
Connection ~ 2700 2200
Wire Wire Line
2650 2200 2700 2200
Wire Wire Line
2400 2400 2400 2350
Wire Wire Line
2400 2350 2700 2350
Wire Wire Line
3775 2975 3775 2950
Connection ~ 3775 3600
Wire Wire Line
3775 3575 3775 3600
Wire Wire Line
3550 3600 3850 3600
Connection ~ 3600 3900
Wire Wire Line
3650 3900 3550 3900
Connection ~ 4750 3900
Wire Wire Line
5450 4400 5450 4500
Wire Wire Line
3600 4450 3600 4500
Connection ~ 1800 3200
Wire Wire Line
1800 3200 1950 3200
Wire Wire Line
3550 3500 3600 3500
Wire Wire Line
3600 3500 3600 3200
Wire Wire Line
3600 3200 3550 3200
Wire Wire Line
3050 3200 3000 3200
Wire Wire Line
3000 3200 3000 2950
Wire Wire Line
1800 3550 1800 2950
Wire Wire Line
1800 4300 1800 4350
Wire Wire Line
2700 3200 2450 3200
Wire Wire Line
1850 3850 1800 3850
Wire Wire Line
1800 3850 1800 3900
Wire Wire Line
2700 4200 2700 4350
Connection ~ 3000 2950
Wire Wire Line
1800 3550 1850 3550
Wire Wire Line
3600 3900 3600 3950
Wire Wire Line
4750 4400 4750 4500
Wire Wire Line
4800 3900 4700 3900
Wire Wire Line
4200 3900 4150 3900
Wire Wire Line
3600 3800 3600 3750
Wire Wire Line
3600 3750 3550 3750
Wire Wire Line
4250 3600 4750 3600
Wire Wire Line
4750 3600 4750 4000
Wire Wire Line
1800 2950 3775 2950
Wire Wire Line
2400 2800 2400 2850
Wire Wire Line
2700 1800 2650 1800
Connection ~ 2700 2350
Wire Wire Line
5450 3550 5450 4000
Wire Wire Line
8700 3550 8700 3450
Wire Wire Line
8700 4550 8700 4600
Wire Wire Line
8050 4350 8050 4550
Wire Wire Line
7300 4350 7300 4450
Wire Wire Line
7300 3450 7300 3850
Wire Wire Line
8050 3950 8050 3900
Wire Wire Line
8400 3750 6900 3750
Wire Wire Line
6900 3750 6900 3850
Wire Wire Line
8500 4000 8500 4150
Wire Wire Line
8050 3900 7500 3900
Wire Wire Line
7500 3900 7500 4650
Wire Wire Line
7500 4650 6550 4650
Wire Wire Line
2150 2000 2200 2000
Wire Wire Line
2200 2000 2200 2050
Wire Wire Line
3500 4950 3550 4950
Wire Wire Line
3550 4950 3550 4750
Wire Wire Line
3550 4750 3500 4750
Wire Wire Line
2900 4750 1450 4750
Wire Wire Line
1450 4750 1450 2200
Wire Wire Line
1450 2200 2250 2200
Wire Wire Line
3500 5150 5950 5150
Wire Wire Line
5950 5150 5950 4650
Wire Wire Line
5950 4650 6050 4650
Wire Wire Line
7300 2950 7300 2900
Connection ~ 7300 2900
Wire Wire Line
8700 2950 8700 2900
Connection ~ 8700 2900
Wire Wire Line
8900 3050 9200 3050
Text Label 8900 3050 0 60 ~ 0
MBus+
Text Label 3550 5150 0 60 ~ 0
RxD (receive from MBus)
Text Label 3550 5050 0 60 ~ 0
TxD (send to MBus)
Text Label 3550 5250 0 60 ~ 0
USB GND
Text Label 3550 4950 0 60 ~ 0
USB +5V
Text Notes 2000 5050 0 60 ~ 0
To USB serial adapter\n(e.g. PL2303,\nwith 3.3V/5V levels)
$Comp
L CONN_2 P1
U 1 1 4EAA8D88
P 1800 1900
F 0 "P1" V 1750 1900 40 0000 C CNN
F 1 "CONN_2" V 1850 1900 40 0000 C CNN
1 1800 1900
-1 0 0 -1
$EndComp
$Comp
L CONN_2 P3
U 1 1 4EAA8D6F
P 9550 3150
F 0 "P3" V 9500 3150 40 0000 C CNN
F 1 "CONN_2" V 9600 3150 40 0000 C CNN
1 9550 3150
1 0 0 -1
$EndComp
$Comp
L GND #PWR2
U 1 1 4EAA8D62
P 2200 2050
F 0 "#PWR2" H 2200 2050 30 0001 C CNN
F 1 "GND" H 2200 1980 30 0001 C CNN
1 2200 2050
1 0 0 -1
$EndComp
$Comp
L GND #PWR5
U 1 1 4EAA8D58
P 3550 5300
F 0 "#PWR5" H 3550 5300 30 0001 C CNN
F 1 "GND" H 3550 5230 30 0001 C CNN
1 3550 5300
1 0 0 -1
$EndComp
$Comp
L INDUCTOR L1
U 1 1 4EAA8D47
P 3200 4750
F 0 "L1" V 3150 4750 40 0000 C CNN
F 1 "INDUCTOR" V 3300 4750 40 0000 C CNN
1 3200 4750
0 -1 -1 0
$EndComp
$Comp
L CONN_4 P2
U 1 1 4EAA8D01
P 3150 5100
F 0 "P2" V 3100 5100 50 0000 C CNN
F 1 "CONN_4" V 3200 5100 50 0000 C CNN
1 3150 5100
-1 0 0 -1
$EndComp
$Comp
L GND #PWR11
U 1 1 4EAA8A6A
P 7300 4450
F 0 "#PWR11" H 7300 4450 30 0001 C CNN
F 1 "GND" H 7300 4380 30 0001 C CNN
1 7300 4450
1 0 0 -1
$EndComp
$Comp
L GND #PWR12
U 1 1 4EAA8A65
P 7700 4550
F 0 "#PWR12" H 7700 4550 30 0001 C CNN
F 1 "GND" H 7700 4480 30 0001 C CNN
1 7700 4550
1 0 0 -1
$EndComp
$Comp
L GND #PWR10
U 1 1 4EAA8A62
P 6900 4450
F 0 "#PWR10" H 6900 4450 30 0001 C CNN
F 1 "GND" H 6900 4380 30 0001 C CNN
1 6900 4450
1 0 0 -1
$EndComp
$Comp
L GND #PWR13
U 1 1 4EAA8A5F
P 8050 4550
F 0 "#PWR13" H 8050 4550 30 0001 C CNN
F 1 "GND" H 8050 4480 30 0001 C CNN
1 8050 4550
1 0 0 -1
$EndComp
$Comp
L GND #PWR14
U 1 1 4EAA8A57
P 8700 4600
F 0 "#PWR14" H 8700 4600 30 0001 C CNN
F 1 "GND" H 8700 4530 30 0001 C CNN
1 8700 4600
1 0 0 -1
$EndComp
$Comp
L R R7
U 1 1 4EAA8A32
P 6300 4650
F 0 "R7" V 6380 4650 50 0000 C CNN
F 1 "1k" V 6300 4650 50 0000 C CNN
1 6300 4650
0 -1 -1 0
$EndComp
$Comp
L R R11
U 1 1 4EAA8A2E
P 7700 4200
F 0 "R11" V 7780 4200 50 0000 C CNN
F 1 "3k3" V 7700 4200 50 0000 C CNN
1 7700 4200
1 0 0 -1
$EndComp
$Comp
L R R9
U 1 1 4EAA8A2B
P 7300 4100
F 0 "R9" V 7380 4100 50 0000 C CNN
F 1 "22k" V 7300 4100 50 0000 C CNN
1 7300 4100
1 0 0 -1
$EndComp
$Comp
L R R6
U 1 1 4EAA8A29
P 6300 4050
F 0 "R6" V 6380 4050 50 0000 C CNN
F 1 "1k" V 6300 4050 50 0000 C CNN
1 6300 4050
0 -1 -1 0
$EndComp
$Comp
L R R13
U 1 1 4EAA8A22
P 8700 4300
F 0 "R13" V 8780 4300 50 0000 C CNN
F 1 "82" V 8700 4300 50 0000 C CNN
1 8700 4300
1 0 0 -1
$EndComp
$Comp
L R R8
U 1 1 4EAA8A1F
P 7300 3200
F 0 "R8" V 7380 3200 50 0000 C CNN
F 1 "39k" V 7300 3200 50 0000 C CNN
1 7300 3200
1 0 0 -1
$EndComp
$Comp
L R R10
U 1 1 4EAA8A1D
P 7700 3200
F 0 "R10" V 7780 3200 50 0000 C CNN
F 1 "33k" V 7700 3200 50 0000 C CNN
1 7700 3200
1 0 0 -1
$EndComp
$Comp
L R R12
U 1 1 4EAA8A07
P 8700 3200
F 0 "R12" V 8780 3200 50 0000 C CNN
F 1 "220k" V 8700 3200 50 0000 C CNN
1 8700 3200
1 0 0 -1
$EndComp
$Comp
L BC237 Q2
U 1 1 4EAA89E3
P 8150 4150
F 0 "Q2" H 8350 4050 50 0000 C CNN
F 1 "BC337" H 8400 4300 50 0000 C CNN
F 2 "TO92-EBC" H 8340 4150 30 0001 C CNN
1 8150 4150
-1 0 0 -1
$EndComp
$Comp
L DIODE D1
U 1 1 4EAA899B
P 2450 1800
F 0 "D1" H 2450 1900 40 0000 C CNN
F 1 "DIODE" H 2450 1700 40 0000 C CNN
1 2450 1800
1 0 0 -1
$EndComp
$Comp
L GND #PWR3
U 1 1 4EAA895D
P 2400 2850
F 0 "#PWR3" H 2400 2850 30 0001 C CNN
F 1 "GND" H 2400 2780 30 0001 C CNN
1 2400 2850
1 0 0 -1
$EndComp
$Comp
L GND #PWR9
U 1 1 4EAA88DA
P 5450 4500
F 0 "#PWR9" H 5450 4500 30 0001 C CNN
F 1 "GND" H 5450 4430 30 0001 C CNN
1 5450 4500
1 0 0 -1
$EndComp
$Comp
L GND #PWR8
U 1 1 4EAA88D5
P 4750 4500
F 0 "#PWR8" H 4750 4500 30 0001 C CNN
F 1 "GND" H 4750 4430 30 0001 C CNN
1 4750 4500
1 0 0 -1
$EndComp
$Comp
L GND #PWR6
U 1 1 4EAA888F
P 3600 3800
F 0 "#PWR6" H 3600 3800 30 0001 C CNN
F 1 "GND" H 3600 3730 30 0001 C CNN
1 3600 3800
1 0 0 -1
$EndComp
$Comp
L DIODESCH D3
U 1 1 4EAA8633
P 4050 3600
F 0 "D3" H 4050 3700 40 0000 C CNN
F 1 "DIODESCH" H 4050 3500 40 0000 C CNN
1 4050 3600
1 0 0 -1
$EndComp
$Comp
L DIODE D2
U 1 1 4EAA862B
P 2450 2200
F 0 "D2" H 2450 2300 40 0000 C CNN
F 1 "DIODE" H 2450 2100 40 0000 C CNN
1 2450 2200
1 0 0 -1
$EndComp
$Comp
L INDUCTOR L3
U 1 1 4EAA8616
P 5100 3900
F 0 "L3" V 5050 3900 40 0000 C CNN
F 1 "INDUCTOR" V 5200 3900 40 0000 C CNN
1 5100 3900
0 -1 -1 0
$EndComp
$Comp
L INDUCTOR L2
U 1 1 4EAA860E
P 3775 3275
F 0 "L2" V 3725 3275 40 0000 C CNN
F 1 "150uH" V 3875 3275 40 0000 C CNN
1 3775 3275
1 0 0 -1
$EndComp
$Comp
L FUSE F1
U 1 1 4EAA8605
P 5450 3300
F 0 "F1" H 5550 3350 40 0000 C CNN
F 1 "FUSE" H 5350 3250 40 0000 C CNN
1 5450 3300
0 -1 -1 0
$EndComp
$Comp
L CP1 C3
U 1 1 4EAA85ED
P 4750 4200
F 0 "C3" H 4800 4300 50 0000 L CNN
F 1 "47u" H 4800 4100 50 0000 L CNN
1 4750 4200
1 0 0 -1
$EndComp
$Comp
L CP1 C4
U 1 1 4EAA85E6
P 5450 4200
F 0 "C4" H 5500 4300 50 0000 L CNN
F 1 "47u" H 5500 4100 50 0000 L CNN
1 5450 4200
1 0 0 -1
$EndComp
$Comp
L CP1 C2
U 1 1 4EAA85E2
P 2400 2600
F 0 "C2" H 2450 2700 50 0000 L CNN
F 1 "22u / 50V" H 2450 2500 50 0000 L CNN
1 2400 2600
1 0 0 -1
$EndComp
$Comp
L R R2
U 1 1 4EAA85C4
P 3300 3200
F 0 "R2" V 3380 3200 50 0000 C CNN
F 1 "180" V 3300 3200 50 0000 C CNN
1 3300 3200
0 -1 -1 0
$EndComp
$Comp
L R R1
U 1 1 4EAA85BA
P 2200 3200
F 0 "R1" V 2280 3200 50 0000 C CNN
F 1 "0.47" V 2200 3200 50 0000 C CNN
1 2200 3200
0 1 1 0
$EndComp
$Comp
L GND #PWR7
U 1 1 4EAA85A1
P 3600 4500
F 0 "#PWR7" H 3600 4500 30 0001 C CNN
F 1 "GND" H 3600 4430 30 0001 C CNN
1 3600 4500
1 0 0 -1
$EndComp
$Comp
L GND #PWR1
U 1 1 4EAA8599
P 1800 4350
F 0 "#PWR1" H 1800 4350 30 0001 C CNN
F 1 "GND" H 1800 4280 30 0001 C CNN
1 1800 4350
1 0 0 -1
$EndComp
$Comp
L C C1
U 1 1 4EAA8585
P 1800 4100
F 0 "C1" H 1850 4200 50 0000 L CNN
F 1 "330p" H 1850 4000 50 0000 L CNN
1 1800 4100
1 0 0 -1
$EndComp
$Comp
L R R5
U 1 1 4EAA8565
P 4450 3900
F 0 "R5" V 4530 3900 50 0000 C CNN
F 1 "22k" V 4450 3900 50 0000 C CNN
1 4450 3900
0 1 1 0
$EndComp
$Comp
L R R4
U 1 1 4EAA855B
P 3900 3900
F 0 "R4" V 3980 3900 50 0000 C CNN
F 1 "100k" V 3900 3900 50 0000 C CNN
1 3900 3900
0 1 1 0
$EndComp
$Comp
L R R3
U 1 1 4EAA8543
P 3600 4200
F 0 "R3" V 3680 4200 50 0000 C CNN
F 1 "4k7" V 3600 4200 50 0000 C CNN
1 3600 4200
1 0 0 -1
$EndComp
$Comp
L GND #PWR4
U 1 1 4EAA84C7
P 2700 4350
F 0 "#PWR4" H 2700 4350 30 0001 C CNN
F 1 "GND" H 2700 4280 30 0001 C CNN
1 2700 4350
1 0 0 -1
$EndComp
$Comp
L MC34063 U1
U 1 1 4EAA8411
P 2700 3700
F 0 "U1" H 2850 4050 60 0000 L CNN
F 1 "MC34063" H 2800 3350 60 0000 L CNN
1 2700 3700
1 0 0 -1
$EndComp
$Comp
L BC307 Q3
U 1 1 4EAA83EE
P 8600 3750
F 0 "Q3" H 8800 3650 50 0000 C CNN
F 1 "BD136" H 8850 3900 50 0000 C CNN
1 8600 3750
1 0 0 1
$EndComp
$Comp
L BC237 Q1
U 1 1 4EAA83E1
P 6800 4050
F 0 "Q1" H 7000 3950 50 0000 C CNN
F 1 "BC337" H 7050 4200 50 0000 C CNN
F 2 "TO92-EBC" H 6990 4050 30 0001 C CNN
1 6800 4050
1 0 0 -1
$EndComp
$EndSCHEMATC

Binary file not shown.

View File

@ -3,22 +3,21 @@ The convertor is very simple - there are three main parts:
- power Voltage converter
- USB serial converter
Voltage converter - "catalogue" use of MC34063 in step-up configuration set for about 34V output voltage and few tens of mA. You can use any other IC/setup which would do the job. Note that if you use other voltage output than 34V (note tha MBus limits) you need to adjust the voltage divider (see below) or use 12V Zener diode instead of R9.
Voltage converter - "catalogue" use of MC34063 in step-up configuration set for about 34V output voltage and few tens of mA. You can use any other IC/setup which would do the job. Note that if you use other voltage output than 34V (note the MBus limits) you need to adjust the voltage divider (see below) or use 12V Zener diode instead of R9.
MBus level converter - it is based on the original design from Uni Paderborn (http://www.m-bus.com/files/minimaster.tif or http://www.m-bus.de/pw1.shtml). It was just "inverted" to use common ground and low voltage IO signals. Also the 12V output voltage drop is done by simple divider (R9/R8) which is OK here (stable voltage, current is amplified).
Basically no part of the convertor is critical - except of the 12V diff (see above) and current sensing R12.
The USB serial convertor is not covered here in much detail as it does not make sense to build one. Get a USB serial cable - ideal one is an old phone data cable as these are without the RS232 level convertor (i.e. exactly what we want).
The USB serial convertor is not covered here as it does not make sense to make one. Get a USB serial cable - ideal one is an old phone data cable as these are without the RS232 level convertor (i.e. exactly what we want).
One sidenote explanation. Typical USB RS232 cable contains two main chips: USB to TTL/CMOS serial converter (this is the "smart" one - e.g. variants of FT232 or PL2303) and TTL/CMOS to RS232 voltage converter (variants of MAX232). We need just the first part as we have our own voltage converter - here CMOS/TTL to MBus instead.
One sidenote explanation. Typical USB RS232 cable contains two main chips: USB to TTL/CMOS serial converter (this is the "smart" one - e.g. variants of FTDI Chip FT232 or Prolific PL2303) and TTL/CMOS to RS232 voltage converter (variants of MAX232). We need just the first part as we have our own voltage converter - here CMOS/TTL to MBus instead.
Or you can buy this as a module.
The bottom line is - get either a cable which does not have the RS232 converter or a cable which can be easily opened/dissected and the converter bypassed.
Finally a small disclaimer - this is for educational purposes, there is no warranty of any sort.
From technical perspective this works only for few slaves as it is only a simple converter and the power is very limited as well.
Finally the disclaimer - this is for educational purposes, there is no warranty of any sort.
From technical perspective this works only for few slaves as it is only a simple converter and the power is very limited as well. Tested with the bus of few tens of meters with speed up to 9600Bd with no problems.
Contributed by Tomas Menzl.

View File

@ -1,520 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -8,5 +8,5 @@ Description: Open source M-bus (Meter-Bus) library.
Requires:
Version: @PACKAGE_VERSION@
URL: http://www.rscada.se/libmbus/
Libs: -L${libdir} -lmbus
Libs: -L${libdir} -lmbus -lm
Cflags: -I${includedir}

84
libmbus.spec Normal file
View File

@ -0,0 +1,84 @@
#
# spec file for package libmbus
#
# Copyright (c) 2010-2013, Raditex Control AB
# All rights reserved.
#
# rSCADA
# http://www.rSCADA.se
# info@rscada.se
#
Summary: Open source M-bus (Meter-Bus) library
Name: libmbus
Version: 0.8.0
Release: 1
Source: http://www.rscada.se/public-dist/%{name}-%{version}.tar.gz
URL: http://www.rscada.se/libmbus/
License: BSD
Vendor: Raditex Control AB
Packager: Stefan Wahren <info@lategoodbye.de>
Group: Development/Languages/C and C++
BuildRoot: {_tmppath}/%{name}-%{version}-build
AutoReqProv: on
%description
libmbus: M-bus Library from Raditex Control (http://www.rscada.se)
libmbus is an open source library for the M-bus (Meter-Bus) protocol.
The Meter-Bus is a standard for reading out meter data from electricity meters,
heat meters, gas meters, etc. The M-bus standard deals with both the electrical
signals on the M-Bus, and the protocol and data format used in transmissions
on the M-Bus. The role of libmbus is to decode/encode M-bus data, and to handle
the communication with M-Bus devices.
For more information see http://www.rscada.se/libmbus
%package devel
License: BSD
Summary: Development libraries and header files for using the M-bus library
Group: Development/Libraries/C and C++
AutoReqProv: on
Requires: %{name} = %{version}
%description devel
This package contains all necessary include files and libraries needed
to compile and link applications which use the M-bus (Meter-Bus) library.
%prep -q
%setup -q
# workaround to get it's build
autoreconf
%build
./configure --prefix=/usr
make
%install
rm -Rf "%buildroot"
mkdir "%buildroot"
make install DESTDIR="%buildroot"
%clean
rm -rf "%buildroot"
%files
%defattr (-,root,root)
%doc COPYING README
%{_bindir}/mbus-serial-*
%{_bindir}/mbus-tcp-*
%{_libdir}/libmbus.so*
# man pages doesn't exist in this version
# %{_mandir}/man1/libmbus.1
# %{_mandir}/man1/mbus-*
%files devel
%defattr (-,root,root)
%{_includedir}/mbus
%{_libdir}/libmbus.a
%{_libdir}/libmbus.la
%{_libdir}/pkgconfig/libmbus.pc
%changelog
* Fri Mar 29 2013 Stefan Wahren <info@lategoodbye.de> - 0.8.0-1
- Initial package based on the last official release

9642
ltmain.sh

File diff suppressed because it is too large Load Diff

7851
m4/libtool.m4 vendored

File diff suppressed because it is too large Load Diff

369
m4/ltoptions.m4 vendored
View File

@ -1,369 +0,0 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file 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.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[pic_mode="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

123
m4/ltsugar.m4 vendored
View File

@ -1,123 +0,0 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file 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.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

23
m4/ltversion.m4 vendored
View File

@ -1,23 +0,0 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file 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.
# @configure_input@
# serial 3293 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4])
m4_define([LT_PACKAGE_REVISION], [1.3293])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4'
macro_revision='1.3293'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

98
m4/lt~obsolete.m4 vendored
View File

@ -1,98 +0,0 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file 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.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

View File

@ -12,7 +12,9 @@ VERSION = @VERSION@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
pkginclude_HEADERS = mbus.h mbus-protocol.h mbus-tcp.h mbus-serial.h mbus-protocol-aux.h
includedir = $(prefix)/include/mbus
include_HEADERS = mbus.h mbus-protocol.h mbus-tcp.h mbus-serial.h mbus-protocol-aux.h
lib_LTLIBRARIES = libmbus.la
libmbus_la_SOURCES = mbus.c mbus-protocol.c mbus-tcp.c mbus-serial.c mbus-protocol-aux.c

1316
mbus/mbus-protocol-aux.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

323
mbus/mbus-protocol-aux.h Normal file → Executable file
View File

@ -2,7 +2,7 @@
// Copyright (C) 2011, Robert Johansson and contributors, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
@ -13,16 +13,20 @@
/**
* @file mbus-protocol-aux.h
*
*
* @brief Auxiliary functions to the Freescada libmbus library
*
*
* The idea is to simplify the basic task of querying MBus slaves and
* the data processing.
* Typical use might be (in oversimplified "pseudocode"):
* \verbatim
* mbus_handle = mbus_connect_serial(device);
* mbus_handle = mbus_context_serial(device);
* or
* mbus_handle = mbus_connect_tcp(host, port);
* mbus_handle = mbus_context_tcp(host, port);
*
* mbus_context_set_option(mbus_handle,option,value); // optional
*
* mbus_connect(mbus_handle);
*
* ...
*
@ -45,6 +49,7 @@
* ...
*
* mbus_disconnect(mbus_handle);
* mbus_context_free(mbus_handle);
* \endverbatim
*
* Note that the quantity values are partially "normalized". For example energy
@ -60,29 +65,42 @@
#ifndef __MBUS_PROTOCOL_AUX_H__
#define __MBUS_PROTOCOL_AUX_H__
#include <mbus/mbus.h>
#include <mbus/mbus-protocol.h>
#include <mbus/mbus-serial.h>
#include <mbus/mbus-tcp.h>
#include "mbus-protocol.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MBUS_PROBE_NOTHING 0
#define MBUS_PROBE_SINGLE 1
#define MBUS_PROBE_COLLISION 2
#define MBUS_PROBE_ERROR -1
#define MBUS_FRAME_PURGE_S2M 2
#define MBUS_FRAME_PURGE_M2S 1
#define MBUS_FRAME_PURGE_NONE 0
/**
* Unified MBus handle type encapsulating either Serial or TCP gateway.
*/
typedef struct _mbus_handle {
char is_serial; /**< _handle type (non zero for serial) */
union {
mbus_tcp_handle * m_tcp_handle; /**< TCP gateway handle */
mbus_serial_handle * m_serial_handle; /**< Serial gateway handle */
};
int fd;
int max_data_retry;
int max_search_retry;
char purge_first_frame;
char is_serial; /**< _handle type (non zero for serial) */
int (*open) (struct _mbus_handle *handle);
int (*close) (struct _mbus_handle *handle);
int (*send) (struct _mbus_handle *handle, mbus_frame *frame);
int (*recv) (struct _mbus_handle *handle, mbus_frame *frame);
void (*free_auxdata) (struct _mbus_handle *handle);
void (*recv_event) (unsigned char src_type, const char *buff, size_t len);
void (*send_event) (unsigned char src_type, const char *buff, size_t len);
void (*scan_progress) (struct _mbus_handle *handle, const char *mask);
void (*found_event) (struct _mbus_handle *handle, mbus_frame *frame);
void *auxdata;
} mbus_handle;
/**
* MBus slave address type (primary/secodary address)
*/
@ -125,276 +143,365 @@ typedef struct _mbus_record {
char *unit; /**< Quantity unit (e.g. Wh) */
char *function_medium; /**< Quantity medium or function (e.g. Electricity) */
char *quantity; /**< Quantity type (e.g. Energy) */
int device; /**< Quantity device */
long tariff; /**< Quantity tariff */
long storage_number; /**< Quantity storage number */
} mbus_record;
/**
* Event callback functions
* MBus handle option enumeration
*/
extern void (*_mbus_scan_progress)(mbus_handle * handle, const char *mask);
extern void (*_mbus_found_event)(mbus_handle * handle, mbus_frame *frame);
typedef enum _mbus_context_option {
MBUS_OPTION_MAX_DATA_RETRY, /**< option defines the maximum attempts of data request retransmission */
MBUS_OPTION_MAX_SEARCH_RETRY, /**< option defines the maximum attempts of search request retransmission */
MBUS_OPTION_PURGE_FIRST_FRAME /**< option controls the echo cancelation for mbus_recv_frame */
} mbus_context_option;
/**
* Event register functions
*/
void mbus_register_scan_progress(void (*event)(mbus_handle * handle, const char *mask));
void mbus_register_found_event(void (*event)(mbus_handle * handle, mbus_frame *frame));
//
// Event register functions
//
void mbus_register_recv_event(mbus_handle *handle, void (*event)(unsigned char src_type, const char *buff, size_t len));
void mbus_register_send_event(mbus_handle *handle, void (*event)(unsigned char src_type, const char *buff, size_t len));
void mbus_register_scan_progress(mbus_handle *handle, void (*event)(mbus_handle *handle, const char *mask));
void mbus_register_found_event(mbus_handle *handle, void (*event)(mbus_handle *handle, mbus_frame *frame));
/**
* Connects to serial gateway and initializes MBus handle
*
/**
* Allocate and initialize M-Bus serial context.
*
* @param device Serial device (like /dev/ttyUSB0 or /dev/ttyS0)
*
*
* @return Initialized "unified" handler when successful, NULL otherwise;
*/
mbus_handle * mbus_connect_serial(const char * device);
mbus_handle * mbus_context_serial(const char *device);
/**
* Connects to TCP gateway and initializes MBus handle
*
/**
* Allocate and initialize M-Bus TCP context.
*
* @param host Gateway host
* @param port Gateway port
*
*
* @return Initialized "unified" handler when successful, NULL otherwise;
*/
mbus_handle * mbus_connect_tcp(const char *host, int port);
mbus_handle * mbus_context_tcp(const char *host, uint16_t port);
/**
* Disconnects the "unified" handle.
*
/**
* Deallocate memory used by M-Bus context.
*
* @param handle Initialized handle
*
*
*/
void mbus_context_free(mbus_handle * handle);
/**
* Connect to serial bus or TCP gateway depending on context.
*
* @param handle Initialized handle
*
* @return Zero when successful.
*/
int mbus_connect(mbus_handle * handle);
/**
* Disconnects the "unified" handle.
*
* @param handle Initialized handle
*
* @return Zero when successful.
*/
int mbus_disconnect(mbus_handle * handle);
/**
/**
* Set option of a M-Bus context.
*
* @param handle Initialized handle
* @param option option to set
* @param value value to set
*
* @return Zero when successful.
*/
int mbus_context_set_option(mbus_handle * handle, mbus_context_option option, long value);
/**
* Receives a frame using "unified" handle
*
*
* @param handle Initialized handle
* @param frame Received frame
*
*
* @return Zero when successful.
*/
int mbus_recv_frame(mbus_handle * handle, mbus_frame *frame);
/**
/**
* Used for handling collisions. Blocks as long as receiving frames or corrupted data.
*
* @param handle Initialized handle
*
* @return Zero when nothing received, one otherwise.
*/
int mbus_purge_frames(mbus_handle * handle);
/**
* Sends frame using "unified" handle
*
*
* @param handle Initialized handle
* @param frame Frame to send
*
*
* @return Zero when successful.
*/
int mbus_send_frame(mbus_handle * handle, mbus_frame *frame);
/**
* Sends secodary address selection frame using "unified" handle
*
/**
* Sends secondary address selection frame using "unified" handle
*
* @param handle Initialized handle
* @param secondary_addr_str Secondary address
*
*
* @return Zero when successful.
*/
int mbus_send_select_frame(mbus_handle * handle, const char *secondary_addr_str);
/**
/**
* Sends application reset to given slave using "unified" handle
*
* @param handle Initialized handle
* @param address Address (0-255)
* @param subcode Subcode (0-255) or no subcode (-1)
*
* @return Zero when successful.
*/
int mbus_send_application_reset_frame(mbus_handle * handle, int address, int subcode);
/**
* Sends switch baudrate frame using "unified" handle
*
*
* @param handle Initialized handle
* @param address Address (0-255)
* @param baudrate Baudrate (300,600,1200,2400,4800,9600,19200,38400)
*
*
* @return Zero when successful.
*/
int mbus_send_switch_baudrate_frame(mbus_handle * handle, int address, int baudrate);
int mbus_send_switch_baudrate_frame(mbus_handle * handle, int address, long baudrate);
/**
* Sends request frame to given slave using "unified" handle
*
* @param handle Initialized handle
* @param address Address (0-255)
*
/**
* Sends request frame (REQ_UD2) to given slave using "unified" handle
*
* @param handle Initialized handle
* @param address Address (0-255)
* @param frame_count_bit Frame Count Bit (0-1)
*
* @return Zero when successful.
*/
int mbus_send_request_frame(mbus_handle * handle, int address);
int mbus_send_request_frame(mbus_handle * handle, int address, char frame_count_bit);
/**
/**
* Sends user data frame (SND_UD) to given slave using "unified" handle
*
* @param handle Initialized handle
* @param address Address (0-255)
* @param data User data
* @param data_size Byte count of user data
*
* @return Zero when successful.
*/
int mbus_send_user_data_frame(mbus_handle * handle, int address, const unsigned char *data, size_t data_size);
/**
* Sends a request and read replies until no more records available
* or limit is reached.
*
*
* @param handle Initialized handle
* @param address Address (0-255)
* @param reply pointer to an mbus frame for the reply
* @param max_frames limit of frames to readout (0 = no limit)
*
*
* @return Zero when successful.
*/
int mbus_sendrecv_request(mbus_handle *handle, int address, mbus_frame *reply, int max_frames);
/**
/**
* Sends ping frame to given slave using "unified" handle
*
* @param handle Initialized handle
* @param address Address (0-255)
*
*
* @param handle Initialized handle
* @param address Address (0-255)
* @param purge_response Response flag (=0 don't receive response, >0 purge response)
*
* @return Zero when successful.
*/
int mbus_send_ping_frame(mbus_handle *handle, int address);
int mbus_send_ping_frame(mbus_handle *handle, int address, char purge_response);
/**
/**
* Select slave by secondary address using "unified" handle
*
*
* @param handle Initialized handle
* @param mask Address/mask to select
*
*
* @return See MBUS_PROBE_* constants
*/
int mbus_select_secondary_address(mbus_handle * handle, const char *mask);
/**
/**
* Probe/address slave by secondary address using "unified" handle
*
*
* @param handle Initialized handle
* @param mask Address/mask to probe
* @param matching_addr Matched address (the buffer has tobe at least 16 bytes)
*
*
* @return See MBUS_PROBE_* constants
*/
int mbus_probe_secondary_address(mbus_handle * handle, const char *mask, char *matching_addr);
/**
/**
* Read data from given slave using "unified" handle and address types
*
*
* @param handle Initialized handle
* @param address Address of the slave
* @param reply Reply from the slave
*
*
* @return Zero when successful.
*/
int mbus_read_slave(mbus_handle *handle, mbus_address *address, mbus_frame *reply);
/**
/**
* Allocate new data record. Use #mbus_record_free when finished.
*
*
* @return pointer to the new record, NULL when failed
*/
mbus_record * mbus_record_new();
/**
/**
* Destructor for mbus_record
*
*
* @param rec record to be freed
*/
void mbus_record_free(mbus_record *rec);
/**
/**
* Create/parse single counter from the fixed data structure
*
*
* @param statusByte status byte
* @param medium_unit_byte medium/unit byte
* @param data pointer to the data counter (4 bytes)
*
*
* @return Newly allocated record if succesful, NULL otherwise. Later on need to use #mbus_record_free
*/
mbus_record *mbus_parse_fixed_record(char statusByte, char medium_unit_byte, u_char *data);
mbus_record *mbus_parse_fixed_record(char statusByte, char medium_unit_byte, unsigned char *data);
/**
/**
* Create/parse single counter from the variable data structure record
*
* @param data record data to be parsed
*
*
* @param record record data to be parsed
*
* @return Newly allocated record if succesful, NULL otherwise. Later on need to use #mbus_record_free
*/
mbus_record * mbus_parse_variable_record(mbus_data_record *record);
/**
/**
* Get normalized counter value for a fixed counter
*
* Get "normalized" value and unit of the counter
*
*
* @param medium_unit_byte medium/unit byte of the fixed counter
* @param medium_value raw counter value
* @param unit_out units of the counter - use free when done
* @param value_out resulting counter value
* @param quantity_out parsed quantity, when done use "free"
*
*
* @return zero when OK
*/
int mbus_data_fixed_normalize(int medium_unit_byte, long medium_value, char **unit_out, double *value_out, char **quantity_out);
/**
/**
* Decode value of a variable data structure
*
*
* @param record record to be decoded
* @param value_out_real numerical counter value output (when numerical)
* @param value_out_str string counter value output (when string, NULL otherwise), when finished use "free *value_out_str"
* @param value_out_str_size string counter value size
*
*
* @return zero when OK
*/
int mbus_data_variable_value_decode(mbus_record *record, double *value_out_real, char **value_out_str, int *value_out_str_size);
/**
/**
* Decode units and normalize value using VIF/VIFE (used internally by mbus_vib_unit_normalize)
*
*
* @param vif VIF (including standard extensions)
* @param value already parsed "raw" numerical value
* @param unit_out parsed unit, when done use "free"
* @param value_out normalized value
* @param quantity_out parsed quantity, when done use "free"
*
*
* @return zero when OK
*/
int mbus_vif_unit_normalize(int vif, double value, char **unit_out, double *value_out, char **quantity_out);
/**
/**
* Decode units and normalize value from VIB
*
*
* @param vib mbus value information block of the variable record
* @param value already parsed "raw" numerical value
* @param unit_out parsed unit, when done use "free"
* @param value_out normalized value
* @param quantity_out parsed quantity, when done use "free"
*
*
* @return zero when OK
*/
int mbus_vib_unit_normalize(mbus_value_information_block *vib, double value, char **unit_out, double *value_out, char ** quantity_out);
/**
/**
* Generate XML for normalized variable-length data
*
*
* @param data variable-length data
*
*
* @return string with XML
*/
char * mbus_data_variable_xml_normalized(mbus_data_variable *data);
/**
/**
* Return a string containing an XML representation of the normalized M-BUS frame data.
*
*
* @param data M-Bus frame data
*
*
* @return string with XML
*/
char * mbus_frame_data_xml_normalized(mbus_frame_data *data);
/**
/**
* Iterate over secondary addresses, send a probe package to all addresses matching
* the given addresses mask.
*
*
* @param handle Initialized handle
* @param pos current address
* @param addr_mask address mask to
*
* @param addr_mask address mask to
*
* @return zero when OK
*/
int mbus_scan_2nd_address_range(mbus_handle * handle, int pos, char *addr_mask);
/**
* Convert a buffer with hex values into a buffer with binary values.
*
* @param dst destination buffer with binary values
* @param dst_len byte count of destination buffer
* @param src source buffer with hex values
* @param src_len byte count of source buffer
*
* @return byte count of successful converted values
*/
size_t mbus_hex2bin(unsigned char * dst, size_t dst_len, const unsigned char * src, size_t src_len);
#ifdef __cplusplus
}
#endif
#endif // __MBUS_PROTOCOL_AUX_H__

2195
mbus/mbus-protocol.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

278
mbus/mbus-protocol.h Normal file → Executable file
View File

@ -2,7 +2,7 @@
// Copyright (C) 2010-2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
@ -10,7 +10,7 @@
/**
* @file mbus-protocol.h
*
*
* @brief Functions and data structures for M-Bus protocol parsing.
*
*/
@ -19,9 +19,13 @@
#define _MBUS_PROTOCOL_H_
#include <stdlib.h>
#include <sys/types.h>
#include <stdint.h>
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
//
// Packet formats:
//
@ -66,25 +70,27 @@
//
//
#define MBUS_FRAME_DATA_LENGTH 252
typedef struct _mbus_frame {
u_char start1;
u_char length1;
u_char length2;
u_char start2;
u_char control;
u_char address;
u_char control_information;
unsigned char start1;
unsigned char length1;
unsigned char length2;
unsigned char start2;
unsigned char control;
unsigned char address;
unsigned char control_information;
// variable data field
u_char checksum;
u_char stop;
u_char data[252];
unsigned char checksum;
unsigned char stop;
unsigned char data[MBUS_FRAME_DATA_LENGTH];
size_t data_size;
int type;
time_t timestamp;
//mbus_frame_data frame_data;
void *next; // pointer to next mbus_frame for multi-telegram replies
@ -95,7 +101,7 @@ typedef struct _mbus_slave_data {
int state_fcb;
int state_acd;
} mbus_slave_data;
#define NITEMS(x) (sizeof(x)/sizeof(x[0]))
@ -106,45 +112,60 @@ typedef struct _mbus_slave_data {
#define MBUS_HANDLE_TYPE_TCP 0
#define MBUS_HANDLE_TYPE_SERIAL 1
//
// Resultcodes for mbus_recv_frame
//
#define MBUS_RECV_RESULT_OK 0
#define MBUS_RECV_RESULT_ERROR -1
#define MBUS_RECV_RESULT_INVALID -2
#define MBUS_RECV_RESULT_TIMEOUT -3
#define MBUS_RECV_RESULT_RESET -4
//------------------------------------------------------------------------------
// MBUS FRAME DATA FORMATS
//
// DATA RECORDS
#define MBUS_DIB_DIF_EXTENSION_BIT 0x80
#define MBUS_DIB_VIF_EXTENSION_BIT 0x80
#define MBUS_DIB_DIF_WITHOUT_EXTENSION 0x7F
#define MBUS_DIB_DIF_EXTENSION_BIT 0x80
#define MBUS_DIB_VIF_WITHOUT_EXTENSION 0x7F
#define MBUS_DIB_VIF_EXTENSION_BIT 0x80
#define MBUS_DIB_DIF_MANUFACTURER_SPECIFIC 0x0F
#define MBUS_DIB_DIF_MORE_RECORDS_FOLLOW 0x1F
#define MBUS_DIB_DIF_IDLE_FILLER 0x2F
typedef struct _mbus_data_information_block {
u_char dif;
u_char dife[10];
unsigned char dif;
unsigned char dife[10];
size_t ndife;
} mbus_data_information_block;
typedef struct _mbus_value_information_block {
u_char vif;
u_char vife[10];
unsigned char vif;
unsigned char vife[10];
size_t nvife;
u_char custom_vif[128];
unsigned char custom_vif[128];
} mbus_value_information_block;
typedef struct _mbus_data_record_header {
mbus_data_information_block dib;
mbus_value_information_block vib;
mbus_value_information_block vib;
} mbus_data_record_header;
typedef struct _mbus_data_record {
mbus_data_record_header drh;
u_char data[234];
size_t data_len;
unsigned char data[234];
size_t data_len;
time_t timestamp;
@ -152,47 +173,49 @@ typedef struct _mbus_data_record {
} mbus_data_record;
//
//
// HEADER FOR VARIABLE LENGTH DATA FORMAT
//
//
typedef struct _mbus_data_variable_header {
//Ident.Nr. Manufr. Version Medium Access No. Status Signature
//4 Byte 2 Byte 1 Byte 1 Byte 1 Byte 1 Byte 2 Byte
// ex
// 88 63 80 09 82 4D 02 04 15 00 00 00
u_char id_bcd[4]; // 88 63 80 09
u_char manufacturer[2]; // 82 4D
u_char version; // 02
u_char medium; // 04
u_char access_no; // 15
u_char status; // 00
u_char signature[2]; // 00 00
unsigned char id_bcd[4]; // 88 63 80 09
unsigned char manufacturer[2]; // 82 4D
unsigned char version; // 02
unsigned char medium; // 04
unsigned char access_no; // 15
unsigned char status; // 00
unsigned char signature[2]; // 00 00
} mbus_data_variable_header;
#define MBUS_DATA_VARIABLE_HEADER_LENGTH 12
//
// VARIABLE LENGTH DATA FORMAT
//
typedef struct _mbus_data_variable {
mbus_data_variable_header header;
mbus_data_record *record;
mbus_data_record *record;
size_t nrecords;
u_char *data;
unsigned char *data;
size_t data_len;
u_char more_records_follow;
unsigned char more_records_follow;
// are these needed/used?
u_char mdh;
u_char *mfg_data;
size_t mfg_data_len;
unsigned char mdh;
unsigned char *mfg_data;
size_t mfg_data_len;
} mbus_data_variable;
//
@ -212,16 +235,18 @@ typedef struct _mbus_data_fixed {
// 01 00 00 00 counter 1 = 1l (actual value)
// 35 01 00 00 counter 2 = 135 l (historic value)
u_char id_bcd[4];
u_char tx_cnt;
u_char status;
u_char cnt1_type;
u_char cnt2_type;
u_char cnt1_val[4];
u_char cnt2_val[4];
unsigned char id_bcd[4];
unsigned char tx_cnt;
unsigned char status;
unsigned char cnt1_type;
unsigned char cnt2_type;
unsigned char cnt1_val[4];
unsigned char cnt2_val[4];
} mbus_data_fixed;
#define MBUS_DATA_FIXED_LENGTH 16
//
// ABSTRACT DATA FORMAT (error, fixed or variable length)
//
@ -239,22 +264,22 @@ typedef struct _mbus_frame_data {
} mbus_frame_data;
//
//
// HEADER FOR SECONDARY ADDRESSING
//
//
typedef struct _mbus_data_secondary_address {
//Ident.Nr. Manufr. Version Medium
//4 Byte 2 Byte 1 Byte 1 Byte
//Ident.Nr. Manufr. Version Medium
//4 Byte 2 Byte 1 Byte 1 Byte
// ex
// 14 49 10 01 10 57 01 06
u_char id_bcd[4]; // 14 49 10 01
u_char manufacturer[2]; // 10 57
u_char version; // 01
u_char medium; // 06
unsigned char id_bcd[4]; // 14 49 10 01
unsigned char manufacturer[2]; // 10 57
unsigned char version; // 01
unsigned char medium; // 06
} mbus_data_secondary_address;
@ -286,7 +311,7 @@ typedef struct _mbus_data_secondary_address {
#define MBUS_FRAME_FIXED_SIZE_ACK 1
#define MBUS_FRAME_FIXED_SIZE_SHORT 5
#define MBUS_FRAME_FIXED_SIZE_CONTROL 6
#define MBUS_FRAME_FIXED_SIZE_CONTROL 6
#define MBUS_FRAME_FIXED_SIZE_LONG 6
//
@ -301,7 +326,7 @@ typedef struct _mbus_data_secondary_address {
//
//
//
#define MBUS_MAX_PRIMARY_SLAVES 256
#define MBUS_MAX_PRIMARY_SLAVES 250
//
// Control field
@ -420,6 +445,11 @@ typedef struct _mbus_data_secondary_address {
#define MBUS_DATA_RECORD_DIF_MASK_EXTENTION 0x80
#define MBUS_DATA_RECORD_DIF_MASK_NON_DATA 0xF0
#define MBUS_DATA_RECORD_DIFE_MASK_STORAGE_NO 0x0F
#define MBUS_DATA_RECORD_DIFE_MASK_TARIFF 0x30
#define MBUS_DATA_RECORD_DIFE_MASK_DEVICE 0x40
#define MBUS_DATA_RECORD_DIFE_MASK_EXTENSION 0x80
//
// GENERAL APPLICATION ERRORS
//
@ -440,7 +470,7 @@ typedef struct _mbus_data_secondary_address {
//
// VARIABLE DATA FLAGS
//
//
#define MBUS_VARIABLE_DATA_MEDIUM_OTHER 0x00
#define MBUS_VARIABLE_DATA_MEDIUM_OIL 0x01
#define MBUS_VARIABLE_DATA_MEDIUM_ELECTRICITY 0x02
@ -462,40 +492,21 @@ typedef struct _mbus_data_secondary_address {
#define MBUS_VARIABLE_DATA_MEDIUM_PRESSURE 0x18
#define MBUS_VARIABLE_DATA_MEDIUM_ADC 0x19
#define MBUS_VARIABLE_DATA_MAN_ACW 0x0477
#define MBUS_VARIABLE_DATA_MAN_ABB 0x0442
#define MBUS_VARIABLE_DATA_MAN_AMT 0x05B4
#define MBUS_VARIABLE_DATA_MAN_EFE 0x14C5
#define MBUS_VARIABLE_DATA_MAN_ELS 0x1593
#define MBUS_VARIABLE_DATA_MAN_EMH 0x15A8
#define MBUS_VARIABLE_DATA_MAN_HYD 0x2324
#define MBUS_VARIABLE_DATA_MAN_KAM 0x2C2D
#define MBUS_VARIABLE_DATA_MAN_LSE 0x3265
#define MBUS_VARIABLE_DATA_MAN_LUG 0x32A7
#define MBUS_VARIABLE_DATA_MAN_NZR 0x3B52
#define MBUS_VARIABLE_DATA_MAN_PAD 0x4024
#define MBUS_VARIABLE_DATA_MAN_QDS 0x4493
#define MBUS_VARIABLE_DATA_MAN_SLB 0x4D82
#define MBUS_VARIABLE_DATA_MAN_SON 0x4DEE
#define MBUS_VARIABLE_DATA_MAN_SPX 0x4E18
#define MBUS_VARIABLE_DATA_MAN_SVM 0x4ECD
#define MBUS_VARIABLE_DATA_MAN_TCH 0x5068
#define MBUS_VARIABLE_DATA_MAN_ZRM 0x6A4D
//
// Returns the manufacturer ID or zero if the given
// string could not be converted into an ID
//
unsigned int mbus_manufacturer_id(char *manufacturer);
// Since libmbus writes some special characters (ASCII > 0x7F) into the XML output (e.g. <20>C for centigrade == ASCII 0xB0)
// it is useful to attach the appropriate code page for postprocessing.
#define MBUS_XML_PROCESSING_INSTRUCTION "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
//
// Event callback functions
//
extern void (*_mbus_recv_event)(u_char src_type, const char *buff, size_t len);
extern void (*_mbus_send_event)(u_char src_type, const char *buff, size_t len);
void mbus_dump_recv_event(u_char src_type, const char *buff, size_t len);
void mbus_dump_send_event(u_char src_type, const char *buff, size_t len);
//
// Event register functions
//
void mbus_register_recv_event(void (*event)(u_char src_type, const char *buff, size_t len));
void mbus_register_send_event(void (*event)(u_char src_type, const char *buff, size_t len));
void mbus_dump_recv_event(unsigned char src_type, const char *buff, size_t len);
void mbus_dump_send_event(unsigned char src_type, const char *buff, size_t len);
//
// variable length records
@ -522,14 +533,14 @@ int mbus_frame_calc_length (mbus_frame *frame);
//
// Parse/Pack to bin
//
int mbus_parse(mbus_frame *frame, u_char *data, size_t data_size);
int mbus_parse(mbus_frame *frame, unsigned char *data, size_t data_size);
int mbus_data_fixed_parse (mbus_frame *frame, mbus_data_fixed *data);
int mbus_data_variable_parse(mbus_frame *frame, mbus_data_variable *data);
int mbus_frame_data_parse (mbus_frame *frame, mbus_frame_data *data);
int mbus_frame_pack(mbus_frame *frame, u_char *data, size_t data_size);
int mbus_frame_pack(mbus_frame *frame, unsigned char *data, size_t data_size);
int mbus_frame_verify(mbus_frame *frame);
@ -540,11 +551,15 @@ int mbus_frame_internal_pack(mbus_frame *frame, mbus_frame_data *frame_data);
//
const char *mbus_data_record_function(mbus_data_record *record);
const char *mbus_data_fixed_function(int status);
long mbus_data_record_storage_number(mbus_data_record *record);
long mbus_data_record_tariff(mbus_data_record *record);
int mbus_data_record_device(mbus_data_record *record);
//
// M-Bus frame data struct access/write functions
//
int mbus_frame_type(mbus_frame *frame);
int mbus_frame_direction(mbus_frame *frame);
//
// Slave status data register.
@ -554,7 +569,7 @@ mbus_slave_data *mbus_slave_data_get(size_t i);
//
// XML generating functions
//
void mbus_str_xml_encode(u_char *dst, const u_char *src, size_t max_len);
void mbus_str_xml_encode(unsigned char *dst, const unsigned char *src, size_t max_len);
char *mbus_data_xml(mbus_frame_data *data);
char *mbus_data_variable_xml(mbus_data_variable *data);
char *mbus_data_fixed_xml(mbus_data_fixed *data);
@ -585,40 +600,47 @@ void mbus_hex_dump(const char *label, const char *buff, size_t len);
//
// data encode/decode functions
//
int mbus_data_manufacturer_encode(u_char *m_data, u_char *m_code);
const char *mbus_decode_manufacturer(u_char byte1, u_char byte2);
int mbus_data_manufacturer_encode(unsigned char *m_data, unsigned char *m_code);
const char *mbus_decode_manufacturer(unsigned char byte1, unsigned char byte2);
const char *mbus_data_product_name(mbus_data_variable_header *header);
int mbus_data_bcd_encode(u_char *bcd_data, size_t bcd_data_size, int value);
int mbus_data_int_encode(u_char *int_data, size_t int_data_size, int value);
long long mbus_data_bcd_decode(u_char *bcd_data, size_t bcd_data_size);
int mbus_data_int_decode(u_char *int_data, size_t int_data_size);
long mbus_data_long_decode(u_char *int_data, size_t int_data_size);
long long mbus_data_long_long_decode(u_char *int_data, size_t int_data_size);
int mbus_data_bcd_encode(unsigned char *bcd_data, size_t bcd_data_size, int value);
int mbus_data_int_encode(unsigned char *int_data, size_t int_data_size, int value);
float mbus_data_float_decode(u_char *float_data);
long long mbus_data_bcd_decode(unsigned char *bcd_data, size_t bcd_data_size);
int mbus_data_int_decode(unsigned char *int_data, size_t int_data_size, int *value);
int mbus_data_long_decode(unsigned char *int_data, size_t int_data_size, long *value);
int mbus_data_long_long_decode(unsigned char *int_data, size_t int_data_size, long long *value);
void mbus_data_tm_decode(struct tm *t, u_char *t_data, size_t t_data_size);
float mbus_data_float_decode(unsigned char *float_data);
void mbus_data_str_decode(u_char *dst, const u_char *src, size_t len);
void mbus_data_tm_decode(struct tm *t, unsigned char *t_data, size_t t_data_size);
void mbus_data_bin_decode(u_char *dst, const u_char *src, size_t len, size_t max_len);
void mbus_data_str_decode(unsigned char *dst, const unsigned char *src, size_t len);
void mbus_data_bin_decode(unsigned char *dst, const unsigned char *src, size_t len, size_t max_len);
const char *mbus_data_fixed_medium(mbus_data_fixed *data);
const char *mbus_data_fixed_unit(int medium_unit_byte);
const char *mbus_data_variable_medium_lookup(u_char medium);
const char *mbus_data_variable_medium_lookup(unsigned char medium);
const char *mbus_unit_prefix(int exp);
const char *mbus_data_error_lookup(int error);
const char *mbus_vib_unit_lookup(mbus_value_information_block *vib);
const char *mbus_vif_unit_lookup(u_char vif);
const char *mbus_vif_unit_lookup(unsigned char vif);
u_char mbus_dif_datalength_lookup(u_char dif);
unsigned char mbus_dif_datalength_lookup(unsigned char dif);
char *mbus_frame_get_secondary_address(mbus_frame *frame);
int mbus_frame_select_secondary_pack(mbus_frame *frame, char *address);
int mbus_is_primary_address(int value);
int mbus_is_secondary_address(const char * value);
#ifdef __cplusplus
}
#endif
#endif /* _MBUS_PROTOCOL_H_ */

213
mbus/mbus-serial.c Normal file → Executable file
View File

@ -2,13 +2,14 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#include <unistd.h>
#include <limits.h>
#include <fcntl.h>
#include <sys/types.h>
@ -20,49 +21,48 @@
#include <errno.h>
#include <string.h>
#include <mbus/mbus.h>
#include <mbus/mbus-serial.h>
#include "mbus-serial.h"
#include "mbus-protocol-aux.h"
#include "mbus-protocol.h"
#define PACKET_BUFF_SIZE 2048
//------------------------------------------------------------------------------
/// Set up a serial connection handle.
//------------------------------------------------------------------------------
mbus_serial_handle *
mbus_serial_connect(char *device)
int
mbus_serial_connect(mbus_handle *handle)
{
mbus_serial_handle *handle;
mbus_serial_data *serial_data;
const char *device;
struct termios *term;
if (device == NULL)
{
return NULL;
}
if (handle == NULL)
return -1;
if ((handle = (mbus_serial_handle *)malloc(sizeof(mbus_serial_handle))) == NULL)
{
fprintf(stderr, "%s: failed to allocate memory for handle\n", __PRETTY_FUNCTION__);
return NULL;
}
handle->device = device; // strdup?
serial_data = (mbus_serial_data *) handle->auxdata;
if (serial_data == NULL || serial_data->device == NULL)
return -1;
device = serial_data->device;
term = &(serial_data->t);
//
// create the SERIAL connection
//
// Use blocking read and handle it by serial port VMIN/VTIME setting
if ((handle->fd = open(handle->device, O_RDWR | O_NOCTTY)) < 0)
if ((handle->fd = open(device, O_RDWR | O_NOCTTY)) < 0)
{
fprintf(stderr, "%s: failed to open tty.", __PRETTY_FUNCTION__);
return NULL;
return -1;
}
memset(&(handle->t), 0, sizeof(handle->t));
handle->t.c_cflag |= (CS8|CREAD|CLOCAL);
handle->t.c_cflag |= PARENB;
memset(term, 0, sizeof(*term));
term->c_cflag |= (CS8|CREAD|CLOCAL);
term->c_cflag |= PARENB;
// No received data still OK
handle->t.c_cc[VMIN] = 0;
term->c_cc[VMIN] = (cc_t) 0;
// Wait at most 0.2 sec.Note that it starts after first received byte!!
// I.e. if CMIN>0 and there are no data we would still wait forever...
@ -71,58 +71,84 @@ mbus_serial_connect(char *device)
// The time structure of various link layer communication types is described in EN60870-5-1. The answer time
// between the end of a master send telegram and the beginning of the response telegram of the slave shall be
// between 11 bit times and (330 bit times + 50ms).
//
//
// For 2400Bd this means (330 + 11) / 2400 + 0.05 = 188.75 ms (added 11 bit periods to receive first byte).
// I.e. timeout of 0.2s seems appropriate for 2400Bd.
handle->t.c_cc[VTIME] = 2; // Timeout in 1/10 sec
term->c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec
cfsetispeed(&(handle->t), B2400);
cfsetospeed(&(handle->t), B2400);
cfsetispeed(term, B2400);
cfsetospeed(term, B2400);
#ifdef MBUS_SERIAL_DEBUG
printf("%s: t.c_cflag = %x\n", __PRETTY_FUNCTION__, handle->t.c_cflag);
printf("%s: t.c_oflag = %x\n", __PRETTY_FUNCTION__, handle->t.c_oflag);
printf("%s: t.c_iflag = %x\n", __PRETTY_FUNCTION__, handle->t.c_iflag);
printf("%s: t.c_lflag = %x\n", __PRETTY_FUNCTION__, handle->t.c_lflag);
#endif
printf("%s: t.c_cflag = %x\n", __PRETTY_FUNCTION__, term->c_cflag);
printf("%s: t.c_oflag = %x\n", __PRETTY_FUNCTION__, term->c_oflag);
printf("%s: t.c_iflag = %x\n", __PRETTY_FUNCTION__, term->c_iflag);
printf("%s: t.c_lflag = %x\n", __PRETTY_FUNCTION__, term->c_lflag);
#endif
tcsetattr(handle->fd, TCSANOW, &(handle->t));
tcsetattr(handle->fd, TCSANOW, term);
return handle;
return 0;
}
//------------------------------------------------------------------------------
// Set baud rate for serial connection
//------------------------------------------------------------------------------
int
mbus_serial_set_baudrate(mbus_serial_handle *handle, int baudrate)
mbus_serial_set_baudrate(mbus_handle *handle, long baudrate)
{
speed_t speed;
mbus_serial_data *serial_data;
if (handle == NULL)
return -1;
serial_data = (mbus_serial_data *) handle->auxdata;
if (serial_data == NULL)
return -1;
switch (baudrate)
{
case 300:
speed = B300;
handle->t.c_cc[VTIME] = 12; // Timeout in 1/10 sec
serial_data->t.c_cc[VTIME] = (cc_t) 12; // Timeout in 1/10 sec
break;
case 600:
speed = B600;
serial_data->t.c_cc[VTIME] = (cc_t) 6; // Timeout in 1/10 sec
break;
case 1200:
speed = B1200;
handle->t.c_cc[VTIME] = 4; // Timeout in 1/10 sec
serial_data->t.c_cc[VTIME] = (cc_t) 4; // Timeout in 1/10 sec
break;
case 2400:
speed = B2400;
handle->t.c_cc[VTIME] = 2; // Timeout in 1/10 sec
serial_data->t.c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec
break;
case 4800:
speed = B4800;
serial_data->t.c_cc[VTIME] = (cc_t) 2; // Timeout in 1/10 sec
break;
case 9600:
speed = B9600;
handle->t.c_cc[VTIME] = 1; // Timeout in 1/10 sec
serial_data->t.c_cc[VTIME] = (cc_t) 1; // Timeout in 1/10 sec
break;
case 19200:
speed = B19200;
serial_data->t.c_cc[VTIME] = (cc_t) 1; // Timeout in 1/10 sec
break;
case 38400:
speed = B38400;
serial_data->t.c_cc[VTIME] = (cc_t) 1; // Timeout in 1/10 sec
break;
default:
@ -130,19 +156,19 @@ mbus_serial_set_baudrate(mbus_serial_handle *handle, int baudrate)
}
// Set input baud rate
if (cfsetispeed(&(handle->t), speed) != 0)
if (cfsetispeed(&(serial_data->t), speed) != 0)
{
return -1;
}
// Set output baud rate
if (cfsetospeed(&(handle->t), speed) != 0)
if (cfsetospeed(&(serial_data->t), speed) != 0)
{
return -1;
}
// Change baud rate immediately
if (tcsetattr(handle->fd, TCSANOW, &(handle->t)) != 0)
if (tcsetattr(handle->fd, TCSANOW, &(serial_data->t)) != 0)
{
return -1;
}
@ -155,7 +181,7 @@ mbus_serial_set_baudrate(mbus_serial_handle *handle, int baudrate)
//
//------------------------------------------------------------------------------
int
mbus_serial_disconnect(mbus_serial_handle *handle)
mbus_serial_disconnect(mbus_handle *handle)
{
if (handle == NULL)
{
@ -163,19 +189,37 @@ mbus_serial_disconnect(mbus_serial_handle *handle)
}
close(handle->fd);
free(handle);
return 0;
}
void
mbus_serial_data_free(mbus_handle *handle)
{
mbus_serial_data *serial_data;
if (handle)
{
serial_data = (mbus_serial_data *) handle->auxdata;
if (serial_data == NULL)
{
return;
}
free(serial_data->device);
free(serial_data);
handle->auxdata = NULL;
}
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
int
mbus_serial_send_frame(mbus_serial_handle *handle, mbus_frame *frame)
mbus_serial_send_frame(mbus_handle *handle, mbus_frame *frame)
{
u_char buff[PACKET_BUFF_SIZE];
unsigned char buff[PACKET_BUFF_SIZE];
int len, ret;
if (handle == NULL || frame == NULL)
@ -183,15 +227,22 @@ mbus_serial_send_frame(mbus_serial_handle *handle, mbus_frame *frame)
return -1;
}
// Make sure serial connection is open
if (isatty(handle->fd) == 0)
{
return -1;
}
if ((len = mbus_frame_pack(frame, buff, sizeof(buff))) == -1)
{
fprintf(stderr, "%s: mbus_frame_pack failed\n", __PRETTY_FUNCTION__);
return -1;
}
#ifdef MBUS_SERIAL_DEBUG
// if debug, dump in HEX form to stdout what we write to the serial port
printf("%s: Dumping M-Bus frame [%d bytes]: ", __PRETTY_FUNCTION__, len);
int i;
for (i = 0; i < len; i++)
{
printf("%.2X ", buff[i]);
@ -203,16 +254,16 @@ mbus_serial_send_frame(mbus_serial_handle *handle, mbus_frame *frame)
{
//
// call the send event function, if the callback function is registered
//
if (_mbus_send_event)
_mbus_send_event(MBUS_HANDLE_TYPE_SERIAL, buff, len);
//
if (handle->send_event)
handle->send_event(MBUS_HANDLE_TYPE_SERIAL, buff, len);
}
else
{
{
fprintf(stderr, "%s: Failed to write frame to socket (ret = %d: %s)\n", __PRETTY_FUNCTION__, ret, strerror(errno));
return -1;
}
//
// wait until complete frame has been transmitted
//
@ -225,15 +276,23 @@ mbus_serial_send_frame(mbus_serial_handle *handle, mbus_frame *frame)
//
//------------------------------------------------------------------------------
int
mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame)
mbus_serial_recv_frame(mbus_handle *handle, mbus_frame *frame)
{
char buff[PACKET_BUFF_SIZE];
int len, remaining, nread, timeouts;
int remaining, timeouts;
ssize_t len, nread;
if (handle == NULL || frame == NULL)
{
fprintf(stderr, "%s: Invalid parameter.\n", __PRETTY_FUNCTION__);
return -1;
return MBUS_RECV_RESULT_ERROR;
}
// Make sure serial connection is open
if (isatty(handle->fd) == 0)
{
fprintf(stderr, "%s: Serial connection is not available.\n", __PRETTY_FUNCTION__);
return MBUS_RECV_RESULT_ERROR;
}
memset((void *)buff, 0, sizeof(buff));
@ -246,21 +305,27 @@ mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame)
timeouts = 0;
do {
if (len + remaining > PACKET_BUFF_SIZE)
{
// avoid out of bounds access
return MBUS_RECV_RESULT_ERROR;
}
//printf("%s: Attempt to read %d bytes [len = %d]\n", __PRETTY_FUNCTION__, remaining, len);
if ((nread = read(handle->fd, &buff[len], remaining)) == -1)
{
// fprintf(stderr, "%s: aborting recv frame (remaining = %d, len = %d, nread = %d)\n",
// __PRETTY_FUNCTION__, remaining, len, nread);
return -1;
return MBUS_RECV_RESULT_ERROR;
}
// printf("%s: Got %d byte [remaining %d, len %d]\n", __PRETTY_FUNCTION__, nread, remaining, len);
if (nread == 0)
{
timeouts++;
if (timeouts >= 3)
{
// abort to avoid endless loop
@ -269,6 +334,12 @@ mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame)
}
}
if (len > (SSIZE_MAX-nread))
{
// avoid overflow
return MBUS_RECV_RESULT_ERROR;
}
len += nread;
} while ((remaining = mbus_parse(frame, buff, len)) > 0);
@ -276,30 +347,28 @@ mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame)
if (len == 0)
{
// No data received
return -1;
return MBUS_RECV_RESULT_TIMEOUT;
}
//
// call the receive event function, if the callback function is registered
//
if (_mbus_recv_event)
_mbus_recv_event(MBUS_HANDLE_TYPE_SERIAL, buff, len);
//
if (handle->recv_event)
handle->recv_event(MBUS_HANDLE_TYPE_SERIAL, buff, len);
if (remaining != 0)
{
// Would be OK when e.g. scanning the bus, otherwise it is a failure.
// printf("%s: M-Bus layer failed to receive complete data.\n", __PRETTY_FUNCTION__);
return -2;
return MBUS_RECV_RESULT_INVALID;
}
if (len == -1)
{
fprintf(stderr, "%s: M-Bus layer failed to parse data.\n", __PRETTY_FUNCTION__);
return -1;
return MBUS_RECV_RESULT_ERROR;
}
return 0;
return MBUS_RECV_RESULT_OK;
}

36
mbus/mbus-serial.h Normal file → Executable file
View File

@ -2,7 +2,7 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
@ -10,7 +10,7 @@
/**
* @file mbus-serial.h
*
*
* @brief Functions and data structures for sending M-Bus data via RS232.
*
*/
@ -19,24 +19,30 @@
#define MBUS_SERIAL_H
#include <termios.h>
#include <mbus/mbus.h>
#include "mbus-protocol-aux.h"
#include "mbus-protocol.h"
typedef struct _mbus_serial_handle {
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _mbus_serial_data
{
char *device;
int fd;
struct termios t;
} mbus_serial_handle;
} mbus_serial_data;
int mbus_serial_connect(mbus_handle *handle);
int mbus_serial_disconnect(mbus_handle *handle);
int mbus_serial_send_frame(mbus_handle *handle, mbus_frame *frame);
int mbus_serial_recv_frame(mbus_handle *handle, mbus_frame *frame);
int mbus_serial_set_baudrate(mbus_handle *handle, long baudrate);
void mbus_serial_data_free(mbus_handle *handle);
#ifdef __cplusplus
}
#endif
mbus_serial_handle *mbus_serial_connect(char *device);
int mbus_serial_disconnect(mbus_serial_handle *handle);
int mbus_serial_send_frame(mbus_serial_handle *handle, mbus_frame *frame);
int mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame);
int mbus_serial_set_baudrate(mbus_serial_handle *handle, int baudrate);
#endif /* MBUS_SERIAL_H */

214
mbus/mbus-tcp.c Normal file → Executable file
View File

@ -2,13 +2,14 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#include <unistd.h>
#include <limits.h>
#include <fcntl.h>
#include <sys/socket.h>
@ -21,49 +22,46 @@
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <mbus/mbus.h>
#include <mbus/mbus-tcp.h>
#include "mbus-tcp.h"
#define PACKET_BUFF_SIZE 2048
static int tcp_timeout_sec = 4;
static int tcp_timeout_usec = 0;
//------------------------------------------------------------------------------
/// Setup a TCP/IP handle.
//------------------------------------------------------------------------------
mbus_tcp_handle *
mbus_tcp_connect(char *host, int port)
int
mbus_tcp_connect(mbus_handle *handle)
{
mbus_tcp_handle *handle;
char error_str[128], *host;
struct hostent *host_addr;
struct sockaddr_in s;
struct timeval time_out;
mbus_tcp_data *tcp_data;
uint16_t port;
if (host == NULL)
{
return NULL;
}
if (handle == NULL)
return -1;
if ((handle = (mbus_tcp_handle *)malloc(sizeof(mbus_tcp_handle))) == NULL)
{
char error_str[128];
snprintf(error_str, sizeof(error_str), "%s: failed to allocate memory for handle\n", __PRETTY_FUNCTION__);
mbus_error_str_set(error_str);
return NULL;
}
tcp_data = (mbus_tcp_data *) handle->auxdata;
if (tcp_data == NULL || tcp_data->host == NULL)
return -1;
handle->host = host; // strdup ?
handle->port = port;
host = tcp_data->host;
port = tcp_data->port;
//
// create the TCP connection
//
if ((handle->sock = socket(AF_INET,SOCK_STREAM, 0)) < 0)
if ((handle->fd = socket(AF_INET,SOCK_STREAM, 0)) < 0)
{
char error_str[128];
snprintf(error_str, sizeof(error_str), "%s: failed to setup a socket.", __PRETTY_FUNCTION__);
mbus_error_str_set(error_str);
return NULL;
return -1;
}
s.sin_family = AF_INET;
@ -72,47 +70,64 @@ mbus_tcp_connect(char *host, int port)
/* resolve hostname */
if ((host_addr = gethostbyname(host)) == NULL)
{
char error_str[128];
snprintf(error_str, sizeof(error_str), "%s: unknown host: %s", __PRETTY_FUNCTION__, host);
mbus_error_str_set(error_str);
free(handle);
return NULL;
return -1;
}
memcpy((void *)(&s.sin_addr), (void *)(host_addr->h_addr), host_addr->h_length);
if (connect(handle->sock, (struct sockaddr *)&s, sizeof(s)) < 0)
if (connect(handle->fd, (struct sockaddr *)&s, sizeof(s)) < 0)
{
char error_str[128];
snprintf(error_str, sizeof(error_str), "%s: Failed to establish connection to %s:%d", __PRETTY_FUNCTION__, host, port);
mbus_error_str_set(error_str);
free(handle);
return NULL;
return -1;
}
// Set a timeout
time_out.tv_sec = 4; //seconds
time_out.tv_usec = 0;
setsockopt(handle->sock, SOL_SOCKET, SO_SNDTIMEO, &time_out, sizeof(time_out));
setsockopt(handle->sock, SOL_SOCKET, SO_RCVTIMEO, &time_out, sizeof(time_out));
time_out.tv_sec = tcp_timeout_sec; // seconds
time_out.tv_usec = tcp_timeout_usec; // microseconds
setsockopt(handle->fd, SOL_SOCKET, SO_SNDTIMEO, &time_out, sizeof(time_out));
setsockopt(handle->fd, SOL_SOCKET, SO_RCVTIMEO, &time_out, sizeof(time_out));
return handle;
return 0;
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void
mbus_tcp_data_free(mbus_handle *handle)
{
mbus_tcp_data *tcp_data;
if (handle)
{
tcp_data = (mbus_tcp_data *) handle->auxdata;
if (tcp_data == NULL)
{
return;
}
free(tcp_data->host);
free(tcp_data);
handle->auxdata = NULL;
}
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
int
mbus_tcp_disconnect(mbus_tcp_handle *handle)
mbus_tcp_disconnect(mbus_handle *handle)
{
if (handle == NULL)
{
return -1;
}
close(handle->sock);
free(handle);
close(handle->fd);
return 0;
}
@ -121,10 +136,11 @@ mbus_tcp_disconnect(mbus_tcp_handle *handle)
//
//------------------------------------------------------------------------------
int
mbus_tcp_send_frame(mbus_tcp_handle *handle, mbus_frame *frame)
mbus_tcp_send_frame(mbus_handle *handle, mbus_frame *frame)
{
u_char buff[PACKET_BUFF_SIZE];
unsigned char buff[PACKET_BUFF_SIZE];
int len, ret;
char error_str[128];
if (handle == NULL || frame == NULL)
{
@ -133,23 +149,21 @@ mbus_tcp_send_frame(mbus_tcp_handle *handle, mbus_frame *frame)
if ((len = mbus_frame_pack(frame, buff, sizeof(buff))) == -1)
{
char error_str[128];
snprintf(error_str, sizeof(error_str), "%s: mbus_frame_pack failed\n", __PRETTY_FUNCTION__);
mbus_error_str_set(error_str);
return -1;
}
if ((ret = write(handle->sock, buff, len)) == len)
if ((ret = write(handle->fd, buff, len)) == len)
{
//
// call the send event function, if the callback function is registered
//
if (_mbus_send_event)
_mbus_send_event(MBUS_HANDLE_TYPE_TCP, buff, len);
//
if (handle->send_event)
handle->send_event(MBUS_HANDLE_TYPE_TCP, buff, len);
}
else
{
char error_str[128];
{
snprintf(error_str, sizeof(error_str), "%s: Failed to write frame to socket (ret = %d)\n", __PRETTY_FUNCTION__, ret);
mbus_error_str_set(error_str);
return -1;
@ -161,69 +175,91 @@ mbus_tcp_send_frame(mbus_tcp_handle *handle, mbus_frame *frame)
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
int
mbus_tcp_recv_frame(mbus_tcp_handle *handle, mbus_frame *frame)
int mbus_tcp_recv_frame(mbus_handle *handle, mbus_frame *frame)
{
char buff[PACKET_BUFF_SIZE];
int len, remaining, nread, timeouts;
if (handle == NULL || frame == NULL)
{
int remaining;
ssize_t len, nread;
if (handle == NULL || frame == NULL) {
fprintf(stderr, "%s: Invalid parameter.\n", __PRETTY_FUNCTION__);
return -1;
return MBUS_RECV_RESULT_ERROR;
}
memset((void *)buff, 0, sizeof(buff));
memset((void *) buff, 0, sizeof(buff));
//
// read data until a packet is received
//
remaining = 1; // start by reading 1 byte
len = 0;
timeouts = 0;
do {
if ((nread = read(handle->sock, &buff[len], remaining)) == -1)
retry:
if (len + remaining > PACKET_BUFF_SIZE)
{
mbus_error_str_set("M-Bus tcp transport layer failed to read data.");
return -1;
// avoid out of bounds access
return MBUS_RECV_RESULT_ERROR;
}
if (nread == 0)
{
timeouts++;
if (timeouts >= 3)
{
// abort to avoid endless loop
fprintf(stderr, "%s: Timeout\n", __PRETTY_FUNCTION__);
break;
nread = read(handle->fd, &buff[len], remaining);
switch (nread) {
case -1:
if (errno == EINTR)
goto retry;
if (errno == EAGAIN || errno == EWOULDBLOCK) {
mbus_error_str_set("M-Bus tcp transport layer response timeout has been reached.");
return MBUS_RECV_RESULT_TIMEOUT;
}
mbus_error_str_set("M-Bus tcp transport layer failed to read data.");
return MBUS_RECV_RESULT_ERROR;
case 0:
mbus_error_str_set("M-Bus tcp transport layer connection closed by remote host.");
return MBUS_RECV_RESULT_RESET;
default:
if (len > (SSIZE_MAX-nread))
{
// avoid overflow
return MBUS_RECV_RESULT_ERROR;
}
len += nread;
}
len += nread;
} while ((remaining = mbus_parse(frame, buff, len)) > 0);
if (len == 0)
{
// No data received
return -1;
}
//
// call the receive event function, if the callback function is registered
//
if (_mbus_recv_event)
_mbus_recv_event(MBUS_HANDLE_TYPE_TCP, buff, len);
if (remaining != 0)
{
//
if (handle->recv_event)
handle->recv_event(MBUS_HANDLE_TYPE_TCP, buff, len);
if (remaining < 0) {
mbus_error_str_set("M-Bus layer failed to parse data.");
return -2;
return MBUS_RECV_RESULT_INVALID;
}
return MBUS_RECV_RESULT_OK;
}
//------------------------------------------------------------------------------
/// The the timeout in seconds that will be used as the amount of time the
/// a read operation will wait before giving up. Note: This configuration has
/// to be made before calling mbus_tcp_connect.
//------------------------------------------------------------------------------
int
mbus_tcp_set_timeout_set(double seconds)
{
if (seconds < 0.0)
{
mbus_error_str_set("Invalid timeout (must be positive).");
return -1;
}
tcp_timeout_sec = (int)seconds;
tcp_timeout_usec = (seconds - tcp_timeout_sec) * 1000000;
return 0;
}

34
mbus/mbus-tcp.h Normal file → Executable file
View File

@ -2,7 +2,7 @@
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
@ -10,7 +10,7 @@
/**
* @file mbus-tcp.h
*
*
* @brief Functions and data structures for sending M-Bus data via TCP.
*
*/
@ -18,22 +18,30 @@
#ifndef MBUS_TCP_H
#define MBUS_TCP_H
#include <mbus/mbus.h>
#include "mbus-protocol.h"
#include "mbus-protocol-aux.h"
typedef struct _mbus_tcp_handle {
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _mbus_tcp_data
{
char *host;
uint16_t port;
} mbus_tcp_data;
int port;
int sock;
int mbus_tcp_connect(mbus_handle *handle);
int mbus_tcp_disconnect(mbus_handle *handle);
int mbus_tcp_send_frame(mbus_handle *handle, mbus_frame *frame);
int mbus_tcp_recv_frame(mbus_handle *handle, mbus_frame *frame);
void mbus_tcp_data_free(mbus_handle *handle);
int mbus_tcp_set_timeout_set(double seconds);
} mbus_tcp_handle;
mbus_tcp_handle *mbus_tcp_connect(char *host, int port);
int mbus_tcp_disconnect(mbus_tcp_handle *handle);
int mbus_tcp_send_frame(mbus_tcp_handle *handle, mbus_frame *frame);
int mbus_tcp_recv_frame(mbus_tcp_handle *handle, mbus_frame *frame);
#ifdef __cplusplus
}
#endif
#endif /* MBUS_TCP_H */

View File

@ -2,16 +2,21 @@
// Copyright (C) 2010, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#include <mbus/mbus-protocol.h>
#include "mbus-protocol.h"
//
//
//
int mbus_init() {return 0;}
///
/// Return current version of the library
///
const char*
mbus_get_current_version() {return "0.8.0";}

View File

@ -2,7 +2,7 @@
// Copyright (C) 2010, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
@ -10,7 +10,7 @@
/**
* @file mbus.h
*
*
* @brief Main include file for the Freescada libmbus library.
*
* Include this file to access the libmbus API:
@ -20,7 +20,7 @@
*
*/
/*! \mainpage libmbus
/*! \mainpage libmbus
*
* These pages contain automatically generated documentation for the libmbus
* API. For examples on how to use the libmbus library, see the applications
@ -33,14 +33,23 @@
#ifndef _MBUS_H_
#define _MBUS_H_
#include <mbus/mbus-protocol.h>
#include <mbus/mbus-protocol-aux.h>
#include <mbus/mbus-tcp.h>
#include <mbus/mbus-serial.h>
#include "mbus-protocol.h"
#include "mbus-protocol-aux.h"
#include "mbus-tcp.h"
#include "mbus-serial.h"
#ifdef __cplusplus
extern "C" {
#endif
//
//
//
int mbus_init();
const char* mbus_get_current_version();
#ifdef __cplusplus
}
#endif
#endif /* _MBUS_H_ */

376
missing
View File

@ -1,376 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar*)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -13,17 +13,13 @@ VERSION = @VERSION@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/mbus
noinst_HEADERS =
noinst_PROGRAMS = mbus_unit_test1 mbus_parse mbus_parse_hex
mbus_unit_test1_LDFLAGS = -L$(top_builddir)/mbus
mbus_unit_test1_LDADD = -lmbus -lcunit -lncurses
mbus_unit_test1_SOURCES = mbus_unit_test1.c
noinst_PROGRAMS = mbus_parse mbus_parse_hex
mbus_parse_LDFLAGS = -L$(top_builddir)/mbus
mbus_parse_LDADD = -lmbus
mbus_parse_LDADD = -lmbus -lm
mbus_parse_SOURCES = mbus_parse.c
mbus_parse_hex_LDFLAGS = -L$(top_builddir)/mbus
mbus_parse_hex_LDADD = -lmbus
mbus_parse_hex_LDADD = -lmbus -lm
mbus_parse_hex_SOURCES = mbus_parse_hex.c

View File

@ -33,6 +33,10 @@ if [ ! -d "$directory" ]; then
fi
for hexfile in "$directory"/*.hex; do
if [ ! -f "$hexfile" ]; then
continue
fi
filename=`basename $hexfile .hex`
# Parse hex file and write XML in file

View File

@ -2,66 +2,78 @@
// Copyright (C) 2010, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#include <sys/types.h>
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <mbus/mbus-protocol.h>
#include <mbus/mbus.h>
int
main(int argc, char *argv[])
{
int fd, len;
u_char buf[1024];
mbus_frame reply;
mbus_frame_data frame_data;
char *xml_result = NULL;
FILE *fp = NULL;
size_t buff_len, len;
int normalized = 0;
unsigned char buf[1024];
mbus_frame reply;
mbus_frame_data frame_data;
char *xml_result = NULL, *file = NULL;
if (argc != 2)
if (argc == 3 && strcmp(argv[1], "-n") == 0)
{
fprintf(stderr, "usage: %s binary-file\n", argv[0]);
file = argv[2];
normalized = 1;
}
else if (argc == 2)
{
file = argv[1];
}
else
{
fprintf(stderr, "usage: %s [-n] binary-file\n", argv[0]);
fprintf(stderr, " optional flag -n for normalized values\n");
return 1;
}
if ((fd = open(argv[1], O_RDONLY, 0)) == -1)
if ((fp = fopen(file, "r")) == NULL)
{
fprintf(stderr, "%s: failed to open '%s'", argv[0], argv[1]);
fprintf(stderr, "%s: failed to open '%s'\n", argv[0], file);
return 1;
}
memset(buf, 0, sizeof(buf));
len = read(fd, buf, sizeof(buf));
memset(buf, 0, sizeof(buf));
len = fread(buf, 1, sizeof(buf), fp);
close(fd);
if (ferror(fp) != 0)
{
fprintf(stderr, "%s: failed to read '%s'\n", argv[0], file);
return 1;
}
memset(&reply, 0, sizeof(reply));
memset(&frame_data, 0, sizeof(frame_data));
mbus_parse(&reply, buf, len);
mbus_frame_data_parse(&reply, &frame_data);
mbus_frame_print(&reply);
if ((xml_result = mbus_frame_data_xml(&frame_data)) == NULL)
fclose(fp);
memset(&reply, 0, sizeof(reply));
memset(&frame_data, 0, sizeof(frame_data));
mbus_parse(&reply, buf, len);
mbus_frame_data_parse(&reply, &frame_data);
mbus_frame_print(&reply);
xml_result = normalized ? mbus_frame_data_xml_normalized(&frame_data) : mbus_frame_data_xml(&frame_data);
if (xml_result == NULL)
{
fprintf(stderr, "Failed to generate XML representation of MBUS frame: %s\n", mbus_error_str());
return 1;
}
printf("%s", xml_result);
free(xml_result);
return 0;
return 0;
}

View File

@ -2,75 +2,74 @@
// Copyright (C) 2010, Raditex AB
// All rights reserved.
//
// rSCADA
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#include <sys/types.h>
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <mbus/mbus-protocol.h>
#include <mbus/mbus.h>
int
main(int argc, char *argv[])
{
int fd, len, i, result;
u_char raw_buff[4096], buff[4096], *ptr, *endptr;
mbus_frame reply;
mbus_frame_data frame_data;
char *xml_result = NULL;
FILE *fp = NULL;
size_t buff_len, len;
int result, normalized = 0;
unsigned char raw_buff[4096], buff[4096];
mbus_frame reply;
mbus_frame_data frame_data;
char *xml_result = NULL, *file = NULL;
if (argc != 2)
if (argc == 3 && strcmp(argv[1], "-n") == 0)
{
fprintf(stderr, "usage: %s hex-file\n", argv[0]);
file = argv[2];
normalized = 1;
}
else if (argc == 2)
{
file = argv[1];
}
else
{
fprintf(stderr, "usage: %s [-n] hex-file\n", argv[0]);
fprintf(stderr, " optional flag -n for normalized values\n");
return 1;
}
if ((fd = open(argv[1], O_RDONLY, 0)) == -1)
if ((fp = fopen(file, "r")) == NULL)
{
fprintf(stderr, "%s: failed to open '%s'", argv[0], argv[1]);
fprintf(stderr, "%s: failed to open '%s'\n", argv[0], file);
return 1;
}
memset(raw_buff, 0, sizeof(raw_buff));
len = read(fd, raw_buff, sizeof(raw_buff));
close(fd);
memset(raw_buff, 0, sizeof(raw_buff));
len = fread(raw_buff, 1, sizeof(raw_buff), fp);
i = 0;
ptr = 0;
endptr = raw_buff;
while (i < sizeof(buff)-1)
if (ferror(fp) != 0)
{
ptr = endptr;
buff[i] = (u_char)strtol(ptr, (char **)&endptr, 16);
// abort at non hex value
if (ptr == endptr)
break;
i++;
fprintf(stderr, "%s: failed to read '%s'\n", argv[0], file);
return 1;
}
memset(&reply, 0, sizeof(reply));
memset(&frame_data, 0, sizeof(frame_data));
//mbus_parse_set_debug(1);
result = mbus_parse(&reply, buff, i);
fclose(fp);
if (result < 0)
{
fprintf(stderr, "mbus_parse: %s\n", mbus_error_str());
buff_len = mbus_hex2bin(buff,sizeof(buff),raw_buff,sizeof(raw_buff));
memset(&reply, 0, sizeof(reply));
memset(&frame_data, 0, sizeof(frame_data));
//mbus_parse_set_debug(1);
result = mbus_parse(&reply, buff, buff_len);
if (result < 0)
{
fprintf(stderr, "mbus_parse: %s\n", mbus_error_str());
return 1;
}
else if (result > 0)
@ -78,29 +77,30 @@ main(int argc, char *argv[])
fprintf(stderr, "mbus_parse: need %d more bytes\n", result);
return 1;
}
result = mbus_frame_data_parse(&reply, &frame_data);
if (result != 0)
{
mbus_frame_print(&reply);
fprintf(stderr, "mbus_frame_data_parse: %s\n", mbus_error_str());
if (result != 0)
{
mbus_frame_print(&reply);
fprintf(stderr, "mbus_frame_data_parse: %s\n", mbus_error_str());
return 1;
}
//mbus_frame_print(&reply);
//mbus_frame_data_print(&frame_data);
if ((xml_result = mbus_frame_data_xml(&frame_data)) == NULL)
xml_result = normalized ? mbus_frame_data_xml_normalized(&frame_data) : mbus_frame_data_xml(&frame_data);
if (xml_result == NULL)
{
fprintf(stderr, "Failed to generate XML representation of MBUS frame: %s\n", mbus_error_str());
return 1;
}
printf("%s", xml_result);
free(xml_result);
printf("%s", xml_result);
free(xml_result);
mbus_data_record_free(frame_data.data_var.record);
return 0;
return 0;
}

View File

@ -1,182 +0,0 @@
//------------------------------------------------------------------------------
// Copyright (C) 2010, Raditex AB
// All rights reserved.
//
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "CUnit/Basic.h"
#include <mbus/mbus-protocol.h>
static char *test_frame_table[][2] = {
// {"test-frames/frame1.hex", "test-frames/frame1.xml"},
{"test-frames/frame2.hex", "test-frames/frame2.xml"},
{"test-frames/kamstrup_multical_601.hex", "test-frames/kamstrup_multical_601.xml"},
{"test-frames/manual_frame2.hex", "test-frames/manual_frame2.xml"},
{"test-frames/manual_frame3.hex", "test-frames/manual_frame3.xml"},
{"test-frames/manual_frame7.hex", "test-frames/manual_frame7.xml"},
{"test-frames/svm_f22_telegram1.hex", "test-frames/svm_f22_telegram1.xml"},
{"test-frames/electricity-meter-1.hex", "test-frames/electricity-meter-1.xml"},
{"test-frames/electricity-meter-2.hex", "test-frames/electricity-meter-2.xml"},
};
static int no_test_frames = 6;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
char *read_file(char *filename)
{
FILE *f;
size_t size, size2;
char *file_content;
if ((f = fopen(filename, "r")) == NULL)
{
fprintf(stderr, "%s: Failed to open file %s.\n", __PRETTY_FUNCTION__, filename);
return NULL;
}
fseek(f, 0, SEEK_END);
size = ftell(f);
fseek(f, 0, SEEK_SET);
if ((file_content = (char *)malloc(size+1)) == NULL)
{
fprintf(stderr, "%s: Failed to allocate memory of size %d.\n", __PRETTY_FUNCTION__, size);
fclose(f);
return NULL;
}
if ((size2 = fread(file_content, 1, size, f)) != size)
{
fprintf(stderr, "%s: Failed to read file content (%s, %d:%d).\n", __PRETTY_FUNCTION__, filename, size, size2);
free(file_content);
fclose(f);
return NULL;
}
file_content[size] = 0;
fclose(f);
return file_content;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
hex_to_bin(char *buff, size_t buff_size, char *hex_buff)
{
char *ptr, *endptr;
int i;
i = 0;
ptr = 0;
endptr = hex_buff;
while ((ptr != endptr) && i < buff_size-1)
{
ptr = endptr;
buff[i++] = (u_char)strtol(ptr, (char **)&endptr, 16);
}
return i;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int init_suite(void)
{
return 0;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int clean_suite(void)
{
return 0;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void test_frames(void)
{
int i, len;
for (i = 0; i < no_test_frames; i++)
{
mbus_frame frame;
mbus_frame_data frame_data;
char *hex, bin[2048], *xml_ref, *xml = NULL;
hex = read_file(test_frame_table[i][0]);
xml_ref = read_file(test_frame_table[i][1]);
len = hex_to_bin(bin, sizeof(bin), hex);
mbus_parse(&frame, bin, len);
mbus_frame_data_parse(&frame, &frame_data);
xml = mbus_frame_data_xml(&frame_data);
//printf("xml = %s\n", xml);
//printf("xml_ref = %s\n", xml_ref);
CU_ASSERT(xml != NULL);
if (xml)
{
int res = strcmp(xml, xml_ref);
CU_ASSERT(res == 0);
if (res != NULL)
{
printf("Unit test failed for %s\n", test_frame_table[i][0]);
}
}
if (hex) free(hex);
if (xml_ref) free(xml_ref);
}
return;
}
//------------------------------------------------------------------------------
// setup and run the tests
//------------------------------------------------------------------------------
int main()
{
CU_pSuite pSuite = NULL;
if (CUE_SUCCESS != CU_initialize_registry())
{
return CU_get_error();
}
if ((pSuite = CU_add_suite("MBUS frame parse test suite", init_suite, clean_suite)) == NULL)
{
CU_cleanup_registry();
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "test_frames", test_frames))
{
CU_cleanup_registry();
return CU_get_error();
}
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
}

View File

@ -0,0 +1 @@
68 3C 3C 68 08 08 72 78 03 49 11 77 04 0E 16 0A 00 00 00 0C 78 78 03 49 11 04 13 31 D4 00 00 42 6C 00 00 44 13 00 00 00 00 04 6D 0B 0B CD 13 02 27 00 00 09 FD 0E 02 09 FD 0F 06 0F 00 01 75 13 D3 16

View File

@ -0,0 +1 @@
68 56 56 68 08 01 72 23 15 01 09 77 04 14 07 25 00 00 00 0C 78 23 15 01 09 0D 7C 08 44 49 20 2E 74 73 75 63 0A 35 35 37 36 37 30 41 4C 39 30 04 6D 1A 0E CD 13 02 7C 09 65 6D 69 74 20 2E 74 61 62 D4 09 04 13 1F 00 00 00 04 93 7F 00 00 00 00 44 13 1F 00 00 00 0F 00 01 1F A9 16

1
test/test-frames/EDC.hex Normal file
View File

@ -0,0 +1 @@
68 AE AE 68 28 01 72 95 08 12 11 83 14 02 04 17 00 00 00 84 00 86 3B 23 00 00 00 84 00 86 3C D1 01 00 00 84 40 86 3B 00 00 00 00 84 40 86 3C 00 00 00 00 85 00 5B 2B 4B AC 41 85 00 5F 20 D7 AC 41 85 40 5B 00 00 B8 42 85 40 5F 00 00 B8 42 85 00 3B 84 00 35 3F 85 40 3B 00 00 00 00 95 00 3B 95 CF B2 43 95 40 3B 00 00 00 00 85 00 2B 00 00 00 00 85 40 2B 00 00 00 00 95 00 2B D3 9F 90 46 95 40 2B 00 00 00 00 04 6D 19 0F 8A 17 84 00 7C 01 43 F3 0D 00 00 84 40 7C 01 43 9D 01 00 00 84 00 7C 01 63 01 00 00 00 84 40 7C 01 63 01 00 00 00 0F 2F 16

View File

@ -0,0 +1 @@
68 A1 A1 68 08 00 72 45 33 08 24 C5 14 00 04 66 27 00 00 04 78 91 7B 6F 01 04 6D 17 2E CC 13 04 15 00 00 00 00 44 15 00 00 00 00 84 01 15 00 00 00 00 04 06 00 00 00 00 44 06 00 00 00 00 84 01 06 00 00 00 00 84 10 06 00 00 00 00 C4 10 06 00 00 00 00 84 11 06 00 00 00 00 42 6C BF 1C 02 6C DF 1C 84 20 06 00 00 00 00 84 30 06 00 00 00 00 04 3B 00 00 00 00 14 3B 19 00 00 00 04 2B 00 00 00 00 14 2B 0B 00 00 00 02 5B 16 00 02 5F 15 00 04 61 09 00 00 00 02 23 0C 02 01 FD 17 00 04 90 28 0B 00 00 00 EB 16

View File

@ -0,0 +1 @@
68 51 51 68 08 0B 72 54 02 99 04 C5 14 00 06 0C 27 00 00 04 78 2E 25 4C 00 04 6D 0A 0C CD 13 04 13 4C 01 00 00 44 13 4B 01 00 00 84 01 13 4C 01 00 00 42 6C BF 1C 02 6C DF 1C 04 3B 00 00 00 00 14 3B 16 08 00 00 02 23 A7 04 01 FD 17 00 04 90 28 08 00 00 00 3F 16

View File

@ -0,0 +1 @@
68 68 68 68 08 00 72 51 39 49 44 93 15 2F 04 A1 70 00 00 0C 06 00 00 00 00 8C 10 06 00 00 00 00 8C 20 13 00 00 00 00 0C 13 00 00 00 00 3C 2B BD EB DD DD 3B 3B BD EB DD 0A 5A 27 02 0A 5E 26 02 0A 62 01 00 0A 27 30 07 04 6D 09 0D CD 13 4C 06 00 00 00 00 4C 13 00 00 00 00 CC 10 06 00 00 00 00 CC 20 13 00 00 00 00 42 6C BF 15 40 16

View File

@ -0,0 +1 @@
68 F4 F4 68 08 00 72 29 26 03 00 B5 15 10 02 02 00 00 00 0C 78 29 26 03 00 84 10 03 54 05 00 00 84 20 03 00 00 00 00 84 90 40 03 AE 1E 00 00 84 A0 40 03 00 00 00 00 04 AB FF 01 FE FF FF FF 04 AB FF 02 00 00 00 00 04 AB FF 03 00 00 00 00 04 2B FE FF FF FF 84 80 40 AB FF 01 0E 00 00 00 84 80 40 AB FF 02 00 00 00 00 84 80 40 AB FF 03 00 00 00 00 84 80 40 2B 0E 00 00 00 02 FD C8 FF 01 D1 08 02 FD C8 FF 02 00 00 02 FD C8 FF 03 00 00 22 FD C8 FF 01 52 07 22 FD C8 FF 02 00 00 22 FD C8 FF 03 00 00 12 FD C8 FF 01 6A 09 12 FD C8 FF 02 00 00 12 FD C8 FF 03 00 00 03 FD D9 FF 01 BE FF FF 03 FD D9 FF 02 00 00 00 03 FD D9 FF 03 00 00 00 03 FD 59 BE FF FF 01 FF E1 FF 01 0D 01 FF E1 FF 02 00 01 FF E1 FF 03 00 02 FF 52 F4 01 02 FD 60 38 00 01 FD 17 00 74 16

View File

@ -0,0 +1 @@
68 90 90 68 08 01 72 57 26 80 00 CD 4E 08 04 46 00 00 00 04 06 98 14 00 00 04 14 6B D6 01 00 84 40 14 79 66 01 00 02 5B 1C 00 02 5F 22 00 02 62 00 00 04 22 B1 A1 00 00 04 26 B1 A1 00 00 04 3B 00 00 00 00 04 2C 00 00 00 00 04 6D 0C 0C BD 16 84 40 6E 00 00 00 00 84 80 40 6E 00 00 00 00 1F C4 09 01 01 12 00 01 01 01 07 57 26 80 00 CD 4E 08 04 07 A3 FF 03 57 26 80 00 04 04 0D 02 FF 0F 05 3C FF 62 E7 62 96 0A 89 0A 02 00 15 40 17 01 00 00 63 42 DE 16

View File

@ -0,0 +1,116 @@
<MBusData>
<SlaveInformation>
<Id>802657</Id>
<Manufacturer>SVM</Manufacturer>
<Version>8</Version>
<ProductName>Elster F2</ProductName>
<Medium>Heat: Outlet</Medium>
<AccessNumber>70</AccessNumber>
<Status>00</Status>
<Signature>0000</Signature>
</SlaveInformation>
<DataRecord id="0">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Energy (kWh)</Unit>
<Value>5272</Value>
</DataRecord>
<DataRecord id="1">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume (1e-2 m^3)</Unit>
<Value>120427</Value>
</DataRecord>
<DataRecord id="2">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Volume (1e-2 m^3)</Unit>
<Value>91769</Value>
</DataRecord>
<DataRecord id="3">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Flow temperature (deg C)</Unit>
<Value>28</Value>
</DataRecord>
<DataRecord id="4">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Return temperature (deg C)</Unit>
<Value>34</Value>
</DataRecord>
<DataRecord id="5">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Temperature Difference (1e-1 deg C)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>On time (hours)</Unit>
<Value>41393</Value>
</DataRecord>
<DataRecord id="7">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Operating time (hours)</Unit>
<Value>41393</Value>
</DataRecord>
<DataRecord id="8">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Volume flow (m m^3/h)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="9">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Power (10 W)</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="10">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Time Point (time &amp; date)</Unit>
<Value>2013-06-29T12:12:00</Value>
</DataRecord>
<DataRecord id="11">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>1</Device>
<Unit>Units for H.C.A.</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="12">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Tariff>0</Tariff>
<Device>2</Device>
<Unit>Units for H.C.A.</Unit>
<Value>0</Value>
</DataRecord>
<DataRecord id="13">
<Function>More records follow</Function>
<Value>C4 09 01 01 12 00 01 01 01 07 57 26 80 00 CD 4E 08 04 07 A3 FF 03 57 26 80 00 04 04 0D 02 FF 0F 05 3C FF 62 E7 62 96 0A 89 0A 02 00 15 40 17 01 00 00 63 42</Value>
</DataRecord>
</MBusData>

View File

@ -0,0 +1 @@
68 92 92 68 08 28 72 55 00 00 19 43 4C 16 02 BF 00 00 00 8C 10 04 93 02 00 00 8C 11 04 93 02 00 00 8C 20 04 06 00 00 00 8C 21 04 06 00 00 00 02 FD C9 FF 01 DF 00 02 FD DB FF 01 00 00 02 AC FF 01 00 00 82 40 AC FF 01 00 00 02 FD C9 FF 02 00 00 02 FD DB FF 02 00 00 02 AC FF 02 00 00 82 40 AC FF 02 00 00 02 FD C9 FF 03 00 00 02 FD DB FF 03 00 00 02 AC FF 03 00 00 82 40 AC FF 03 00 00 02 FF 68 00 00 02 AC FF 00 00 00 82 40 AC FF 00 00 00 01 FF 14 00 0A 16

View File

@ -0,0 +1 @@
68 42 42 68 08 00 72 95 50 26 21 AE 4C 0E 04 B5 10 00 00 0C 06 00 00 00 00 0C 13 00 00 00 00 0C 3B 00 00 00 00 0C 2B 00 00 00 00 02 5A C9 00 02 5E CA 00 03 60 00 00 00 0C 78 95 50 26 21 0C FD 10 95 50 26 21 1F EC 16

View File

@ -0,0 +1 @@
68 41 41 68 08 00 72 89 16 35 24 AE 4C 0B 04 54 10 00 00 0C 07 00 00 00 00 0C 14 00 00 00 00 0C 3C 00 00 00 00 0C 2C 00 00 00 00 32 5A 00 00 32 5E 00 00 33 60 00 00 00 0C 78 89 16 35 24 0C FD 10 89 16 35 24 CE 16

View File

@ -0,0 +1 @@
68 5C 5C 68 08 04 72 14 73 81 11 82 4D 06 04 03 00 00 00 0C 78 14 73 81 11 0C 06 00 00 00 00 0C 14 02 00 00 00 0A 3B 00 00 0B 5A 18 02 00 0B 5E 20 02 00 0B 61 18 00 F0 32 26 00 00 02 27 98 04 04 6D 02 0E CD 13 84 40 14 7B 00 00 00 84 80 40 14 41 01 00 00 09 FD 0E 03 09 FD 0F 18 0F 00 16 DB 16

View File

@ -0,0 +1 @@
68 EF EF 68 08 02 72 84 50 42 31 4D 6A 81 04 73 27 00 00 04 06 03 00 00 00 02 FD 17 00 00 84 04 6D 00 00 E1 11 84 04 06 03 00 00 00 84 05 06 03 00 00 00 04 13 4A 00 00 00 04 3B 00 00 00 00 54 3B 2B 00 00 00 54 6D 1E 08 61 19 04 2D 00 00 00 00 94 01 2D 14 00 00 00 94 01 6D 1E 08 61 19 02 59 17 08 02 5D F6 07 04 6D 2D 0C CD 13 82 80 01 6C C1 13 84 80 01 06 03 00 00 00 C2 80 01 6C C1 12 C4 80 01 06 03 00 00 00 82 81 01 6C C1 11 84 81 01 06 03 00 00 00 C2 81 01 6C A1 1C C4 81 01 06 03 00 00 00 82 82 01 6C A1 1B 84 82 01 06 03 00 00 00 C2 82 01 6C A1 1A C4 82 01 06 03 00 00 00 82 83 01 6C A1 19 84 83 01 06 03 00 00 00 C2 83 01 6C A1 18 C4 83 01 06 03 00 00 00 92 80 01 6C C1 13 94 80 01 3B 00 00 00 00 94 80 01 2D 00 00 00 00 8F 16

View File

@ -0,0 +1 @@
68 5E 5E 68 08 00 72 90 85 71 26 24 23 28 04 73 50 00 00 0C 05 00 00 00 00 0C 12 42 07 00 00 3C 2A DD B4 EB DD 3B 3A DD B4 EB 0A 5A 04 02 0A 5E 04 02 0A 62 00 00 04 6D 22 10 8D 11 4C 05 00 00 00 00 44 6D 3B 17 7E 14 44 ED 7E 3B 17 9E 14 8C 01 05 00 00 00 00 84 01 6D 3B 17 7F 1C 0B 26 53 65 08 04 16

Some files were not shown because too many files have changed in this diff Show More