public_variable_neighborhood/public_variable_neighborhood.h
/**
 * Initializes the PVN. Also switches is online.
 * @param pvn 	The PVN to be initialized. Has to be new.
 * @param port 	The broadcast port to be used internally
 * @param variable 	A reference to the public variable
 * @param size 	The size of the public variable (to interpret the variable as a bitfield of this length)
 * @param maxAge 	The age in seconds with which an neighbor entry is outdated.
 *
 */
Initializes the PVN. Also switches is online.
@param pvn   The PVN to be initialized. Has to be new.
@param port  The broadcast port to be used internally
@param variable      A reference to the public variable
@param size  The size of the public variable (to interpret the variable as a bitfield of this length)
@param maxAge        The age in seconds with which an neighbor entry is outdated.
Initializes the PVN . Also switches is online . @param pvn The PVN to be initialized . Has to be new . @param port The broadcast port to be used internally @param variable A reference to the public variable @param size The size of the public variable ( to interpret the variable as a bitfield of this length ) @param maxAge The age in seconds with which an neighbor entry is outdated .
void pvn_init(struct PVN* pvn, uint16_t port, void* variable, uint8_t size, uint8_t maxAge)
{
	if(pvn->port != 0) printf("WARNING: Possible multiple creation!\n");
	pvn->port = port;
	pvn->variable = variable;
	pvn->size_of_variable = size;
	pvn->maximum_age_of_neighbor_information = maxAge;
	pvn->neighborhood_size = 0;
	if(list_of_all_public_variable_neighborhoods==0) {
		list_of_all_public_variable_neighborhoods = pvn;
	} else {
		struct PVN* tmp = list_of_all_public_variable_neighborhoods;
		while(tmp->next != 0) {
			tmp = tmp->next;
		}
		tmp->next = pvn;
	}
	pvn_set_online(pvn);
}
void pvn_init ( struct PVN * pvn , uint16_t port , void * variable , uint8_t size , uint8_t maxAge ) { if ( pvn -> port != 0 ) printf ( " \n " ) ; pvn -> port = port ; pvn -> variable = variable ; pvn -> size_of_variable = size ; pvn -> maximum_age_of_neighbor_information = maxAge ; pvn -> neighborhood_size = 0 ; if ( list_of_all_public_variable_neighborhoods == 0 ) { list_of_all_public_variable_neighborhoods = pvn ; } else { struct PVN * tmp = list_of_all_public_variable_neighborhoods ; while ( tmp -> next != 0 ) { tmp = tmp -> next ; } tmp -> next = pvn ; } pvn_set_online ( pvn ) ; }
Initializes the PVN.
Initializes the PVN .
//add to list