LO53 PROJECT - AP DOCUMENTATION
Project based on Indoor Positionning System
Data Structures | Macros | Typedefs | Functions
/home/junicode/Documents/LO53_Project/LO53_AP_Development/rssi_list.h File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <arpa/inet.h>
#include <sys/time.h>
Include dependency graph for rssi_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _Rssi_sample
 
struct  _Deque
 
struct  _Element
 

Macros

#define SAMPLE_DELAY   6
 

Typedefs

typedef struct _Rssi_sample Rssi_sample
 
typedef struct _Deque Deque
 
typedef struct _Element Element
 

Functions

void clear_outdated_values (Deque *list)
 clear_outdated_values removes all outdated RSSI in a RSSI deque. More...
 
void add_value (Deque *list, double value)
 add_value adds a new RSSI value at the end of the deque. More...
 
void clear_outdated_Elements (Element **list)
 clear_outdated_Elements removes all outdated Elements in the linked-list. More...
 
Elementfind_mac (Element *list, u_char *mac_value)
 find_mac looks up for a MAC address in the list. More...
 
Elementadd_element (Element **list, u_char *mac_value)
 add_element adds an element (a new device node) to the list. Elements shall be ordered. More...
 
void calculate_avg (Element **list, u_char *mac_value, u_char *nb_samples, u_char *avg_value)
 Calculate avg ss values from a given string mac address. More...
 
unsigned int mac_maching (u_char *mac1, u_char *mac2)
 This function makes the comparison of two mac addresses to check if they are equals. More...
 
Elementfind_deque (Element *list, Deque *deq)
 This function find a specific Deque in the Element List. More...
 
void decrement_all_deadlines (Element *list)
 This function decrement every second the deadline value of all the samples included in an element list. More...
 

Macro Definition Documentation

#define SAMPLE_DELAY   6

Typedef Documentation

typedef struct _Deque Deque
typedef struct _Element Element
typedef struct _Rssi_sample Rssi_sample

Function Documentation

Element* add_element ( Element **  list,
u_char *  mac_value 
)

add_element adds an element (a new device node) to the list. Elements shall be ordered.

Returns
the added element pointer.
Parameters
lista pointer to the list head pointer.
mac_valuethe MAC address of the new node to be added.
void add_value ( Deque list,
double  value 
)

add_value adds a new RSSI value at the end of the deque.

Parameters
thedeque to append the element to.
valuethe RSSI value (dBm, do not forget to convert when inserting!)
void calculate_avg ( Element **  list,
u_char *  mac_value,
u_char *  nb_samples,
u_char *  avg_value 
)

Calculate avg ss values from a given string mac address.

Parameters
mac_valuethe string MAC address necessary to identify the device to which calculation is needed.
lista pointer to the list head pointer.
nb_samplesis a pointer that will contain the number of sample we need to know.
avg_valueis a pointer that will contain the average rssi_value based on the captured samples.
void clear_outdated_Elements ( Element **  list)

clear_outdated_Elements removes all outdated Elements in the linked-list.

Parameters
listthe Element (devices) list in which the outdated devices need to be removed
void clear_outdated_values ( Deque list)

clear_outdated_values removes all outdated RSSI in a RSSI deque.

Parameters
listthe deque from which to filter the outdated values.
void decrement_all_deadlines ( Element list)

This function decrement every second the deadline value of all the samples included in an element list.

Parameters
listThe Element list head pointer
Element* find_deque ( Element list,
Deque deq 
)

This function find a specific Deque in the Element List.

Returns
it return a pointer to the Element in which the deque is located
Parameters
listthe Element list head pointer
deqthe address of the Deque to find
Element* find_mac ( Element list,
u_char *  mac_value 
)

find_mac looks up for a MAC address in the list.

Returns
a pointer to the corresponding element, NULL if not found.
Parameters
listthe list head pointer.
mac_valuethe MAC address to search.
unsigned int mac_maching ( u_char *  mac1,
u_char *  mac2 
)

This function makes the comparison of two mac addresses to check if they are equals.

Returns
it return 0 if they are not equal and 1 if they are equal
Parameters
mac1the first string mac address
mac2the second string mac address