Files at this revision

API Documentation at this revision

Comitter:
pangsk
Date:
Tue Mar 13 10:21:46 2012 +0000
Parent:
4:cd581c12a4b9
Commit message:
Added ACK macro for mbed.

Changed in this revision

RF12B.cpp Show annotated file Show diff for this revision Revisions of this file
RF12B.h Show annotated file Show diff for this revision Revisions of this file
diff -r cd581c12a4b9 -r 12d8175359f2 RF12B.cpp
--- a/RF12B.cpp	Tue Feb 28 10:53:46 2012 +0000
+++ b/RF12B.cpp	Tue Mar 13 10:21:46 2012 +0000
@@ -209,6 +209,11 @@
     return  (uint8_t*)rf12_data;
 
 }
+ uint8_t RF12B::get_hdr(void)
+{
+    return rf12_hdr;
+
+}
 
 
 uint8_t  RF12B::rf12_recvDone (void) {
diff -r cd581c12a4b9 -r 12d8175359f2 RF12B.h
--- a/RF12B.h	Tue Feb 28 10:53:46 2012 +0000
+++ b/RF12B.h	Tue Mar 13 10:21:46 2012 +0000
@@ -25,7 +25,12 @@
 #define RF12_WANTS_ACK ((rf12_hdr & RF12_HDR_ACK) && !(rf12_hdr & RF12_HDR_CTL))
 #define RF12_ACK_REPLY (rf12_hdr & RF12_HDR_DST ? RF12_HDR_CTL : \
             RF12_HDR_CTL | RF12_HDR_DST | (rf12_hdr & RF12_HDR_MASK))
-            
+ 
+// New for mbed 
+#define RF12_WANTS_ACK_MBED ((radiolink.get_hdr() & RF12_HDR_ACK) && !(radiolink.get_hdr() & RF12_HDR_CTL))
+#define RF12_ACK_REPLY_MBED (radiolink.get_hdr() & RF12_HDR_DST ? RF12_HDR_CTL : \
+            RF12_HDR_CTL | RF12_HDR_DST | (radiolink.get_hdr() & RF12_HDR_MASK))
+                       
             
 //enum rfmode_t{RX, TX};
 
@@ -52,6 +57,7 @@
    uint16_t check_crc(void);
    uint8_t length(void);
    uint8_t* get_data(void);
+   uint8_t get_hdr(void);
    
 protected: