RadioHead send question

Hi folks. I’m using some RF95 LoRa modules to set up some communications. Things are working wonderfully in testing, but I’m about to start writing some more robust code and I have a question about some documentation I ran across.

It’s for the send method.

Specifically for the length parameter:

Parameters
[in] data Array of data to be sent
[in] len Number of bytes of data to send specify the maximum time in ms to wait. If 0 (the default) do not wait for CAD before transmitting.

What? Like it makes sense up to the word “send” and then it’s like something got deleted and it just goes off into the rest of some other sentence. Do I really use the length parameter to check the CAD? If I do that then how do I tell it the length of the packet?

I’m hoping someone out there knows how to use this stuff and can tell me better what to do here before I have to go digging through this library. I want to have the radio check the CAD to see if there is traffic before it transmits so I don’t have collisions with packets because in my testing that seems to screw things up. They can’t both be talking at the same time.

But I don’t know if I need to call waitCAD() myself or if that is happening as part of send.

Hi, I haven't had to go this deep into the library, but I think it is in relation to this ; waitPacketSent() and Channel Activity Detection (CAD)

Parameters [in] data Array of data to be sent [in] len Number of bytes of data to send specify the maximum time in ms to wait. If 0 (the default) do not wait for CAD before transmitting

The packet of "data" array, and length "len" will only be sent after the transmitter has finished with any previous packet.

waitPacketSent()

Sets the time between packet transmissions, the default is 0 time. Zero time means CAD will not be implemented as no time set between packet transmissions.

If you have two way transmission, and/or more than one Lora device on the same frequency, then CAD would have to be set higher than 0.

I think that is how you read it.

Tom... :)

But this doc reads as if I set that by using the len parameter. That doesn't seem right. Where should I set up the CAD?

Bear in mind that CAD does not with weak signals, but as long as your not at the limits of LoRa reception, not a problem.

Hi, You setup CAD with waitPacketSent();

[in] len Number of bytes of data to send specify the maximum time in ms to wait. If 0 (the default) do not wait for CAD before transmitting

Should be;

[in] len Number of bytes of data to send. Specify the maximum time in ms to wait. If 0 (the default) do not wait for CAD before transmitting

Maximum time set in waitPacketSent();

Tom.... :)