bigger packets, isn't that what all the blokes want ;-)
But with the RF12 library I tripped over a little something I thought I report over here.
in RF12.cpp there is the following declaration :
static volatile int8t rxstate; // current transceiver state
It is used to track the state of the transceiver (sleeping, receiving. waiting for something, sending, still busy sending etc.) But what was less apparent is that this variable is also used to count how much data from the payload must still be sent. To implement this, the number of bytes still to send is put in this variable, as a NEGATIVE number. that is why the declaration is int8t and not uint8t.
switch (rxstate++) {
case TXSYN1: out = 0x2D; break;
case TXSYN2: out = group; rxstate = - (2 + rf12len); break;
case TXCRC1: out = rf12crc; break; // send lower byte of crc
case TXCRC2: out = rf12crc >> 8; break; // send upper byte of crc
case TXDONE: rf12xfer(RFIDLEMODE); // fall through
default: out = 0xAA;
}
It so happened I changed RF12MAXDATA to 128. but 128 is out of range for a int8t !
So, when using bigger packets, be sure to keep RF12MAXDATA + 2 < 128 Or change the definition of the variable rxstate to
static volatile int16t rxstate; // current transceiver state, integer
now you can make a packet as big as 32000 bytes, although such a packet will probably never come through undamaged.
