 From 2a434c95344b0180e163afb195e325a4d4f480e8 Mon Sep 17 00:00:00 2001
-From: JD <100024149@ge.com>
+From: JD <jean.daniel.michaud@gmail.com>
 Date: Fri, 12 May 2017 14:10:59 +0200
 Subject: [PATCH] Add more details to the output (to match ReceiveDemo_Advanced
  output from rc-switch)

+          }
+          fprintf(stdout, "\n");
         }
     
         mySwitch.resetAvailable();
-- 
2.10.2


+  returnValue[pos2] = '\0';
+  return returnValue;
+}

 int main(int argc, char *argv[]) {

@@ -36,18 +76,31 @@ int main(int argc, char *argv[]) {
      if (pulseLength != 0) mySwitch.setPulseLength(pulseLength);
      mySwitch.enableReceive(PIN);  // Receiver on interrupt 0 => that is pin #2

-
      while(1) {

       if (mySwitch.available()) {

-        int value = mySwitch.getReceivedValue();
+        unsigned long decimal = mySwitch.getReceivedValue();
+        unsigned int length = mySwitch.getReceivedBitlength();
+        unsigned int delay = mySwitch.getReceivedDelay();
+        unsigned int *raw = mySwitch.getReceivedRawdata();
+        unsigned int protocol = mySwitch.getReceivedProtocol();

-        if (value == 0) {
+        if (decimal == 0) {
           printf("Unknown encoding\n");
         } else {
-
-          printf("Received %i\n", mySwitch.getReceivedValue() );
+          const char* b = dec2binWzerofill(decimal, length);
+          fprintf(stdout, "Decimal: %u (%i bits)\n", decimal, length);
