public_variable_neighborhood/public_variable_neighborhood.h
/**
 * Broadcasts the own state.
 * Why isn't this done automatically? Because the broadcast is strongly connected to the neighborhood iteration. Also you
 * gain more power over the frequency and it saves an extra thread.
 */
Broadcasts the own state.
Why isn't this done automatically. Because the broadcast is strongly connected to the neighborhood iteration. Also you
gain more power over the frequency and it saves an extra thread.
Broadcasts the own state . Why isn ' t this done automatically . Because the broadcast is strongly connected to the neighborhood iteration . Also you gain more power over the frequency and it saves an extra thread .
void pvn_broadcast(struct PVN* pvn)
{
	if(pvn->online==0) {
		broadcast_open(&(pvn->broadcast), pvn->port, &pvn_broadcast_callbacks);
	}
	if(pvn->variable!=0) {
		packetbuf_copyfrom(pvn->variable, pvn->size_of_variable);
		broadcast_send(&(pvn->broadcast));
	}
	if(pvn->online==0) {
		broadcast_close(&(pvn->broadcast));
	}
}
void pvn_broadcast ( struct PVN * pvn ) { if ( pvn -> online == 0 ) { broadcast_open ( & ( pvn -> broadcast ) , pvn -> port , & pvn_broadcast_callbacks ) ; } if ( pvn -> variable != 0 ) { packetbuf_copyfrom ( pvn -> variable , pvn -> size_of_variable ) ; broadcast_send ( & ( pvn -> broadcast ) ) ; } if ( pvn -> online == 0 ) { broadcast_close ( & ( pvn -> broadcast ) ) ; } }
Broadcasts the own state.
Broadcasts the own state .
//open the channel temporarily if closed //Send //close channel again if pvn is offline