예제 #1
0
// This function initializes the TCB table marking all entries NULL. It also initializes 
// a global variable for the overlay TCP socket descriptor ``conn'' used as input parameter
// for snp_sendseg and snp_recvseg. Finally, the function starts the seghandler thread to 
// handle the incoming segments. There is only one seghandler for the client side which
// handles call connections for the client.
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
void srt_client_init(int conn)
{
    printf("srt_client_init\n");
	mainTcpSockId = conn ;
	reset_clients();
	fflush(stdout);
	pthread_create(&pthread_receiver,NULL,seghandler,(void*)NULL);
  	return;
}
예제 #2
0
void reset_avr() {
	reset_clients();
	if (verbose) printf("Reset AVR\n");
	linuxgpio_initpin(config.reset_gpio);
	linuxgpio_highpulsepin(config.reset_gpio, 500);
	linuxgpio_close();
	//mssleep(2000);
	avrstatus=-1;
	
	if (autoconfig) {
		int ret = config_open(&config,CFG_PATH);
		if (ret<0) {
			printf("Disabling AUTOCONFIG\n");
			//printf("Failed to initiate config! [%s]\n", strerror(ret));	
			autoconfig = 0;
			return;
		}
		clock_gettime(CLOCK_REALTIME, &reset_time_prev);
		reset_timeout = initTimeout;
	}
}