public_variable_neighborhood/public_variable_neighborhood.h
/**
 * Prints some informations to the serial port for debugging.
 */
Prints some informations to the serial port for debugging.
Prints some informations to the serial port for debugging .
void pvn_print_state(struct PVN* pvn)
{
	printf("PVN-Info: SIZE=%u, {", pvn_neighborhood_size(pvn));
	struct Nbr* nbr = pvn_getNbrs(pvn);
	for(; nbr!=0; nbr=pvn_getNextNbr(nbr)) {
		printf("[ID=%u](age=%u)", nbr->id,  (unsigned int)(clock_seconds() - nbr->timestamp));
		if(pvn_getNextNbr(nbr) != 0) {
			printf(", ");
		}
	}
	if(pvn->online == 0){
	printf(", offline\n");
	} else {
	printf(", online\n");
	}
}
void pvn_print_state ( struct PVN * pvn ) { printf ( " " , pvn_neighborhood_size ( pvn ) ) ; struct Nbr * nbr = pvn_getNbrs ( pvn ) ; for ( ; nbr != 0 ; nbr = pvn_getNextNbr ( nbr ) ) { printf ( " " , nbr -> id , ( unsigned int ) ( clock_seconds ( ) - nbr -> timestamp ) ) ; if ( pvn_getNextNbr ( nbr ) != 0 ) { printf ( " " ) ; } } if ( pvn -> online == 0 ) { printf ( " \n " ) ; } else { printf ( " \n " ) ; } }
Prints some informations to the serial port for debugging.
Prints some informations to the serial port for debugging .