2016-06-15 07:47:32 +00:00
|
|
|
.. sec-jsclientlib-connection:
|
|
|
|
|
|
|
|
|
|
:mod:`OctoPrint.connection`
|
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
|
|
.. js:function:: OctoPrint.connection.getSettings(opts)
|
|
|
|
|
|
2016-06-29 07:28:55 +00:00
|
|
|
Retrieves the available connection options for connection to a printer.
|
|
|
|
|
|
|
|
|
|
See :ref:`Get connection settings <sec-api-connection-current>` for the response format.
|
|
|
|
|
|
2016-06-30 10:06:08 +00:00
|
|
|
:param object opts: Additional options for the request
|
|
|
|
|
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
|
|
|
|
|
2016-06-15 07:47:32 +00:00
|
|
|
.. js:function:: OctoPrint.connection.connect(data, opts)
|
|
|
|
|
|
2016-06-29 07:28:55 +00:00
|
|
|
Connects to the printer, optionally using the provided connection ``data`` as parameters.
|
|
|
|
|
|
|
|
|
|
If ``data`` is provided it's expected to be an object specifying one or more of
|
|
|
|
|
|
|
|
|
|
* ``port``
|
|
|
|
|
* ``baudrate``
|
|
|
|
|
* ``printerProfile``
|
|
|
|
|
* ``save``
|
|
|
|
|
* ``autoconnect``
|
|
|
|
|
|
|
|
|
|
See :ref:`Issue a connection command <sec-api-connection-command>` for more details.
|
|
|
|
|
|
2016-06-30 10:06:08 +00:00
|
|
|
:param object data: Connection data to use
|
|
|
|
|
:param object opts: Additional options for the request
|
|
|
|
|
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
|
|
|
|
|
2016-06-15 07:47:32 +00:00
|
|
|
.. js:function:: OctoPrint.connection.disconnect(opts)
|
|
|
|
|
|
2016-06-29 07:28:55 +00:00
|
|
|
Disconnects from the printer.
|
|
|
|
|
|
|
|
|
|
See :ref:`Issue a connection command <sec-api-connection-command>` for more details.
|
|
|
|
|
|
2016-06-30 10:06:08 +00:00
|
|
|
:param object opts: Additional options for the request
|
|
|
|
|
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
|
|
|
|
|
2016-06-15 07:47:32 +00:00
|
|
|
.. js:function:: OctoPrint.connection.fakeAck(opts)
|
2016-06-29 07:28:55 +00:00
|
|
|
|
|
|
|
|
Triggers a fake acknowledgement (``ok``) on the printer.
|
|
|
|
|
|
|
|
|
|
See :ref:`Issue a connection command <sec-api-connection-command>` for more details.
|
|
|
|
|
|
2016-06-30 10:06:08 +00:00
|
|
|
:param object opts: Additional options for the request
|
|
|
|
|
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|