예제 #1
0
void testReadBlock()
{
	unsigned short i;
	unsigned short j;


	for( j = 1024+10000; j < 1280+10000; j++ )
	{
		unsigned char sdr, exp;

		startSDwrite( j );
		for( i = 0; i < 52; i++ )
			pushSDwrite( j + 0xaa );
		endSDwrite();


		startSDread( j );
		sendchr( 0 );

		sdr = popSDread();
		exp = j + 0xaa;
	
		if( sdr != exp )
		{
			sendhex2( sdr );
			sendchr( '.' );
			sendhex2( exp );
		}
		sendchr( ' ' );
		endSDread();
	}
}
예제 #2
0
uint8_t TCPReceiveSyn( uint16_t portno )
{
	if( portno == MINECRAFT_PORT )  //Must bump these up by 8... 
	{
		uint8_t ret = GetFreeConnection();//MyGetFreeConnection(HTTP_CONNECTIONS+1, TCP_SOCKETS );
		if( ret == 0 ) return 0;
		sendstr( "Conn attempt: " );
		sendhex2( ret );
		sendchr( '\n' );
		AddPlayer( ret - HTTP_CONNECTIONS - 1 );
		
		return ret;
	}
#ifndef NO_HTTP
	else if( portno == 80 )
	{
		uint8_t ret = MyGetFreeConnection(1, HTTP_CONNECTIONS+1 );
//		sendchr( 0 ); sendchr( 'x' ); sendhex2( ret );
		HTTPInit( ret-1, ret );
		return ret;
	}
#endif
	return 0;
}