void OnC2xPacket( long channel, long dir, long radioChannel, long signalStrength, long signalQuality, long packet )
{
byte rx_data[1500];
byte rx_packet[1500];
long rx_length;
long rx_headerLength;
rx_headerLength = C2xGetTokenData(packet, "wlan", "header", elCount(rx_packet), rx_packet);
// without Ethernet header
rx_length = C2xGetTokenData(packet, "eth", "data", elCount(rx_data), rx_data);
write ("rx_headerLength: %d", rx_headerLength);
write ("rx_dataLength: %d", rx_length);
memcpy_off(rx_packet, rx_headerLength, rx_data, 0, rx_length);
rx_length += rx_headerLength;
// Always use rx_length to access rx_packet!
write ("rx_length: %d", rx_length);
}