From c2f7c0d48e087d0aaa1a0093adb662f08f1e24ba Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Tue, 29 May 2012 20:51:34 +0200 Subject: [PATCH] Improved wildcard search results (still not all meters were found) - sleep 1 second after each init frame - select secondary address with enabled FCB bit --- bin/mbus-serial-scan-secondary.c | 2 ++ mbus/mbus-protocol.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/mbus-serial-scan-secondary.c b/bin/mbus-serial-scan-secondary.c index 92dc3d3..61be9af 100644 --- a/bin/mbus-serial-scan-secondary.c +++ b/bin/mbus-serial-scan-secondary.c @@ -137,6 +137,7 @@ main(int argc, char **argv) } (void) mbus_recv_frame(handle, &reply); + sleep(1); frame->control = MBUS_CONTROL_MASK_SND_NKE | MBUS_CONTROL_MASK_DIR_M2S; frame->address = 0xFF; @@ -149,6 +150,7 @@ main(int argc, char **argv) } (void) mbus_recv_frame(handle, &reply); + sleep(1); mbus_scan_2nd_address_range(handle, 0, addr_mask); diff --git a/mbus/mbus-protocol.c b/mbus/mbus-protocol.c index b1027c1..bd7d38f 100644 --- a/mbus/mbus-protocol.c +++ b/mbus/mbus-protocol.c @@ -3762,7 +3762,7 @@ mbus_frame_select_secondary_pack(mbus_frame *frame, char *address) return -1; } - frame->control = MBUS_CONTROL_MASK_SND_UD | MBUS_CONTROL_MASK_DIR_M2S; + 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