LO53 PROJECT - AP DOCUMENTATION
Project based on Indoor Positionning System
Functions
/home/junicode/Documents/LO53_Project/LO53_AP_Development/rssi_list.c File Reference

This file contain the diffeerent functions necessay for the management of the linked-lists used by the program. More...

#include "rssi_list.h"
Include dependency graph for rssi_list.c:

Functions

void add_value (Deque *list, double value)
 add_value adds a new RSSI value at the end of the deque. 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...
 
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_mac (Element *list, u_char *mac_value)
 find_mac looks up for a MAC address in the list. More...
 
Elementfind_deque (Element *list, Deque *deq)
 This function find a specific Deque in the Element List. 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...
 
void clear_outdated_values (Deque *list)
 clear_outdated_values removes all outdated RSSI in a RSSI deque. More...
 
void clear_outdated_Elements (Element **list)
 clear_outdated_Elements removes all outdated Elements in the linked-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...
 

Detailed Description

This file contain the diffeerent functions necessay for the management of the linked-lists used by the program.

This header file belongs to the rssi_list.c file.

Author
Zeufack Arnel - Member of an LO53 group-project (Other Members: TONY DUONG - YVON MBOUGUEM - JOEL WABO)
Date
15 Juin 2016

This file contain the diffeerent functions necessay for the management of the linked-lists used by the program It contain many important functions such as add_deque, add_element, find_mac, calculate_avg, and some others..

Author
Zeufack Arnel - Member of an LO53 group-project (Other Members: TONY DUONG - YVON MBOUGUEM - JOEL WABO)
Date
15 Juin 2016

It describes the prototypes of the functions used in rssi_list.c

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