Пример #1
0
/* write s_out to edip_COM */
BYTE small_write(BYTE len)
{
	COM_flush(edip_COM);
	COM_write(edip_COM, s_edip_out, len);
	/*wait for ACK*/
	return ack==ACK && time < small_timeout
}
Пример #2
0
static GOOD_OR_BAD LINK_detect_net(struct connection_in * in)
{
	struct port_in * pin = in->pown ;
	/* Set up low-level routines */
	LINKE_setroutines(in);
	pin->timeout.tv_sec = 0 ;
	pin->timeout.tv_usec = 300000 ;

	/* Open the tcp port */
	RETURN_BAD_IF_BAD( COM_open(in) ) ;
	
	LEVEL_DEBUG("Slurp in initial bytes");
//	LINK_slurp( in ) ;
	UT_delay(1000) ; // based on http://morpheus.wcf.net/phpbb2/viewtopic.php?t=89&sid=3ab680415917a0ebb1ef020bdc6903ad
	LINK_slurp( in ) ;
//	LINK_flush(in);

	pin->dev.telnet.telnet_negotiated = needs_negotiation ;
	RETURN_GOOD_IF_GOOD( LINK_version(in) ) ;

	// second try -- send a break and line settings
	LEVEL_DEBUG("Second try -- send BREAK");
	COM_flush(in) ;
	COM_break(in);
	telnet_change(in);
//	LINK_slurp( in ) ;
	RETURN_GOOD_IF_GOOD( LINK_version(in) ) ;

	LEVEL_DEFAULT("LINK detection error");
	COM_close(in) ;
	return gbBAD;
}
Пример #3
0
/* Restore terminal settings (serial port settings) */
static void DS9097_post_reset(struct connection_in *in )
{
	struct port_in * pin = in->pown ;

	if (Globals.eightbit_serial) {
		/* coninue with 8 data bits */
		pin->bits = 8;
	} else {
		/* 6 data bits, Receiver enabled, Hangup, Dont change "owner" */
		pin->bits = 6;
	}
#ifndef B115200
	/* MacOSX support max 38400 in termios.h ? */
	pin->baud = B38400 ;
#else
	pin->baud = B115200 ;
#endif

	/* Flush the input and output buffers */
	COM_flush(in); // Adds no appreciable time
	COM_change(in) ;
}
Пример #4
0
static void LINK_flush( struct connection_in * in )
{
	COM_flush(in) ;
}