char* strcpy(char *dest, const char *src) {
    return ets_strcpy(dest, src);
}
Beispiel #2
0
static void ICACHE_FLASH_ATTR myTimer(void *arg)
{
	static int thistik;
	static int waittik;
	thistik++;

	CSTick( 0 );

//	wifi_set_user_fixed_rate( 3, 0x0b );  //0xb = 6Mbit G
//	wifi_set_user_fixed_rate( 3, 0x0c );  //0xc = 54Mbit G
//	wifi_set_user_fixed_rate( 3, 0x07 );  //0x7 = 11Mbit ... B?

	//0x02 = 5.5Mbit/s (B)
	//0x01 = 2Mbit/s (B)
	//0x00 = 1Mbit/s (B)
	//0x10 = 6.5MBit
	//0x11 = 13MBit
	//0x1f = 72.2Mbit/s
//	wifi_set_phy_mode(PHY_MODE_11N);
	wifi_set_phy_mode(PHY_MODE_11G); //??? Maybe - I haven't been doing this...

	wifi_set_user_fixed_rate( 3, 0x0c );

//	wifi_set_user_limit_rate_mask( 3 );
//	wifi_set_user_rate_limit( FIXED_RATE_MASK_ALL, 0, 1, 1 );

	if( thistik == waittik-3 )
	{
		int i;
		static int did_init = 0;

		if( !did_init && printed_ip )
		{
			//For sending raw packets.
			//SetupRawsend();
			wifi_set_raw_recv_cb( rx_func );

			wifi_register_send_pkt_freedom_cb( sent_freedom_cb );

			did_init = 1;

			//Setup our send packet with our MAC address.
			wifi_get_macaddr(STATION_IF, mypacket + 10);
			debugccount = 0;

			//printf( "!!!\n" );
		}


		//printf( "%d\n", debugccount );
		//uart0_sendStr("k");
		ets_strcpy( mypacket+30, "ESPEED" );
		txpakid++;
		mypacket[36] = txpakid>>24;
		mypacket[37] = txpakid>>16;
		mypacket[38] = txpakid>>8;
		mypacket[39] = txpakid>>0;
		mypacket[40] = 0;
		mypacket[41] = 0;
		mypacket[42] = 0;
		mypacket[43] = 0;
	
		packet_tx_time = 0;
		wifi_send_pkt_freedom( mypacket, 30 + 16, true) ;  
		//Looks like we can actually set the speed --> wifi_set_user_fixed_rate( 3, 12 );
	}