Commit Graph

491 Commits

Author SHA1 Message Date
Matteo Cypriani 69a93abf0f [lib] Throw error for non-LE, non-BE architectures 2011-07-25 12:46:20 +02:00
Matteo Cypriani f7add0d8b7 [lib-client] Fix header comment 2011-07-25 12:46:20 +02:00
Matteo Cypriani e976d80d73 [Listener] Makefiles: split OWLPSFLAGS
Split OWLPSFLAGS into several lines, in order to ease the (un)activation
of options.
2011-07-25 12:46:20 +02:00
Matteo Cypriani 051ce9147c Use -D DEBUG / NDEBUG in Makefiles
Instead of #define DEBUG, we now prefer to use either verbose levels
or, when needed, NDEBUG. Each Makefile was modified to be able to pass
-D NDEBUG to the compiler (but the corresponding lines are commented),
except in the modules where assert is never used, in which case the
Makefile passes -D DEBUG.

Long story short: to totally disable debugging code, comment-out the
"-D DEBUG" lines and uncomment the "-D NDEBUG" lines, in every Makefile.
2011-07-25 12:46:20 +02:00
Matteo Cypriani f008db0e1c [Listener] Use perror() after recvfrom() 2011-07-25 12:46:20 +02:00
Matteo Cypriani f71a56bb9a [Listener] Use verbose levels 2011-07-25 12:46:20 +02:00
Matteo Cypriani a62387e465 [Listener] Switch verbose mode to verbose level 2011-07-25 12:46:19 +02:00
Matteo Cypriani 371752ab98 Delete writeInDb
I finally resigned myself to remove this old piece of code, which once
allowed one to create a database and import OwlPS CSV files into it.
But I must not bury my head in sand: OwlPS is not "ready for the
database" :-) (actually it is, but it would take some time I don't have
to implement correctly, and is currently of little interest).
2011-07-25 12:46:19 +02:00
Matteo Cypriani 032f4b8fa0 [Positioning] Doxyfile: change project's name
Change from "OWLPS Positioning" to "OwlPS Positioning".
2011-07-25 12:46:19 +02:00
Matteo Cypriani e705801bb1 [Client] Add option -f (flood mode) 2011-07-25 12:46:19 +02:00
Matteo Cypriani f951ce95f2 [Aggregator] Use perror() after recvfrom()
Use perror() instead of fprintf() after the recvfrom() calls.
Fix the test in listen_for_aps().
2011-07-25 12:46:19 +02:00
Matteo Cypriani 0f54bd36a3 [Aggregator] Add option -q (quiet mode) 2011-07-25 12:46:15 +02:00
Matteo Cypriani d6f337dbf2 [Aggregator] Use verbose levels
Get rid of #ifdef DEBUG.
2011-07-25 12:45:24 +02:00
Matteo Cypriani 6536805578 [Aggregator] Switch verbose mode to verbose level
The verbose option is now an integer value instead of a boolean, to
allow several levels of verbosity.
2011-07-23 21:37:02 +02:00
Matteo Cypriani 21a82b83d0 [lib] time_elapsed(): delete debug message 2011-07-23 21:26:49 +02:00
Matteo Cypriani 8377b00905 [Positioning] Makefile: add -O2 2011-07-23 17:27:51 +02:00
Matteo Cypriani fc13bc296c [Positioning] Fix ReferencePoint::operator<<() 2011-07-22 11:36:05 +02:00
Matteo Cypriani cf7bcecd10 [Positioning] Input: delete unused header
The function add_request_to_stock() was declared in input.hh, but not
defined anywhere.
2011-07-22 11:11:26 +02:00
Matteo Cypriani 44bf79f9c4 [Listener] Makefile backfire: use -lconfuse
The Confuse library works on OpenWrt, so why don't link it?
2011-07-19 11:55:52 +02:00
Matteo Cypriani c7e0280596 Fix Makefiles for OpenWrt 10.03 2011-07-18 23:34:06 +02:00
Matteo Cypriani 25c3f53983 [Point3D] Fix Doxygen warning with operator string 2011-07-18 13:38:29 +02:00
Matteo Cypriani 2597295f08 [Client] Better optarg test for -l 2011-07-01 14:29:47 +02:00
Matteo Cypriani c63da8bdfc [Positioning] InputDataReader: print nb requests
In verbose mode, display the number of calibration requests stored.
2011-06-29 10:56:08 +02:00
Matteo Cypriani 02da7c7851 [Listener] Define le*toh() for OpenBSD
OpenBSD's endian.h uses the names letoh* instead of le*toh.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 306e855ad1 [Listener] Test the platform for endian.h
The <endian.h> header is Glibc-specific. On BSD platforms, one have to
use <sys/endian.h>.
(This was the occasion to improve the preprocessor code here.)
2011-06-27 10:09:14 +02:00
Matteo Cypriani 5f72702b88 [Listener] Use ETHERTYPE_IP instead of ETH_P_IP
ETH_P_IP is Linux-specific.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 3ac53e7b76 [Listener] Fix compilation without USE_PTHREAD 2011-06-27 10:09:14 +02:00
Matteo Cypriani 35e787064b [lib] mac_bytes_to_string_r(): use snprintf()
Use snprintf() instead of sprintf() in mac_bytes_to_string_r(). This is
really useless, but I want to satisfy the snprintf BSD zealots and get
rid of the warning GCC gives me on OpenBSD.
2011-06-27 10:09:14 +02:00
Matteo Cypriani b3cfa2ea08 [lib-client] Disable use_iface() if glibc not used
setsockopt(... SO_BINDTODEVICE ...) does not work on OpenBSD. The only
way to force an interface seems to specify its IP address and to use
setsockopt(... IPPROTO_IP, IP_MULTICAST_IF ...). See the code of ping
(-I option).

libowlps-client now builds on OpenBSD!
2011-06-27 10:09:14 +02:00
Matteo Cypriani 95b9ea30bf [lib] Fix #includes for OpenBSD
libowlps now builds on OpenBSD (4.9)!
2011-06-27 10:09:14 +02:00
Matteo Cypriani 65487af736 [lib] Makefile: remove unneeded -lrt & -lm
-lrt is now added as needed in each module Makefile, but not directly in
the library. Furthermore, the Makefiles add -lrt only if the platform is
Linux.
2011-06-27 10:09:14 +02:00
Matteo Cypriani fdf683796a [lib] Remove channel setting functions
Remove the unused functions owl_iface_set_channel() and
owl_iface_channel_hop().
This allows to get rid of the dependency on iwlib.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 00d89efd40 [lib] Move owl_iface_mode_monitor() in Listener
Only owlps-listener uses owl_iface_mode_monitor(), so we don't need to
keep it in libowlps.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 7dade1c36b Makefiles: get rid of echo -e
Use one call to echo for each line, because the echo's -e option is not
standard.
2011-06-27 10:09:14 +02:00
Matteo Cypriani f54b0d11e1 Makefiles: remove -v incompatible with BSD commands
The -v 'verbose' switch of the standard commands (rm, cp, mkdir, etc.)
is not implemented in BSD versions of the commands, so we avoid using
it.
2011-06-27 10:09:14 +02:00
Matteo Cypriani 84ea723528 [Positioning] Direction: 0 is valid to construct
Accept 0 as a "valid" value for the constructor and operator=()
(constructing a Direction with 0 value was possible any way, using the
default constructor).
This fixes the reception of requests on UDP.
2011-06-24 16:48:55 +02:00
Matteo Cypriani 2ebb8c49bc [Positioning] *.hh: fix typos in comments 2011-06-20 12:11:20 +02:00
Matteo Cypriani 3b8121643b [Positioning] InputCSV: --verbose instead of #ifdef
Test if the verbose mode is activated instead of using #ifdef DEBUG.
2011-06-16 14:21:12 +02:00
Matteo Cypriani 67ccf674a5 [Positioning] InputDataReader: print --verbose info
Display the number of elements read when the verbose mode is activated.
2011-06-16 14:10:43 +02:00
Matteo Cypriani abd4b0803e [Positioning] UserInterface: add --verbose option
Currently, --verbose / -v is only a switch. It would probably be better
to have a verbose level instead.
2011-06-16 13:46:21 +02:00
Matteo Cypriani 332881b305 [Positioning] Standardise InputCSV & InputUDPSocket 2011-06-16 13:13:13 +02:00
Matteo Cypriani 5364944c68 Add missing Makefiles for OpenWrt 10.03 (Backfire)
* libowlps, libowlps-client & owlps-listener:
Add Makefiles to compile for OpenWrt 10.03 (Backfire). (owlps-client had
one already.)

* libowlps & libowlps-client:
Update the Makefiles for OpenWrt 8.09 (Kamikaze).
2011-06-15 10:36:47 +02:00
Matteo Cypriani cce949f32a [Positioning] Fix some Doxygen comments 2011-06-14 16:44:17 +02:00
Matteo Cypriani 3d46d64a19 [Aggregator] free_request_list(): semaphore unneeded
free_request_list() is called by main() after threads' shutdown, so we
do not need to use a semaphore.
2011-06-10 17:20:37 +02:00
Matteo Cypriani 533936c4ee [Aggregator] Use semaphores to lock APs' ring
The APs' ring is accessed concurrently by listen_for_aps() and
monitor_aps(), so we had to secure that.
2011-06-09 18:53:11 +02:00
Matteo Cypriani d2559062e6 [Aggregator] Use semaphores to lock requests' list
The requests' list might be accessed by the main thread and the monitor
thread simultaneously, so we need to secure the concurrent accesses.
2011-06-09 17:36:00 +02:00
Matteo Cypriani 48fa965c54 [Positioning] UserInterface: reformat strings 2011-06-08 19:05:48 +02:00
Matteo Cypriani 3ac6b440e4 Update TODOs 2011-06-08 10:56:14 +02:00
Matteo Cypriani 507072bd24 [Positioning] Option radar-average-reference-points
For RADAR, the default is now to compare the current positioning request
to each stored CalibrationRequest instead of each ReferencePoint
(averaging the calibration requests associated with the reference
point).

The new option --positioning.radar-average-reference-points allows to
activate the old behaviour (compare to reference points).

Note: the bug fixed in the previous commit caused the creation of
a ReferencePoint for each CalibrationRequest, implying the 'new'
default behaviour (one ReferencePoint was associated to only one
CalibrationRequest, so comparing each ReferencePoint or each
CalibrationRequest was giving the same result). Anyway, there was
(hopefully) no such bug in OwlPS v0.8, so it is actually the old
behaviour :-)
2011-06-08 10:25:38 +02:00
Matteo Cypriani d322221d21 [Positioning] Stock: fix ReferencePoint creation
For each calibration request read, a new ReferencePoint was created in
Stock. This is because of the behaviour of unordered_set: as pertaining
to unordered_set, two elements are not considered equal if the hashes
alone are identical, they must also be actually equal (operator==).

The problem was fixed by using a custom equality check function that
checks the equality only on the coordinates of the ReferencePoint (as if
it was a Point3D).
2011-06-07 18:48:33 +02:00