public function write($data)
    {
        $this->ensureDeviceOpen();

        if (false !== ($dataWritten = fwrite($this->fd, $data))) {
            return $dataWritten;
        }

        throw new WriteNotAllowed();
    }
public function write($data)
    {
        $this->ensureDeviceOpen();

        if (false !== ($dataWritten = fwrite($this->fd, $data))) {
            return $dataWritten;
        }

        throw new WriteNotAllowed();
    }
public function write ( $ data ) { $ this -> ensureDeviceOpen ( ) ; if ( false !== ( $ dataWritten = fwrite ( $ this -> fd , $ data ) ) ) { return $ dataWritten ; } throw new WriteNotAllowed ( ) ; }
Write data into serial port line

@param string $data

@return int length of byte written

@throws WriteNotAllowed|DeviceNotOpened
Write data into serial port line