package drones.util.ardrone2;

import akka.util.ByteString;
import drones.commands.ardrone2.atcommand.ATCommand;
import drones.commands.ardrone2.atcommand.ATCommandREF;

/**
 * Factory class for packets (ATCommands)
 * @TODO change ByteString -> ATCommand
 *
 * Created by brecht on 3/9/15.
 */
public class PacketCreator {

    // REF COMMANDS
    /**
     *
     * @return ByteString of Take-off command
     */
    public static ByteString createTakeOffPacket() {
        // The 9th bit is the landing bit
        int value = (1 << 9) | (1 << 18) | (1 << 20) | (1 << 22) | (1 << 24) | (1 << 28);
        return ByteString.fromString(new ATCommandREF(value).toString());
    }

    /**
     *
     * @return ByteString of Landing command
     */
    public static ByteString createLandingPacket() {
        int value = (1 << 18) | (1 << 20) | (1 << 22) | (1 << 24) | (1 << 28);
        return ByteString.fromString(new ATCommandREF(value).toString());
    }

    /**
     *
     * @return ByteString of Emergency command
     */
    public static ByteString createEmergencyPacket() {
        // The 8th bit is the emergency bit
        int value = (1 << 8) | (1 << 18) | (1 << 20) | (1 << 22) | (1 << 24) | (1 << 28);
        return ByteString.fromString(new ATCommandREF(value).toString());
    }

    public static ByteString createPacket(ATCommand atcommand) {
        return ByteString.fromString(atcommand.toString());
    }
}

@@ -452,28 +452,35 @@
 keOffPacket(
+int seq
 ) %7B%0A
-
         // T
@@ -645,32 +645,37 @@
 ew ATCommandREF(
+seq, 
 value).toString(
@@ -798,24 +798,31 @@
 ndingPacket(
+int seq
 ) %7B%0A        
@@ -938,32 +938,37 @@
 ew ATCommandREF(
+seq, 
 value).toString(
@@ -1099,16 +1099,23 @@
 yPacket(
+int seq
 ) %7B%0A    
@@ -1236,32 +1236,32 @@
 4) %7C (1 %3C%3C 28);%0A
-
         return B
@@ -1298,16 +1298,21 @@
 mandREF(
+seq, 
 value).t

Fix seq in packetcreator