commit
ded841eeb5
1
.gitignore
vendored
1
.gitignore
vendored
@ -53,6 +53,7 @@ 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
|
||||
|
@ -77,6 +77,7 @@ dist_man_MANS = libmbus.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 \
|
||||
|
@ -30,6 +30,8 @@ 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
|
||||
@ -52,6 +54,8 @@ 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:
|
||||
@ -113,6 +117,10 @@ MBus secondary address of the device. Sixteen digit hexadecimal number.
|
||||
|
||||
For serial communication, the baudrate to which the device should be switched.
|
||||
|
||||
=item B<file>
|
||||
|
||||
Path to an file with hex values.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
|
@ -146,7 +146,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
address = 253;
|
||||
address = MBUS_ADDRESS_NETWORK_LAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -113,7 +113,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send M-Bus request frame.\n");
|
||||
return 1;
|
||||
|
@ -95,7 +95,7 @@ main(int argc, char **argv)
|
||||
|
||||
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
printf("Failed to send request to selected secondary device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
|
2
bin/mbus-tcp-raw-send.1
Normal file
2
bin/mbus-tcp-raw-send.1
Normal file
@ -0,0 +1,2 @@
|
||||
.so man1/libmbus.1
|
||||
|
@ -112,7 +112,7 @@ main(int argc, char **argv)
|
||||
fprintf(stderr, "%s: Error: Failed to select secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
address = 253;
|
||||
address = MBUS_ADDRESS_NETWORK_LAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
address = 253;
|
||||
address = MBUS_ADDRESS_NETWORK_LAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send M-Bus request frame.\n");
|
||||
return 1;
|
||||
|
@ -80,7 +80,7 @@ main(int argc, char **argv)
|
||||
|
||||
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
printf("Failed to send request to selected secondary device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
|
19
clean.sh
19
clean.sh
@ -20,13 +20,16 @@ true \
|
||||
&& 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 \
|
||||
@ -34,17 +37,31 @@ true \
|
||||
&& 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 bin/.libs \
|
||||
&& 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 \
|
||||
|
@ -1983,7 +1983,7 @@ mbus_probe_secondary_address(mbus_handle * handle, const char *mask, char *match
|
||||
if (ret == MBUS_PROBE_SINGLE)
|
||||
{
|
||||
/* send a data request command to find out the full address */
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
MBUS_ERROR("%s: Failed to send request to selected secondary device [mask %s]: %s.\n",
|
||||
__PRETTY_FUNCTION__,
|
||||
@ -2082,7 +2082,7 @@ int mbus_read_slave(mbus_handle * handle, mbus_address *address, mbus_frame * re
|
||||
}
|
||||
/* else MBUS_PROBE_SINGLE */
|
||||
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
MBUS_ERROR("%s: Failed to send M-Bus request frame.\n",
|
||||
__PRETTY_FUNCTION__);
|
||||
|
@ -3956,8 +3956,8 @@ mbus_frame_select_secondary_pack(mbus_frame *frame, char *address)
|
||||
}
|
||||
|
||||
frame->control = MBUS_CONTROL_MASK_SND_UD | MBUS_CONTROL_MASK_DIR_M2S | MBUS_CONTROL_MASK_FCB;
|
||||
frame->address = 253; // for addressing secondary slaves
|
||||
frame->control_information = 0x52; // mode 1
|
||||
frame->address = MBUS_ADDRESS_NETWORK_LAYER; // for addressing secondary slaves
|
||||
frame->control_information = MBUS_CONTROL_INFO_SELECT_SLAVE; // mode 1
|
||||
|
||||
frame->data_size = 8;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user