Encoding the Yabby 3 LoRaWAN® Downlink
You can find the full payload specification here, and a downlink encoder below.
Yabby 3 LoRaWAN Downlink Encoder
This encoder is written in Java Script and may be freely used as example code. To inspect the code, open this link and inspect the Java Script source. Usually this is done with F12 in your browser.