home
topology files
command‑line options
the core API
FAQ
download and install
|
cnet's Application Programming Interface
- NAME
- CNET_get_position - get the node's location on the simulation map
- SYNOPSIS
-
#include <cnet.h>
int CNET_get_position(CnetPosition *now, CnetPosition *max);
- DESCRIPTION
-
All simulations run within a rectangular region whose dimensions are
set in the toplology file by specifying the attributes of
mapwidth and mapheight as two non-negative integer values.
Nodes of all types may determine their current location,
and the maximum dimensions of the simulation map,
by calling CNET_get_position .
If the value NULL is passed for either of the two parameters,
the corresponding position is not provided.
Calls to CNET_get_position during simulations not using the
graphical interface are still meaningful.
The dimensions of the simulation area are measured in metres,
and may be specified by setting the mapwidth and mapheight
attributes in the toplogy file.
Distances, in metres,
are used in the default calculations of wireless signal strength and
propagation delay of LT_WLAN transmissions.
- RETURN VALUE
-
The value
0 is always returned.
- SEE ALSO
-
CNET_set_position.
|