X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/blobdiff_plain/e09806b632a86c2b18fc4b129e10ab23e898b0dc..c44f15b8a62ff2828fdcfcfe3f64036bd4051962:/hmsniff.c diff --git a/hmsniff.c b/hmsniff.c index 837f4e0..39133d3 100644 --- a/hmsniff.c +++ b/hmsniff.c @@ -32,6 +32,7 @@ #include #include +#include "version.h" #include "hexdump.h" #include "hmcfgusb.h" @@ -188,7 +189,7 @@ int main(int argc, char **argv) } printf("HM-CFG-USB opened!\n"); - hmcfgusb_send_null_frame(dev); + hmcfgusb_send_null_frame(dev, 1); hmcfgusb_send(dev, (unsigned char*)"K", 1, 1); while(!quit) { @@ -206,11 +207,13 @@ int main(int argc, char **argv) continue; } else if (fd == -1) { if (errno) { - perror("hmcfgusb_poll"); - break; - } else { - /* periodically wakeup the device */ - hmcfgusb_send_null_frame(dev); + if (errno != ETIMEDOUT) { + perror("hmcfgusb_poll"); + break; + } else { + /* periodically wakeup the device */ + hmcfgusb_send_null_frame(dev, 1); + } } } }