Joli\ArDrone\Navdata\Frame::__construct PHP Method

__construct() public method

public __construct ( $binaryFrame )
    public function __construct($binaryFrame)
    {
        // from ARDrone_SDK_2_0/ARDroneLib/Soft/Common/config.h
        $this->droneStateMasks = ['flying' => 1 << 0, 'videoEnabled' => 1 << 1, 'visionEnabled' => 1 << 2, 'controlAlgorithm' => 1 << 3, 'altitudeControlAlgorithm' => 1 << 4, 'startButtonState' => 1 << 5, 'controlCommandAck' => 1 << 6, 'cameraReady' => 1 << 7, 'travellingEnabled' => 1 << 8, 'usbReady' => 1 << 9, 'navdataDemo' => 1 << 10, 'navdataBootstrap' => 1 << 11, 'motorProblem' => 1 << 12, 'communicationLost' => 1 << 13, 'softwareFault' => 1 << 14, 'lowBattery' => 1 << 15, 'userEmergencyLanding' => 1 << 16, 'timerElapsed' => 1 << 17, 'MagnometerNeedsCalibration' => 1 << 18, 'anglesOutOfRange' => 1 << 19, 'tooMuchWind' => 1 << 20, 'ultrasonicSensorDeaf' => 1 << 21, 'cutoutDetected' => 1 << 22, 'picVersionNumberOk' => 1 << 23, 'atCodecThreadOn' => 1 << 24, 'navdataThreadOn' => 1 << 25, 'videoThreadOn' => 1 << 26, 'acquisitionThreadOn' => 1 << 27, 'controlWatchdogDelay' => 1 << 28, 'adcWatchdogDelay' => 1 << 29, 'comWatchdogProblem' => 1 << 30, 'emergencyLanding' => 1 << 31];
        $this->buffer = new Buffer($binaryFrame);
        $this->options = [];
        $this->header = $this->buffer->getUint32LE();
        if ($this->checkHeaderIntegrity()) {
            $this->getFrameConfig();
            $this->getFrameOptions();
        } else {
            throw new \Exception('Invalid frame');
        }
    }