rf12_easySend()

Submit some data bytes to send using the easy transmission mechanism. The data bytes will be copied to an internal buffer since the actual send may take place later than specified, and may need to be re-transmitted in case packets are lost of damaged in transit.

Packets will be sent no faster than the rate specified in the rf12_easyInit() call, even if called more often.

Only packets which differ from the previous packet will actually be sent. To force re-transmission even if the data hasn't changed, call "rf12_easySend(0,0)". This can be used to give a "sign of life" every once in a while, and to recover when the receiving node has been rebooted and no longer has the previous data.

The return value indicates whether a new packet transmission will be started (1), or the data is the same as before and no send is needed (0).

Note that you also have to call rf12_easyPoll periodically, because it keeps the RF12 logic going. If you don't, rf12_easySend() will never send out any packets.

#include <RF12.h> 
#include <Ports.h> // needed to avoid a linker error :(

char rf12_easySend(const void* buffer, byte length);

Parameters

buffer

A pointer to the data to send.

length

The number of bytes to send.

Notes

This function should be used in combination with rf12_easyInit() and rf12_easyPoll().