LQI values in python


I already readied the following datasheets:

Digi Connect® Family (command reference)
ConnectPort™ X Family User’s Guide
XBee®/XBee-PRO® ZB RF Modules
Zigbee specification

But i havent found how the Xbee modules of digi compute the LQI values, on the Zigbee specification tell about a link cost but still are missing the pl (probability packet delivery
I’ve been told that part of the LQI calculation use the RSSI value.

So if some could tell me how the LQI value is calculated will be great

Thanks in advance