RUI3 Channel Activity Detection

Using a RAK3172 with Arduino and wanted to do CAD. Looking at the API documentation I didn’t see anything on it. However, looking at the source code it definitely shows there are some API hooks and they are available in the Arduino environment. Was wondering if there is any documentation on the CAD capabilities.

From my poking around…
api.lorawan.psend - has third parameter - bool Channel – Activity Detection enable parameter
api.lorawan.registerPSendCADCallback() - register the callback for CAD.

Seems like I just enable it on the send and register a callback which I am guessing will get called if the channel is in use, otherwise the packet will be sent. So in the callback I just queue the packet and attempt to resend some random time later (Maybe allow this is happen X number of times before giving up).

Documentation needs updates.

I am using CAD in my RUI3-Best-Practices examples, but not to a full attempt.

Your approach should work. The CAD callback has a parameter that tells you whether channel activity was detected or not.
If no activity, the data was sent out.

void cad_cb(bool result)
{
	MYLOG("CAD-P2P-CB", "P2P CAD reports %s", result ? "activity" : "no activity");
}

Thanks again, you all are great at responding to all these questions (I have posted 3 times), it really makes the product experience great!