Applicable Versions
NetSim Standard 
NetSim Pro

Applicable Releases

DEVICE_DISTANCE(d1,d2) is the API to get the distance between any 2 devices. This declaration is found in Stack.h file. Expand 'External dependencies' in any project in NetSim.sln file to find the Stack.h file.

where d1 and d2 are the device id's

Example : 

double TX_RX_distance = DEVICE_DISTANCE(pstruEventDetails->pPacket->nSourceId, pstruEventDetails->pPacket->nDestinationId)