From 586e9c7740336e88f305f4a7a45a955a510cfb17 Mon Sep 17 00:00:00 2001 From: Bruce Lacey Date: Sun, 23 Mar 2014 21:24:00 -0700 Subject: [PATCH] Added isValid() method to RF24.h as requested by andreij in http://forum.mysensors.org/topic/6/update-rf24-library-to-latest-version#12 --- libraries/RF24/RF24.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/RF24/RF24.h b/libraries/RF24/RF24.h index b7d3c7a..713b38e 100644 --- a/libraries/RF24/RF24.h +++ b/libraries/RF24/RF24.h @@ -673,6 +673,14 @@ public: */ bool testRPD(void) ; + /** + * Test whether this is a real radio, or a mock shim for + * debugging. Setting either pin to 0xff is the way to + * indicate that this is not a real radio. + * + * @return true if this is a legitimate radio + */ + bool isValid() { return ce_pin != 0xff && csn_pin != 0xff; } /** * Calculate the maximum timeout in us based on current hardware