Commit Graph

142 Commits

Author SHA1 Message Date
Matteo Cypriani 61124e4cfc Makefiles: test CC prior to surcharge it
Verifies that CC is at its default value prior to try to surcharge it
with colorgcc.
2012-01-09 11:11:30 +01:00
Matteo Cypriani 39300aaa85 Makefiles: translate help
Translate help messages from French.
2012-01-09 11:11:30 +01:00
Matteo Cypriani a70fc783e2 Makefiles: translate comments
Translate all the comments from French.
2012-01-09 11:11:30 +01:00
Matteo Cypriani 31bea165c5 [lib] create*socket(): return standard error code 2011-08-26 11:29:44 +02:00
Matteo Cypriani 3fec57b1ae Move all error #defines in owlps.h 2011-08-26 11:09:41 +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 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 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 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 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 de74213102 [lib] Rename OWL_TIMESTAMP_STR_LEN OWL_TIMESTAMP_STRLEN 2011-08-18 14:02:17 +02:00
Matteo Cypriani ab8ad83e52 Add emacs mode command to each Makefile_atheros* 2011-08-18 11:05:45 +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 3c00c3bb19 [lib] Add request type "generated"
This new type of request will only be used in owlps-positioning, to
distinct the calibration requests that are issued from a real
measurement and those that are generated by the self-calibration
process.
2011-07-29 23:02:25 +02:00
Matteo Cypriani a174a01e0f Rename Atheros Makefiles: specify OpenWrt version
*/Makefile_atheros become */Makefile_atheros_openwrt-8.09.
2011-07-25 13:13:21 +02:00
Matteo Cypriani 69a93abf0f [lib] Throw error for non-LE, non-BE architectures 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 21a82b83d0 [lib] time_elapsed(): delete debug message 2011-07-23 21:26:49 +02:00
Matteo Cypriani c7e0280596 Fix Makefiles for OpenWrt 10.03 2011-07-18 23:34:06 +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 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 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 8c58ae804f [lib] Add Hz Wi-Fi frequencies
Add Wi-Fi channel frequencies in Hz.
Rename frequencies OWL_80211_<unit>_CHANNEL_<number>.
2011-05-13 10:51:52 +02:00
Matteo Cypriani 2ce238984c [lib] Add float endianess converters 2011-04-07 16:14:55 +02:00
Matteo Cypriani 921afff682 [lib] .c: categorise functions
+ eliminate last French words.
2011-04-07 16:14:45 +02:00
Matteo Cypriani c802ad1224 [lib] Use const arguments wherever possible 2011-04-05 15:42:16 +02:00
Matteo Cypriani 6823cd4028 [lib] Add position in owl_request 2011-03-31 16:03:22 +02:00
Matteo Cypriani df5ed19834 Include headers as needed
Move #includes from .h to .c wherever possible.
2011-03-31 16:03:22 +02:00
Matteo Cypriani d62a7500b1 [lib] Rename run -> owl_run 2011-03-31 16:03:22 +02:00
Matteo Cypriani 1a5117d46b [Positioning] Minimal handling of request type
Handle the new CSV & UDP formats that include the request type.
2011-03-31 16:03:22 +02:00
Matteo Cypriani 4f74524f05 Handle request type in Listener & Aggregator
The listener now sends the request type to the aggregator. The
aggregator writes it to the CSV file and transmit it to the positioning
server.
2011-03-25 17:20:18 +01:00
Matteo Cypriani 204750b8c5 [lib] Rename PACKET_TYPE_* -> OWL_REQUEST_* 2011-03-25 16:30:40 +01:00
Matteo Cypriani 7c6d09d859 [Client] Check the direction 2011-03-25 11:48:25 +01:00
Matteo Cypriani 67a271596c [lib] Add timestamp_equals()
owl_timestamp_equals() allows to compare two owl_timestamp more
accurately and efficiently than "owl_time_elapsed_ms() == 0".
2011-03-25 11:48:25 +01:00
Matteo Cypriani 4720399513 [lib] mac_bytes_to_string(): do not malloc anymore
owl_mac_bytes_to_string() now uses a static buffer, so the caller do not
need to free the returned buffer manually. Because of this static
buffer, it is not thread-safe anymore, therefore we introduce
owl_mac_bytes_to_string_r() that is a thread-safe version.
2011-03-25 11:48:25 +01:00
Matteo Cypriani e8aa0838f4 Use ETHER_ADDR_LEN instead of 6 2011-03-25 11:48:25 +01:00
Matteo Cypriani 7fa5819544 [lib] Add timestamp_is_null() 2011-03-25 11:48:25 +01:00
Matteo Cypriani d193b49c9c [lib] Make the variable run extern 2011-03-25 11:48:24 +01:00
Matteo Cypriani 2289e0ef9f [lib] Add close_fd() & close_file()
These functions are aimed to be used with pthread_cleanup_push().
2011-03-25 11:48:24 +01:00
Matteo Cypriani c87c2e2e93 [lib] Write messages to stderr instead of stdout 2011-03-25 11:48:24 +01:00
Matteo Cypriani 6c4af9020f close(fd) instead of (void) close(fd) 2011-03-25 11:48:24 +01:00
Matteo Cypriani 91cba33dcd [lib] Rename types
- Lowercase all defined types.
- Prefix with "owl_".
- Rename couple_message -> owl_captured_request.
- Rename couple_info -> owl_request_info.
2011-03-25 11:48:22 +01:00
Matteo Cypriani a72a76d5a9 mv /infrastructure-centred/* /
Get rid of the infrastructure-centred directory: all the modules are now
at the same level.
2011-03-25 11:48:22 +01:00
Matteo Cypriani f832335f12 [lib] Allow linking to C++ code 2011-03-18 15:27:24 +01:00
Matteo Cypriani 3782ca9012 Track endianess issues
Add some comments, add/remove some endianess conversions. That should be
OK now.

Noticeable changes in owlps.h:
- Type DIRECTION is now an alias for uint8_t instead of an enum.
- Type autocalibration_order now contains an uint8_t instead of an enum.
2011-03-18 15:24:31 +01:00
Matteo Cypriani 33f863e2e1 [lib] Refactor time_elapsed()
owl_time_elapsed() now returns a TIMESTAMP. The new function
owl_time_elapsed_ms() returns a value in milliseconds (old behaviour).
2011-03-16 16:46:10 +01:00
Matteo Cypriani 788a61a712 [lib] Add timestamp_to_string() 2011-03-16 16:46:09 +01:00
Matteo Cypriani d0b15bf978 [lib] Do not round to ms precision anymore
Delete owl_timestamp_round_to_ms(), we now keep nanosecond precision.
2011-03-16 16:46:09 +01:00
Matteo Cypriani 3815ccae8b [lib] Fix timestamp_to_ms()
owl_timestamp_to_ms() did not convert properly the result to uint64_t.
This is now fixed, but time functions are still buggy, as we do not take
into account the length of tv_sec (owl_timestamp_round_to_ms() assumes
that it is 9-digit long).
2011-03-16 16:46:09 +01:00
Matteo Cypriani f60287bf49 [lib] Change TIMESTAMP type
TIMESTAMP is not a simple alias for struct timespec. It is now a clone
of struct timespec that uses fields of a fixed size (uint32_t).
2011-03-16 16:46:09 +01:00
Matteo Cypriani 94e3701a51 [lib] Add TIMESTAMP endianess converters
Add the functions owl_hton_timestamp() and  owl_ntoh_timestamp().
2011-03-16 16:45:38 +01:00
Matteo Cypriani b88f26e503 [lib] Rename create_udp_sending_socket()
Rename owl_create_udp_sending_socket() -> owl_create_udp_trx_socket().
2011-03-16 16:45:37 +01:00
Matteo Cypriani 940c5f74df [lib] Prefix all functions with owl_ 2011-03-16 16:45:37 +01:00
Matteo Cypriani 2771f8573b [lib] timestamp_now_ns(): return int (not BOOL) 2011-03-16 16:45:37 +01:00
Matteo Cypriani 8123ee3096 Switch to stdint types where possible
The use of integer types from inttypes.h & stdint.h should help with
portability issues. It will also force the data transmission between
different architectures to work as intended (if we handle endianess
conversions correctly!).
2011-03-16 16:45:37 +01:00
Matteo Cypriani abb1d170cf [lib] Use memset() instead of bzero() 2011-03-16 16:45:36 +01:00
Matteo Cypriani f8e7d9adef [lib] Use clock_gettime() instead of gettimeofday()
Abandon the old struct timeval and gettimeofday(). We now use the new
struct timespec and clock_gettime().
struct timespec has a nanosecond resolution, but we lower the resolution
to keep only milliseconds. The code is inspired from the Timestamp class
of the owlps-positioning.
2011-03-16 16:45:36 +01:00
Matteo Cypriani db8f6dff22 [lib] Add timestamp_now()
Use the new function timestamp_now() everywhere instead of
gettimeofday().
2011-03-16 16:44:32 +01:00
Matteo Cypriani ff81d43cb1 [lib] Introduce type TIMESTAMP
The type TIMESTAMP is a wrapper to the currently-used time structure (we
currently use struct timeval).

The function timeval_to_ms() is now timestamp_to_ms().
2011-03-16 16:44:32 +01:00
Matteo Cypriani 10a47246f4 [lib] Rename sub_date() -> time_elapsed() 2011-03-16 16:44:32 +01:00
Matteo Cypriani 829982766d [lib] Rename mac_cmp() -> mac_equals() 2011-03-16 16:44:32 +01:00
Matteo Cypriani af1c04529d [lib] sigint_handler(): use #ifdef DEBUG 2011-03-16 16:44:32 +01:00
Matteo Cypriani 3d0300cc60 [lib] Translate comments, 72 col. 2011-03-16 16:44:32 +01:00
Matteo Cypriani 0676462082 Makefiles: use colorgcc (only) if it exists
owlps-positioning/Makefile used to use colorgcc as the default compiler,
without testing its existence. This is fixed.
The makefiles for libowlps and infrastructure-centred modules now use
colorgcc when available.
2011-03-16 16:44:32 +01:00
Matteo Cypriani 22ee24655a [i-c] Remove ap_ip_addr from autocalibration_hello
The listener does not send its IP address explicitly in the Hello
message anymore. Instead, the aggregator now extract the source address
of the Hello packet.
2011-03-16 16:44:23 +01:00
Matteo Cypriani 719514eab6 [lib] Get rid of the last indent tabs 2011-03-16 16:44:22 +01:00
Matteo Cypriani 3979788c77 [Listener] Change autocalibration requests port
Autocalibration positioning requests were previously (and stupidly) sent
on the aggregation port. We can now chose the port for autocalibration
requests.
2011-03-16 16:44:22 +01:00
Matteo Cypriani 57f1331273 [Listener] Fix reading of QoS Data frames
The IEEE 802.11 header size is 2 bytes bigger when a Data frame has QoS
information.
2011-03-16 16:44:08 +01:00
Matteo Cypriani 87e364a633 [Listener] Accept all data frames
The listener dropped all non-bare Data frames. It now accepts Data
subtypes as well (QoS Data, etc.).
2011-03-16 14:52:58 +01:00
Matteo Cypriani 8fdfd6819e Use -Wextra instead of -W in all Makefiles
This changes nothing except readability.

Fix default build options in Makefile_atheros for Listener.
2011-03-16 14:52:58 +01:00
Matteo Cypriani 6cbbcc957b [Listener] Update configuration display
Configuration display when not using libconfuse was outdated.
2011-03-16 14:52:57 +01:00
Matteo Cypriani f804855309 [Aggregator] Send order to APs
Add options -C and -K.

Rename default autocalibration values in aggregator and listener.
2011-03-16 14:52:56 +01:00
Matteo Cypriani eff2455897 [Listener] Send IP in Hello messages 2011-03-16 14:52:56 +01:00
Matteo Cypriani d51f136d70 [Listener] Send & receive autocalibration requests 2011-03-16 14:52:56 +01:00
Matteo Cypriani 729c20c8ff [Aggregator] Receive hello messages from listener 2011-03-16 14:52:56 +01:00
Matteo Cypriani c583e0bb54 [Listener] Prepare autocalibration
Send hello messages to the aggregator.
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 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 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 5f8f955a3d [Positioning] Add Request, complete InputCSV
== code/owlps-positioning ==

- Add new class Request (split of Measurement).
- Update Measurement and CalibrationMeasurement (suppress the 'mobile'
  attribute).
- Update InputCSV (and InputMedium) to use Request instead of
  Measurement. Complete the file reading (mobile & ap pointers remain to
  be implemented).
- PosUtil: Add timespec_to_ms(), timespec_to_ns(), ms_to_timespec(), and
  ns_to_timespec().
- Makefile: Update to use stlport, fix all deps and add new classes.
- Minor fixes.
- TODO: Add UML-related things, updates Measurement & Request.

== code ==

- libowlps: Add ms_to_timeval() (commented), may be useful later.
- Add TODO.
2011-03-16 14:35:56 +01:00
Matteo Cypriani 3b6eb55e38 Nettoyage du code de listener et libowlps
listener + libowlps : nettoyage, amélioration de la qualité du code,
tests sur le type du paquet capturé.

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@108 785a6c6c-259e-4ff1-8b91-dc31627914f0
2011-03-16 14:07:23 +01:00
Matteo Cypriani bb51f59328 [i-c] Ajouts dans les options et fichier de config
aggregator :
* Ajout de l'option getopt manquante pour le port d'envoi.
* Modification des noms des options getopt (options DB en majuscule).
* Correction et harmonisation des noms des options libconfuse et des
  #define correspondants.
* Correction et complément de l'aide.

listener :
* Ajout d'une option pour le port d'écoute (-l / listening_port).
* Passage des listes d'options en global (nécessaire pour le port
  d'écoute).
* Passage de int à long pour le type du port d'agrégation.

Fichier code/infrastructure-centred/TODO :
* Mise à jour et déplacement des lignes pertinentes dans des TODO
  spécialisés (créés pour l'occasion).

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@99 785a6c6c-259e-4ff1-8b91-dc31627914f0
2011-03-16 14:07:22 +01:00
Julien Graeffly f1e1122091 Reconstitution du dépôt, étape 5 (et dernière)
Le commentaire de révision initial figure ci-dessous. Les différences
par rapport à ce commit sont :
- Dans code/infrastructure-centred/owlps-client/ : importation des
  modifs de Julien dans la dernière version du client (Julien avait
  utilisé comme base une ancienne version).
- Dans code/infrastructure-centred/owlps-listener/ : idem.
- Dans code/owlps-positioning/ :
    ° Suppression de client (déplacé dans les archives).
    ° Makefile : ajout d'une pseudo-cible .PHONY.
- code/writeInDb/ :
    ° Le binaire n'est pas versionné.
    ° Application de astyle --style=gnu.

| r93 | jgraeffly | 2009-05-27 14:51:40 +0200 (mer 27 mai 2009) | 23 lines
| Chemins modifiés :
|    R /code/infrastructure-centred/owlps-aggregator/owlps-aggregator.h
|    R /code/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c
|    R /code/infrastructure-centred/owlps-client/owlps-client.c
|    R /code/infrastructure-centred/owlps-listener/owlps-listener.h
|    R /code/infrastructure-centred/owlps-listener/owlps-listenerd.c
|    R /code/libowlps/owlps.h
|    R /code/owlps-positioning/Makefile
|    D /code/owlps-positioning/client
|    A /code/owlps-positioning/libowlps-positioning.cc
|    A /code/owlps-positioning/libowlps-positioning.hh
|    R /code/owlps-positioning/owlps-positioning.cc
|    A /code/owlps-positioning/owlps-positioning.cfg
|    R /code/owlps-positioning/owlps-positioning.hh
|    R /code/owlps-positioning/positioning.cc
|    R /code/owlps-positioning/positioning.hh
|    R /code/owlps-positioning/server.cc
|    R /code/owlps-positioning/server.hh
|    R /code/owlps-positioning/treatment.cc
|    R /code/owlps-positioning/treatment.hh
|    A /code/writeInDb
|    A /code/writeInDb/writeindb
|    A /code/writeInDb/writeindb.cc
|    A /code/writeInDb/writeindb.hh
|
| - Mise à jour du positioner :
|         Prise en charge de la BdD pour utilisation ainsi que pour la
|           sauvegarde des résultats
|         Envoi du résultat au client
|         Prise en compte du fichier de configuration ainsi que des
|           lignes de commande avec la library boost
|
| - Mise à jour de l'aggregator :
|         Pris en compte de la BdD pour la sauvegarde des requetes de
|           calibration ou de localisation
|         Envoi des demandes de localisation uniquement vers le
|           positioner
|         Ajout des options utilisables en ligne de commande et dans le
|           fichier de conf
|
| - Mise à jour du listener :
|         Ajout de l'envoi de l'adresse IP du mobile
|
| - Mise à jour du mobile :
|         Ajout de la socket de récupération de la réponse du serveur la
|           réponse est sous forme de 3 float (x, y, z) et non d'un Point.
|
| - Mise à jour de owlps.h :
|         Ajout des ports par défaut du positioner ainsi que du mobile.
|
| - Ajout de writeInDb :
|         Programme permettant de mettre les données contenu dans un
|           fichier dans la BdD

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@94 785a6c6c-259e-4ff1-8b91-dc31627914f0
2011-03-16 14:07:22 +01:00
Matteo Cypriani 7800038be0 Cosmétique
code : quelques corrections de forme.

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@79 785a6c6c-259e-4ff1-8b91-dc31627914f0
2011-03-16 13:52:46 +01:00
Matteo Cypriani 259ac54f32 Corrections mineures et commentaires
git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@77 785a6c6c-259e-4ff1-8b91-dc31627914f0
2011-03-16 13:52:46 +01:00
Matteo Cypriani 2c30b04a49 Migration vers le nouveau nom OWLPS
git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@71 785a6c6c-259e-4ff1-8b91-dc31627914f0

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@73 785a6c6c-259e-4ff1-8b91-dc31627914f0

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@74 785a6c6c-259e-4ff1-8b91-dc31627914f0

  Renommage des fichiers et adaptation des makefiles.

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@75 785a6c6c-259e-4ff1-8b91-dc31627914f0

  Adaptation des #include, fin d'adaptation des makefiles.

  Reste à faire : renommage des fichiers de GuiNuMo, adaptation dans le
  code, amélioration du makefile (cible d'installation).
2011-03-16 13:52:45 +01:00