Преглед изворни кода

further QR additions

* parsing for piu_main to send the message out
* adding the message type ot commhub.h
clementinecomputing пре 4 година
родитељ
комит
7b1627aaa0
2 измењених фајлова са 15 додато и 1 уклоњено
  1. 14 1
      busunit/PIU/piu_main.c
  2. 1 0
      busunit/commhub/commhub.h

+ 14 - 1
busunit/PIU/piu_main.c

@@ -31,7 +31,7 @@
 #include "../commhub/commhub.h"
 #include "../commhub/client_utils.h"
 
-#define PIU_MINDER_VERSION "1.0.1"
+#define PIU_MINDER_VERSION "1.0.2"
 
 int piu_fd = -1;
 int hub_fd = -1;
@@ -531,6 +531,19 @@ int main(int argc, char **argv) {
                   }
                   break;
 
+		case 'Q':
+
+		  trav += 3;
+
+                  // Ignore ACK message
+                  //
+                  if(strcmp(trav, "^")) {
+                    prepare_message(&outgoing_msg, MAILBOX_TOKEN_QR, trav, strlen(trav) + 1);
+                    send_message(hub_fd, &outgoing_msg);
+                  }
+                  break;
+
+
                 // handle warnings
                 //
                 case '*':

+ 1 - 0
busunit/commhub/commhub.h

@@ -170,6 +170,7 @@ long long int get_usec_time();
 //--------- ACTION MESSAGES
 #define MAILBOX_TOKEN_MAG       "TOKEN_MAG"		//A Magstripe has been presented.  Parameter is the magstripe output
 #define MAILBOX_TOKEN_RFID      "TOKEN_RFID"		//An RFID card has been presented.  Parameter is the RFID output
+#define MAILBOX_TOKEN_QR        "TOKEN_QR"		//An RFID card has been presented.  Parameter is the RFID output
 #define MAILBOX_FLUSH_PASSES    "FLUSH_PASSES"		//A request has been made to flush the pass database
 #define MAILBOX_UPDATE_PASSES   "UPDATE_PASSES"		//A request has been made to try to update the pass database
 #define MAILBOX_DRIVER_NOTIFY   "DRIVER_NOTIFY"		//A message is being transmitted to the user