|
|
@@ -31,6 +31,7 @@
|
|
|
#include "../commhub/commhub.h"
|
|
|
#include "../commhub/client_utils.h"
|
|
|
|
|
|
+#define PIU_MINDER_VERSION "1.0.1"
|
|
|
|
|
|
int piu_fd = -1;
|
|
|
int hub_fd = -1;
|
|
|
@@ -321,6 +322,13 @@ int main(int argc, char **argv) {
|
|
|
_usec_ratelimit_prv = _usec_ratelimit_now;
|
|
|
_usec_ratelimit_del = 1000000;
|
|
|
|
|
|
+ if ( (argc>1) && (
|
|
|
+ (strncmp(argv[1], "-h", 3)==0) ||
|
|
|
+ (strncmp(argv[1], "-v", 3)==0) ) ) {
|
|
|
+ printf("piu_minder version: %s\n", PIU_MINDER_VERSION);
|
|
|
+ exit(0);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
configure_signal_handlers(argv[0]);
|
|
|
maintain_ipc_hub_connect(argv[0]);
|
|
|
@@ -510,9 +518,12 @@ int main(int argc, char **argv) {
|
|
|
//
|
|
|
trav += 3;
|
|
|
|
|
|
- // Ignore null reads.
|
|
|
+ // Ignore null reads and
|
|
|
+ // spurious 1-bit reads
|
|
|
//
|
|
|
- if(strcmp(trav,"0|0")) {
|
|
|
+ if ( (strcmp(trav,"0|0")!=0) &&
|
|
|
+ (strcmp(trav,"1|0")!=0) &&
|
|
|
+ (strcmp(trav,"1|1")!=0) ) {
|
|
|
prepare_message(&outgoing_msg, MAILBOX_TOKEN_RFID, trav, strlen(trav) + 1);
|
|
|
send_message(hub_fd, &outgoing_msg);
|
|
|
}
|