Commit Graph

90 Commits

Author SHA1 Message Date
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 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 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 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 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 3d0300cc60 [lib] Translate comments, 72 col. 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 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 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 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 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