Commit Graph

209 Commits

Author SHA1 Message Date
Matteo Cypriani 2d447298d9 [Aggregator] Rewrite free_couple_list() 2011-03-16 14:52:56 +01:00
Matteo Cypriani 2c4b182aa7 [Aggregator] Delete 'couples' argument
The couple list 'couples' is a global variable, so it is useless to pass
it as an argument to the functions.
2011-03-16 14:52:56 +01:00
Matteo Cypriani 96fb99c951 [lib] Some translation & minor things 2011-03-16 14:52:56 +01:00
Matteo Cypriani ac6998d798 [Client] Rename packet variables 2011-03-16 14:52:55 +01:00
Matteo Cypriani dcdab12c27 [lib-client] Fix interface, rename variables
Parameter 'iface' of the function owlps_create_socket_to_aggregator()
can now be NULL.

Use variable name 'packet' instead of 'buf'.
2011-03-16 14:52:55 +01:00
Matteo Cypriani 2150dc1cde [Listener] Use lib-client to create output socket 2011-03-16 14:52:55 +01:00
Matteo Cypriani d6a75a10fc [Listener] Use global variables for the socket
+ Do not use sub-function got-packet() anymore in function capture():
read_packet() is called directly.
2011-03-16 14:52:20 +01:00
Matteo Cypriani 45258e9f4c [Client] Create libowlps-client from owlps-client
Move code related to sending requests into the new library
libowlps-client. This library will also be used by the listener to send
autocalibration requests.
Currently, it is statically linked because a dynamic linking should be
useless (because client and listener aren't normally on the same
machine).
2011-03-16 14:52:20 +01:00
Matteo Cypriani ec566286b4 [Client] Fix usage printing
Print default values for delay and number of packets.
2011-03-16 14:51:18 +01:00
Matteo Cypriani f8f6e51dd6 [Client] Refactor code 2011-03-16 14:51:18 +01:00
Matteo Cypriani 6ce8d695b0 [Client] Add -h option 2011-03-16 14:51:18 +01:00
Matteo Cypriani e992159810 [Client] Refactor argument parsing code 2011-03-16 14:51:18 +01:00
Matteo Cypriani 3e80537c73 [Client] Translation of comments, 72 col. 2011-03-16 14:51:18 +01:00
Matteo Cypriani a0be0f5bef [Listener] Refactor configuration code 2011-03-16 14:51:17 +01:00
Matteo Cypriani 7aa0b65f72 [Listener] Add -h option 2011-03-16 14:51:17 +01:00
Matteo Cypriani 5eb11af87f [Listener] Translation of comments, 72 col. 2011-03-16 14:51:17 +01:00
Matteo Cypriani 7f262a8573 [Aggregator] Handle confuse errors as in listener 2011-03-16 14:51:17 +01:00
Matteo Cypriani 4117e8dc14 [Aggregator] Add -h option 2011-03-16 14:51:17 +01:00
Matteo Cypriani 417452a7ad [Aggregator] Translation of comments, 72 col. 2011-03-16 14:51:17 +01:00
Matteo Cypriani 1863bd9e9f [Aggregator] Code refactoring (conf parsing, loop) 2011-03-16 14:51:17 +01:00
Matteo Cypriani a955467c83 [Aggregator] Revert DB-related code
Revert database-related code introduced in
  b7823a52 Reconstitution du dépôt, étape 5 (et dernière)
2011-03-16 14:51:17 +01:00
Matteo Cypriani 4473b0dd3a [lib] Fix makefiles: generate symlink libowlps.so
Symbolic link libowlps.so is required to dynamically compile, if
"-lowlps" is used instead of "../../libowlps/libowlps.so.1.0" (which is
now the case in the listener's makefiles, and will be soon for the
others too).
2011-03-16 14:51:17 +01:00
Matteo Cypriani 12cf7e7cda [Listener] Use compiler option -D
Fix Makefiles to use -D to activate the use of pthreads and libconfuse.
Comment out #defines in owlps-listener.h.

Fix lib order (needed for the static target).
2011-03-16 14:51:17 +01:00
Matteo Cypriani bd789cd4a1 [Listener] Fix compilation on Atheros
Makefile_atheros:
- Add target 'static' to compile fully statically. (Note: does not
  work in the OpenWRT 8.09 cross-compilation suite, since it does not
  provide libiw.a)
- Add target 'semistatic', that compiles with static libowlps and
  dynamic libiw and libpcap.

Fix (mostly) endianess issues:
- le32toh() is defined only in glibc >= 2.9, so owlps-listener did not
  compile with older glibc or other libc (such as uClibc that we use to
  cross-compile to OpenWRT).
  We now define le32toh() manually, if needed.
- Additionally, the PLATFORM_ATHEROS define is removed. We should now
  test the value of __BYTE_ORDER if needed.
2011-03-16 14:51:16 +01:00
Matteo Cypriani b35a0e1e7c [Listener] Endianess (finish) 2011-03-16 14:51:16 +01:00
Matteo Cypriani 257837962e Makefile Atheros (listener & libowlps)
Last (uncommited) changes in the SVN repo (2/2):
- Add/modify Makefile_atheros for libowlps and owlps-listener.
2011-03-16 14:51:16 +01:00
Matteo Cypriani f8ff9f6794 [Listener] Endianess (beginning)
Last (uncommited) changes in the SVN repo (1/2):
- Endianess in owlps-listener : use of le32toh().
         /!\ *Not* sure it works ! /!\
2011-03-16 14:50:41 +01:00
Matteo Cypriani 1fb6e39d27 [Positioning] Handle AP reading from a CSV file
Add class AccessPointsReaderCSV and make InputDataReader to use it.

Stock: Add function find_create_ap(const AccessPoint&).
2011-03-16 14:36:24 +01:00
Matteo Cypriani 29ce5a51af [Positioning] Stock: reorganise with Doxygen groups 2011-03-16 14:36:24 +01:00
Matteo Cypriani 6f0c0af5be [Positioning] PosUtil::wifi_channel_to_hz(): throw exception
posexcept: Add exception bad_channel.

PosUtil::wifi_channel_to_hz() now throw bad_channel if the argument is
not a valid channel nor a 802.11 frequency value in Hz.
2011-03-16 14:36:24 +01:00
Matteo Cypriani 338e4f7dcd [Positioning] Code cleaning around CSV data reading
CSVFileReader: Add function read_point3d().

Point3D: Add function set_coordinates(float[3]).

posexcept: Rename malformed_topology -> malformed_input_data.

TopologyReaderCSV:
- Use CSVFileReader::read_point3d() instead of the custom read_point().
- Rename occurrences of malformed_topology.
2011-03-16 14:36:24 +01:00
Matteo Cypriani 2347657d08 [Positioning] Clean config files
Delete access_points.cfg and accesspoints.cfg.
Delete owlps-positioning.conf, add owlps-positioning.cfg.
minips.cfg becomes minipc.csv.
2011-03-16 14:36:24 +01:00
Matteo Cypriani f3f59ff203 [Positioning] TextFileWriter: fix text writing
We wrote a C string instead of a string into the file stream, which
caused valgrind errors.
2011-03-16 14:36:24 +01:00
Matteo Cypriani cf42098cbd [Positioning] Correct some coding style issues
Get rid of some cppcheck warnings.
2011-03-16 14:36:24 +01:00
Matteo Cypriani b21b7bd25f [Positioning] Correct some Doxygen comments
Turn REFERENCES_RELATION to YES in Doxyfile.
2011-03-16 14:36:24 +01:00
Matteo Cypriani 1e605ae16d [Positioning] Stock: add some comments 2011-03-16 14:36:24 +01:00
Matteo Cypriani c731bf578f [Positioning] Add positioning algorithm Basic FRBHM
Add class FRBHMBasic, which derives FBCM and RADAR.

ReferencePoint: Add functions friis_index_for_ap() and
friis_indexes_for_ap() (that takes code away from
Stock::update_all_friis_indexes()).

CartographyAlgorithm and MultilaterationAlgorithm now extend
PositioningAlgorithm with "public virtual" instead of "public".

CartographyAlgorithm: select_point() must now return a ReferencePoint.

MultilaterationMethod: Add pure virtual function multilaterate_2d().

MinMax: Add function multilaterate_2d().

MultilaterationAlgorithm: Add function multilaterate_2d() to map
MultilaterationMethod::multilaterate_2d().

Makefile: Fix some dependencies.
2011-03-16 14:36:24 +01:00
Matteo Cypriani e12db08b0d [Positioning] Add positioning algorithm FBCM
Add class FBCM.

AccessPoint: Add attribute friis_index.

Measurement: Add function get_ss_list_size().

Stock: Add function update_all_friis_indexes().
2011-03-16 14:36:23 +01:00
Matteo Cypriani a05c61a3c1 [Positioning] Define PosUtil::LIGHT_SPEED
This constant will be used instead of a constant value "300000000", with
a more accurate value.
Make MultilaterationAlgorithm use it, and fix the unit test.
2011-03-16 14:36:23 +01:00
Matteo Cypriani 3dcf8bc88a [Positioning] MultilaterationAlgorithm::make_constant_term()
Move the constant term computation from
InterlinkNetworks::estimate_distance() into the new function
MultilaterationAlgorithm::make_constant_term(). This will avoid
duplicate this code into the future FBCM::estimate_distance().
2011-03-16 14:36:23 +01:00
Matteo Cypriani e9eab6876d [Positioning] Add RADAR positioning algorithm
Add classes RADAR and CartographyAlgorithm, which is the super-class of
SS map based algorithms.

Measurement: Add functions:
- add_ss_list(), to add several SS in one operation.
- merge(), to merge a Measurement into another.
- ss_square_distance() (from old commented code), to compute the
  distance to a SS value or another Measurement.

posexcept: Add exception cannot_merge, used by Measurement::merge().

ReferencePoint:
- Add ss_square_distance() and functions used by it:
  complete_with_dummy_measurements(), compute_ss_square_distance() and
  get_all_measurements_sorted(). Use of sorted values (map instead of
  unordered_map) is useless, should be fixed soon.
- Delete old commented code: getPowerForAp(), addMeasurement() and old
  getSsSquareDistance().

Stock: Add function closest_reference_point().
2011-03-16 14:36:23 +01:00
Matteo Cypriani d7973a3ef0 [Positioning] InputCSV: Fix CalibrationRequest handling
We now consider a Request as a CalibrationRequest if the Direction field
is valid. We do not take care of the position fields any more.
2011-03-16 14:36:23 +01:00
Matteo Cypriani 92bb12bfe3 [Positioning] CalibrationRequest & Result: operator==() const
CalibrationRequest::operator==() was not marked as const, which caused
trouble with unordered_set.
This commit corrects also CalibrationRequest::operator!=(),
Result::operator==() and Result::operator!=().
2011-03-16 14:36:23 +01:00
Matteo Cypriani 2c62e30ff9 [Positioning] Define hash_value() for several classes
For object types that we needed to store into an unordered_set, we used
string-based hashes, defined into stock.cc. We now define new hash
functions as friend of target classes, based on boost::hash_combine.

The following classes now have a hash_value() function:
- Request
- CalibrationRequest
- Direction
- Timestamp
- Point3D
- ReferencePoint
2011-03-16 14:36:23 +01:00
Matteo Cypriani aafc277704 [Positioning] Fix ReferencePoint::operator<<()
Fix printing of CalibrationRequest list (pointers were printed instead
of values).
2011-03-16 14:36:23 +01:00
Matteo Cypriani 630df51702 [Positioning] Del MultilaterationAlgorithm::mobile
Makefile: Use colorgcc.
Update TODO.
2011-03-16 14:36:23 +01:00
Matteo Cypriani 428639b814 [Positioning] InputDataReader: read waypoints 2011-03-16 14:36:23 +01:00
Matteo Cypriani f85c7113ab [Positioning] Delete several exception classes
Create exceptions bad_configuration and missing_configuration and delete
all configuration-specific exceptions.
2011-03-16 14:36:23 +01:00
Matteo Cypriani a9ac8616e8 [Positioning] MinMax: Fix start/stop and < vs. <= 2011-03-16 14:36:23 +01:00
Matteo Cypriani 814ff2b651 [Positioning] Positioning & UserInterface: add Interlink 2011-03-16 14:36:23 +01:00