Skip to content

Commit

Permalink
doc: tweaks to attn example (#24)
Browse files Browse the repository at this point in the history
* improve attn example

* format tweaks
  • Loading branch information
bsatrom authored Sep 22, 2020
1 parent 30a603e commit 401baa8
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <Wire.h>

// GPIO pin definitions
#define ATTN_INPUT_PIN 5 // Any digital GPIO pin on your board
#define ATTN_INPUT_PIN 5 // Any digital GPIO pin on your board

// Parameters for this example
#define INBOUND_QUEUE_NOTEFILE "my-inbound.qi"
Expand Down Expand Up @@ -72,12 +72,18 @@ void setup() {
JAddStringToObject(req, "product", myProductID);
#if myLiveDemo
JAddStringToObject(req, "mode", "continuous");
JAddBoolToObject(req, "sync", true);
#else
JAddStringToObject(req, "mode", "periodic");
JAddNumberToObject(req, "minutes", 60);
#endif
notecard.sendRequest(req);

// Disarm ATTN To clear any previous state before rearming
req = notecard.newRequest("card.attn");
JAddStringToObject(req, "mode", "disarm,-files");
notecard.sendRequest(req);

// Configure ATTN to wait for a specific list of files
req = notecard.newRequest("card.attn");
const char *filesToWatch[] = {INBOUND_QUEUE_NOTEFILE};
Expand Down Expand Up @@ -131,8 +137,7 @@ void loop() {

// Simulate Processing the response here
char *myCommandType = JGetString(body, INBOUND_QUEUE_COMMAND_FIELD);
notecard.logDebugf("INBOUND REQUEST: %s\n\n", myCommandType);

NoteDebugf("INBOUND REQUEST: %s\n\n", myCommandType);
}

}
Expand Down

0 comments on commit 401baa8

Please sign in to comment.