Commit Graph

621 Commits

Author SHA1 Message Date
Matteo Cypriani 7432716a3c [UDP-HTTP] Fix memory leak in free_result_list() 2011-08-26 10:25:40 +02:00
Matteo Cypriani a3c16211c2 Use owl_msleep() everywhere 2011-08-24 15:41:17 +02:00
Matteo Cypriani 98609d146d [lib] Add owl_msleep()
On *BSD, usleep() does not accept an argument greater than 1'000'000 (1
second). owl_msleep() decomposes its arguments to use sleep() and
usleep() calls.
2011-08-24 15:40:34 +02:00
Matteo Cypriani 40bc6d0b59 [Listener] Fix reception timestamp
struct pcap_pkthdr.ts is host-endian, not net-endian, so we have to
convert it to net-endianess when reading it from the packet.
2011-08-24 14:05:16 +02:00
Matteo Cypriani 8bec37c4ad [Client] Improve the request loop
In flood mode, avoid sending a last request when the program is stopped.
2011-08-24 13:39:01 +02:00
Matteo Cypriani d2f0ad78e5 Makefile: allow to define the make command
In the global Makefile, allow to redefine the 'make' command with the
variable MAKE.
This is useful on *BSD: gmake MAKE=gmake
2011-08-24 13:39:01 +02:00
Matteo Cypriani b57bf543c7 [Positioning] Fix config parsing memory leaks
Do not use exit() from
UserInterface::print_information_and_exit_if_requested(), set owl_run to
false instead. This function is renamed print_information().
2011-08-24 13:39:01 +02:00
Matteo Cypriani 1a98cf44b2 [Aggregator] Fix config parsing memory leaks
Same thing as for the Listener: avoid using exit(), prefer return an int
value instead.
2011-08-24 13:39:01 +02:00
Matteo Cypriani 8f48a22482 [Listener] Fix config parsing memory leaks
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.
2011-08-24 13:39:01 +02:00
Matteo Cypriani a301c87c1d [Positioning] Fix segfault when ignoring AP RP
This commit fixes a segfault that occurred in certain circumstances with
the option positioning.radar-ignore-ap-reference-points activated. The
bug was introduced with this option in 0da98cdb.
2011-08-23 19:58:49 +02:00
Matteo Cypriani ff17c92bfa [lib-client] Change the prefix for "owl_"
Use the prefix "owl_" instead of "owlclient_".
2011-08-23 19:58:49 +02:00
Matteo Cypriani 32d8a04ad5 [lib-result] Rename to libowlps-resultreader
After all, this is not really UDP-specific.
2011-08-23 19:58:49 +02:00
Matteo Cypriani 3a38d2bc1e [UDP-HTTP] Improve free_results_list() 2011-08-23 19:58:49 +02:00
Matteo Cypriani 46e295dc09 [UDP-HTTP] Init. TCP socket in a separate function
Initialise the TCP socket in the new function. This is to avoid exit()
in the thread (memory leak).
2011-08-23 19:58:49 +02:00
Matteo Cypriani a7bfa7eb07 [UDP-HTTP] Display a message if called with args
This is mainly to avoid a "unused variable" message when compiling.
2011-08-23 19:58:49 +02:00
Matteo Cypriani 8cc05d718c [lib-result] Do not perror() if owl_run is false
owl_receive_position() do not print the error message when owl_run is
false. This is to avoid an error message when a program is stopped.
2011-08-23 19:58:49 +02:00
Matteo Cypriani 632858155a [UDP-HTTP] Cancel the TCP thread
Cancel the TCP thread before to join it, because of the blocking recv()
call.
2011-08-23 19:58:49 +02:00
Matteo Cypriani adc05b98c0 [UDP-HTTP] Handle new request "ReadResults" 2011-08-23 19:58:49 +02:00
Matteo Cypriani 73494defe6 [lib-result] Add the number of algorithms
Add the field nb_results to owl_result, and change the functions to
handle it.
2011-08-23 19:58:49 +02:00
Matteo Cypriani c2aaa3af15 [UDP-HTTP] Big refactoring
Create owlps-udp-to-http.h, rename variables, refactor functions, etc.
2011-08-23 19:58:49 +02:00
Matteo Cypriani 177bd6284c [lib-result] #define "simple CSV" string sizes
owlps.h: #define the coordinate string size.
2011-08-23 19:58:49 +02:00
Matteo Cypriani ee02f26d8a [UDP-HTTP] Change and fix SimpleResults format
Use owl_result_to_csv_simple() from libowlps-result.
2011-08-23 19:58:49 +02:00
Matteo Cypriani 6160eb9c98 [UDP-HTTP] Makefile: fix static
Add missing -pthread.
2011-08-23 19:58:49 +02:00
Matteo Cypriani 3626a21f99 [lib-result] Add simplified CSV format functions
Add functions owl_result_to_csv_simple() and
owl_algorithm_result_to_csv_simple(), that convert an owl_result and an
owl_algorithm_result to a CSV string, in a simplified format.
2011-08-23 19:58:49 +02:00
Matteo Cypriani e77ad8fb0f Add owlps-udp-to-http
This new module allows to get the results sent by the positioning
server with HTTP queries.
See the heading comment in owlps-udp-to-http.c.
2011-08-23 19:58:49 +02:00
Matteo Cypriani 442c5a4601 [lib] .h all is prefixed with OWL_ or owl_
All the types, defines, etc. are now prefixed with "OWL_" or "owl_".
TRUE and FALSE become owl_true and owl_false.
2011-08-22 22:43:35 +02:00
Matteo Cypriani 1d6016a3ce [lib] Move listener code to owlps-listener.h (bis)
Move the last piece of listener-specific code from owlps.h to
owlps-listener.h.
2011-08-22 22:43:35 +02:00
Matteo Cypriani d566187f42 [Client] Fix "blinking" coordinates in flood mode
In calibration flood mode, the coordinates were "blinking" (correct
values, then 0, etc.). This is now fixed.
2011-08-22 22:43:35 +02:00
Matteo Cypriani b68cb179a9 [Client] Handle signals 2011-08-22 22:43:35 +02:00
Matteo Cypriani 8327357290 Makefiles: allow to enable -g easily
Add a commented line DEBUG=-g in each Makefile.
2011-08-22 22:43:35 +02:00
Matteo Cypriani 462298d6e8 [Listener] Set the signal flags to 0 2011-08-20 20:00:39 +02:00
Matteo Cypriani 626242b5e2 [lib-result] example: handle signals
Handle signals in the sample program owlps-resultreader-udp.
2011-08-20 20:00:39 +02:00
Matteo Cypriani 6fa903b143 [lib-result] Add owl_fill_algorithm_result()
Create owl_fill_algorithm_result() from owl_fill_result().
2011-08-20 20:00:39 +02:00
Matteo Cypriani a7ec779231 [lib-result] owl_receive_position(): return a pointer
Return a pointer instead of using a result argument.
2011-08-20 20:00:39 +02:00
Matteo Cypriani 8da063b597 [lib-result] Add {algorithm,}result_to_csv()
Add owl_result_to_csv() and owl_algorithm_result_to_csv(), that
allow to get an owl_result or owl_algorithm_result as a CSV string.
2011-08-20 20:00:39 +02:00
Matteo Cypriani 44055929b1 [lib-result] Update OWL_CSV_RESULT_STRLEN
Add OWL_CSV_RESULT_REQUEST_STRLEN & OWL_CSV_ALGORITHM_RESULT_STRLEN.
2011-08-20 20:00:39 +02:00
Matteo Cypriani c7ba92cef9 [lib-result] fprint_*(): const pointers & asserts
owl_fprint_*():
- Mark pointer arguments as const.
- Rename main argument "src".
- Use assertion to check the source.
2011-08-20 20:00:39 +02:00
Matteo Cypriani 084daed33f Add libowlps-resultreader-udp
This new library is to help external programs to receive and interpret
results sent by OwlPS Positioning through an UDP socket.
2011-08-20 20:00:39 +02:00
Matteo Cypriani c61c4b3a22 [Positioning] UDP & TCPEvAAL: send '\0'
Send the final null character of the CSV string.
2011-08-18 21:36:42 +02:00
Matteo Cypriani de74213102 [lib] Rename OWL_TIMESTAMP_STR_LEN OWL_TIMESTAMP_STRLEN 2011-08-18 14:02:17 +02:00
Matteo Cypriani ac4dd87ef9 Use ++var instead of var++ whenever possible 2011-08-18 11:45:36 +02:00
Matteo Cypriani 3f328e0e69 [Positioning] CSV format: remove "Error" string
Result::to_csv() do not give a fixed "Error" string field before the
error value field any more.

Update comments to better document the CSV format.
2011-08-18 11:36:50 +02:00
Matteo Cypriani ab8ad83e52 Add emacs mode command to each Makefile_atheros* 2011-08-18 11:05:45 +02:00
Matteo Cypriani fb9d093d5a [Listener] Add extract_radiotap_data()
Another refactoring step for read_packet().
2011-08-04 00:35:32 +02:00
Matteo Cypriani 4bae0c9b4e [Listener] Add extract_calibration_data()
A first step in the long way of read_packet() refactoring.
2011-08-04 00:25:08 +02:00
Matteo Cypriani ac3c7b4352 [lib] Move listener code to owlps-listener.h
Move listener-specific code (Radiotap fields' definition, etc.) from
owlps.h to owlps-listener.h.
2011-08-03 23:13:16 +02:00
Matteo Cypriani 2c887899b3 [Positioning] Fix FBCM with autocalibration
Regenerate Friis indexes at each call of the algorithm when
autocalibration is used (without this fix, FBCM given always the same
result autocalibration activated, because of the Friis indexes equal to
zero).
2011-08-01 20:41:14 +02:00
Matteo Cypriani 6167f664e8 [Positioning] Use AccessPoint::friis_constant_term()
Use AccessPoint::friis_constant_term() wherever possible.
Fix MultilaterationAlgorithm::make_constant_term() and
ReferencePoint::friis_indexes_for_ap(), where the AP's trx
power was used instead of the mobile's power.
2011-08-01 19:57:40 +02:00
Matteo Cypriani dde917485a [Positioning] Add AccessPoint::friis_constant_term() 2011-08-01 19:53:54 +02:00
Matteo Cypriani d9adbc3f88 [Positioning] Fix InputMedium::fill_calibration_request_data()
The first test was logically wrong.
2011-08-01 18:24:39 +02:00