Display a warning if the radiotap antenna signal is absent and the
signal strength could not be extracted. Change the SS value to 127 dBm
(the maximum and improbable value) in this case.
From the radiotap header, we only use the antenna signal field,
therefore we don't need to handle the fields that are after it. We do
need to take into account the fields preceding the antenna signal field
though, in order to know where it is.
pcap_next_ex() will allow us to detect the end of a capture file. Since
we used pcap_loop() to capture one packet at a time anyway, this won't
change anything for live captures.
The variable names were standardised in functions using pcap data types
('pkt_header' and 'pkt_data' instead of 'header' and 'packet').
If the autocalibration request port was not specified, a warning was
issued. This is now fixed by issuing a warning only if the port is too
big, but not if it is zero.
Differentiate the port on which the autocalibration hello messages are
sent to the aggregator by the listeners, and the one on which the
autocalibration orders are sent by the aggregator to the listeners.
This will allow to run a listener and an aggregator on the same machine
with autocalibration enabled.
Both in the listener and the aggregator, the option -a (autocalibration
port) has been replaced by the options -O (autocalibration order port)
and -H (autocalibration hello port). In the listener, the option -H was
previously used to set the hello delay; this is now the role of the -T
option.
The autocalibration requests are now sent on the same port as the
positioning request, by default. There was no real reason to send them
on a different port.
From time to time, the length of the radiotap header (rtap_bytes in
read_packet()) is 65535. This is a quick & dirty fix to avoid segfaults,
but we should search for the reason why this value sometimes appears.
Modify the *time*() functions to avoid passing structures in arguments
(using const pointers instead) or returning structures (using result
arguments instead).
In the listener & aggregator, the signal strength is stored as an
unsigned byte. To display the actual (negative) value, one must
substract 256 (0x100) to the unsigned value.
This commit changes several things:
- Use the decimal (256) instead of the hexadecimal value (0x100).
- Don't substract 256 when copying the value to another unsigned byte
(aggregator).
- Be careful with the type length. In the positioning server, a SS
could be copied to a signed byte, while (theoretically) the negative
value can exceed the capacity of the signed byte. measurement.hh now
defines a type ss_t to store a signal strength value with the good
size (it is currently an int_fast16_t).
"start_time" was meaningless in the global data structures of owlps.h,
and could lead to errors in the aggregator, since it defines a field
start_time in one of its internal structures.
Add the compile-time option ENABLE_KEEP_MONITOR to enable/disable the
option -K. That allows to make optional the dependency on iwlib.
This option is disabled by default in the Makefiles.
The configuration parsing function could call exit() (e.g. with -h, -V,
or in case of error), implying a memory leak. This is fixed.
Additionally, minor cleaning in the configuration functions.