/** * Wrapper for GS ( L, to calculate and send correct data length. * * @param string $m Modifier/variant for function. Usually '0'. * @param string $fn Function number to use, as character. * @param string $data Data to send. * @throws InvalidArgumentException Where the input lengths are bad. */ private function wrapperSendGraphicsData($m, $fn, $data = '') { if (strlen($m) != 1 || strlen($fn) != 1) { throw new InvalidArgumentException("wrapperSendGraphicsData: m and fn must be one character each."); } $header = $this->intLowHigh(strlen($data) + 2, 2); $this->connector->write(self::GS . "(L" . $header . $m . $fn . $data); }