/** * Extract flight identification form identification message * @return void */ private function extractIdent() { $this->_ident = ""; if ($this->isAircraftIdentificationMsg()) { $data = substr($this->_bin, 40, 56); $car = AdsbUtils::getCharArray(); $ident = ""; for ($i = 0; $i < 8; $i++) { $ident .= $car[intval(substr($data, 0 + $i * 6, 6), 2)]; } $ident = str_replace('_', '', $ident); $ident = str_replace('#', '', $ident); $this->_ident = $ident; } }
/** * Test CPR Latitude calculation odd and even * @return void */ public function testCPN() { $val = AdsbUtils::cprN(45, false); $this->assertEquals(42, $val); $val = AdsbUtils::cprN(45, true); $this->assertEquals(41, $val); }