Library for HopeRF RFM22 / RFM22B transceiver module ported to mbed. Original Software from Mike McCauley (mikem@open.com.au) . See http://www.open.com.au/mikem/arduino/RF22/
Dependents: RF22_MAX_test_Send Geofence_receiver Geofence_sender Geofence_sender ... more
More Info about RFM22-modules like connecting and a demo-program see RF22-Notebook
Diff: RF22Datagram.cpp
- Revision:
- 5:0386600f3408
- Parent:
- 0:79c6d0071c4c
--- a/RF22Datagram.cpp Sun Feb 19 21:12:10 2012 +0000 +++ b/RF22Datagram.cpp Sat Mar 02 20:49:07 2013 +0000 @@ -1,7 +1,7 @@ // RF22Datagram.cpp // // Copyright (C) 2011 Mike McCauley -// $Id: RF22Datagram.cpp,v 1.2 2011/02/09 22:26:09 mikem Exp $ +// $Id: RF22Datagram.cpp,v 1.3 2012/05/30 01:50:21 mikem Exp $ // ported to mbed by Karl Zweimueller #include <RF22Datagram.h> @@ -40,12 +40,16 @@ boolean RF22Datagram::recvfrom(uint8_t* buf, uint8_t* len, uint8_t* from, uint8_t* to, uint8_t* id, uint8_t* flags) { + if (recv(buf, len)) + { + if (from) *from = headerFrom(); if (to) *to = headerTo(); if (id) *id = headerId(); if (flags) *flags = headerFlags(); - return recv(buf, len); + return true; + } + return false; } -