PX4/Firmware — pull request #749 by DonLakeFlyer (2014-03-17 04:46:54+00:00)
Title: Arm/Disarm duplication removal and support for Disarm in VEHICLE_CMD_COMPONENT_ARM_DISARM

Discovered that Disarm through VEHICLE_CMD_COMPONENT_ARM_DISARM was not implemented. While fixing that up made a number of other changes as well:

- Created a single method for arm/disarm which is used by both arm/disarm and set mode commands. This removes duplication, and differences across those two implementations.
- Modified arming_state_transition to allow mavlink_fd to be passed in. If this is non-zero, the routine will output to the mavlink the reason for arm state transition failure. By doing this you don't need to duplicate the arming state transition logic outside out this routine in commander. Seems dangerous to have this live in multiple places. Could get out of sync too easily.

Tested on Pixhawk board with both set mode and arm/disarm commands.