Closed jgromes closed 1 year ago
Finally got around to this, Stream is now implemented for SX127x. Have to say, watching the waterfall is quite funny when sending 512 byte packets using a 4800 bps transmission.
Will add support for the other modules mentioned above in the coming days.
As per discussion in #163 with @phretor and @rnbokade, it could be possible to extend maximum packet length beyond the FIFO size limitation by providing user with methods to feed the FIFO "on-the-fly", essentially creating a data stream instead of packetized transfer. This could be implemented for any module with interrupts on FIFO level, currently:
Transmitter (method names are placeholders):
radio.setFifoEmptyAction(fifoAdd);
, much likesetFlag
/setDio0Action
.startTransmit()
enables interrupt for some FIFO level. If not, interrupt is not enabled.startTransmit
begins transmission just like the current implementation and returns immediately after setting mode to Tx.fifoAdd
ISR now gets called every time FIFO level gets low enough, progressively filling FIFO with new bytes to be sent.remLength
gets to zero, FIFO level interrupt is disabled and transmission is considered finished.Receiver structure is the same, the only difference is that interrupt must be triggered on a different FIFO fill level (close to full), and the method called from ISR is extracting bytes from (e.g.
fifoGet(uint8_t* buffPtr, size_t* remLength)
).