From 0412f6913c1ac76680de07e166015778c852545d Mon Sep 17 00:00:00 2001 From: Norbert Wilms Date: Sun, 23 Mar 2014 22:34:10 +0100 Subject: [PATCH 1/4] Update RF24Network.h Changed returnvalue from update() from void to bool --- RF24Network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RF24Network.h b/RF24Network.h index 4d599c4..7315c35 100644 --- a/RF24Network.h +++ b/RF24Network.h @@ -104,7 +104,7 @@ class RF24Network * This function must be called regularly to keep the layer going. This is where all * the action happens! */ - void update(void); + bool update(void); /** * Test whether there is a message available for this node From 55851b61e8c29aabb56a07950ad6e837ec6c96eb Mon Sep 17 00:00:00 2001 From: Norbert Wilms Date: Sun, 23 Mar 2014 22:36:58 +0100 Subject: [PATCH 2/4] Update RF24Network.cpp Changed returntype from update() from void to bool --- RF24Network.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/RF24Network.cpp b/RF24Network.cpp index 07d438a..33f0317 100644 --- a/RF24Network.cpp +++ b/RF24Network.cpp @@ -50,14 +50,16 @@ void RF24Network::begin(uint8_t _channel, uint16_t _node_address ) /******************************************************************/ -void RF24Network::update(void) +bool RF24Network::update(void) { // if there is data ready uint8_t pipe_num; - while ( radio.available(&pipe_num) ) + boolean has_message=false; + while ( radio.isValid() && radio.available(&pipe_num) ) { // Dump the payloads until we've gotten everything boolean done = false; + has_message=true; while (!done) { // Fetch the payload, and see if this was the last one. @@ -98,6 +100,7 @@ void RF24Network::update(void) #endif } } + return has_message; } /******************************************************************/ From 49af92ef65d0d42b629d0f7420c5f9be638330c9 Mon Sep 17 00:00:00 2001 From: Norbert Wilms Date: Sun, 23 Mar 2014 22:40:20 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f68418b..32ccfdd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # Network Layer for nRF24L01(+) radios Please see the full documentation at http://maniacbug.github.com/RF24Network/index.html + +Update: Returntype of function update changed from void to bool. +Advantage of this change: If there is tru-trafic on a node you can act. From 5b2792c410992e940726eb533a12766427b4d1a8 Mon Sep 17 00:00:00 2001 From: Norbert Wilms Date: Sun, 23 Mar 2014 22:42:23 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 32ccfdd..076449d 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,4 @@ Please see the full documentation at http://maniacbug.github.com/RF24Network/index.html Update: Returntype of function update changed from void to bool. -Advantage of this change: If there is tru-trafic on a node you can act. +Advantage of this change: If there is through-trafic on a node you can act inside the sketch.