. */ namespace GnuBoat\Nmea\Nmea0183; class Nmea0183Dpt extends Nmea0183Sentence { function __construct($talker, $checksum, $sentence) { parent::__construct("DPT", $talker, $checksum, $sentence); // init default values $this->_depth = 0; $this->_offset = 0; $content = explode(",", $sentence); if(count($content) != 3) return; $this->_depth = (float)$content[1]; $tmp = explode("*", $content[2]); $this->_offset = $tmp[0]; } public function depth() { return $this->_depth; } public function offset() { return $this->_offset; } private $_depth; private $_offset; } ?>