Hey there!
Ok, so for the delays calculation you might need to read a litle of the this post: How to calculate the transmission time of a packet
There you have an example document to determine de time durantion of each delay, depending on your uwb caracteristics.
Another point is the antenna delay values that you need to load/configure (this is just a reminder). The antenna delay values if they are not well determined they could cause an impact on you range values. So if you have this kind of code, you probably have the examples provided from decawave source code, so probably you know all of this subject.
In last reminder, use the application note to write code, cause there this delays are explained a bit (i think).
Hope i could help.
Cheerz