Commits

Cliff Biffle committed 6f1b4e1

Added support for the CTRL message.

  • Participants
  • Parent commits d7ce83d

Comments (0)

Files changed (2)

File src/org/mg8/ardrone/comms/ControlMessage.java

   }
   
   /**
+   * Adds a CTRL message, which will adjust the drone's protocol state machine.
+   * 
+   * @param mode new mode.
+   */
+  public ControlMessage addModeMessage(int mode) {
+    at("CTRL", $i(mode));
+    return this;
+  }
+  
+  /**
    * Adds a REF message, which will update the drone's flying state.
    * 
    * @param inFlight whether the drone should be in the air ({@code true}) or

File test/org/mg8/ardrone/comms/ControlMessageTest.java

   @After public void verifyAll() {
     verify(parent);
   }
+  
+  @Test public void testAddModeMessage() {
+    replayAll();
+    
+    unit.addModeMessage(42);
+    assertCommandText("AT*CTRL=1,42\n");
+  }
 
   @Test public void testWriteFlyingStateCommand_landNormally() {
     replayAll();