@@ -0,0 +1,2520 @@
+/**%0A *    %7C%7C          ____  _ __%0A * +------+      / __ )(_) /_______________ _____  ___%0A * %7C 0xBC %7C     / __  / / __/ ___/ ___/ __ %60/_  / / _ %5C%0A * +------+    / /_/ / / /_/ /__/ /  / /_/ / / /_/  __/%0A *  %7C%7C  %7C%7C    /_____/_/%5C__/%5C___/_/   %5C__,_/ /___/%5C___/%0A *%0A * Copyright (C) 2013 Bitcraze AB%0A *%0A * Crazyflie Nano Quadcopter Client%0A *%0A * This program is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU General Public License%0A * as published by the Free Software Foundation; either version 2%0A * of the License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU General Public License for more details.%0A *%0A * You should have received a copy of the GNU General Public License%0A * along with this program; if not, write to the Free Software%0A * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.%0A *%0A */%0A%0Apackage se.bitcraze.crazyflie.lib.crtp;%0A%0Aimport java.nio.ByteBuffer;%0Aimport java.nio.charset.Charset;%0A%0A/**%0A * Packet containing console text from the Crazyflie.%0A */%0Apublic class ConsolePacket extends CrtpPacket %7B%0A%0A    public static final Charset CHARSET = Charset.forName(%22US-ASCII%22);%0A%0A    private final String mText;%0A%0A    public ConsolePacket(String text) %7B%0A        super(0, CrtpPort.CONSOLE);%0A        this.mText = text;%0A    %7D%0A%0A    /**%0A     * Get the text contained in the packet.%0A     *%0A     * @return the text%0A     */%0A    public String getText() %7B%0A        return mText;%0A    %7D%0A%0A    /*%0A     * (non-Javadoc)%0A     * @see%0A     * se.bitcraze.crazyflielib.crtp.CRTPPacket#serializeData(java.nio.ByteBuffer%0A     * )%0A     */%0A    @Override%0A    protected void serializeData(ByteBuffer buffer) %7B%0A        buffer.put(mText.getBytes(CHARSET));%0A    %7D%0A%0A    /*%0A     * (non-Javadoc)%0A     * @see se.bitcraze.crazyflielib.crtp.CRTPPacket#getDataByteCount()%0A     */%0A    @Override%0A    protected int getDataByteCount() %7B%0A        return mText.getBytes(CHARSET).length;%0A    %7D%0A%0A    /**%0A     * Construct a console packet using given data.%0A     *%0A     * @param payload the data (must not include the CRTP header)%0A     * @return parsed console packet%0A     */%0A    public static ConsolePacket parse(byte%5B%5D payload) %7B%0A        return new ConsolePacket(new String(payload, CHARSET));%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return %22ConsolePacket: %22 + getText();%0A    %7D%0A%0A%7D%0A

Add ConsolePacket (WIP)