| Applicable Versions | NetSim Standard | NetSim Pro |
| Applicable Releases | v11 | v12 | v13 |
WLAN/MANET/VANET:
WSN/IoT
The case PHYSICAL_IN_EVENT which is part of the switch() statement present in fn_NetSim_Zigbee_Run() function of 802_15_4.c file in ZigBee project is triggered whenever a packet is received at the receiver. You may set the received power to 0 if the distance is beyond the range that you want to set (Eg: 100m ) and set it to a larger value if it is less than your range definition.
You can also explicitly mark the packet as Error, No Error or Collided based on your range specifications, by setting the nPacketStatus filed of the packet in NetSim so that the packet is either sent to the MAC if successful or dropped in case of error/collision. Following are the packet status and the respective values:
PacketStatus_NoError=0
PacketStatus_Error=1
PacketStatus_Collided=2
PacketStatus_Buffer_Dropped = 3
PacketStatus_TTL_Expired = 4
PacketStatus_Dropped = 5
PacketStatus_MAC_Lifetime_Expired=6
PacketStatus_LAST
To know more about modifying and linking the source codes to NetSim, refer to the section on writing your own code in NetSim's User Manual.