Use the chrome.serial API to read from and write to a device connected to a serial port.
Use the chrome.serial API to read from and write to a device connected to a serial port. * available since Chrome 34 * https://developer.chrome.com/apps/serial
(clear-break connection-id)
Restore character transmission on a given connection and place the transmission line in a nonbreak state.
|connection-id| - The id of the connection.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - https://developer.chrome.com/apps/serial#property-callback-result.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Restore character transmission on a given connection and place the transmission line in a nonbreak state. |connection-id| - The id of the connection. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - https://developer.chrome.com/apps/serial#property-callback-result. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-clearBreak.
(connect path)
(connect path options)
Connects to a given serial port.
|path| - The system path of the serial port to open. |options| - Port configuration options.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [connection-info] where:
|connection-info| - https://developer.chrome.com/apps/serial#property-callback-connectionInfo.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Connects to a given serial port. |path| - The system path of the serial port to open. |options| - Port configuration options. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [connection-info] where: |connection-info| - https://developer.chrome.com/apps/serial#property-callback-connectionInfo. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-connect.
(disconnect connection-id)
Disconnects from a serial port.
|connection-id| - The id of the opened connection.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - https://developer.chrome.com/apps/serial#property-callback-result.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Disconnects from a serial port. |connection-id| - The id of the opened connection. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - https://developer.chrome.com/apps/serial#property-callback-result. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-disconnect.
(flush connection-id)
Flushes all bytes in the given connection's input and output buffers.
|connection-id| - https://developer.chrome.com/apps/serial#property-flush-connectionId.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - https://developer.chrome.com/apps/serial#property-callback-result.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Flushes all bytes in the given connection's input and output buffers. |connection-id| - https://developer.chrome.com/apps/serial#property-flush-connectionId. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - https://developer.chrome.com/apps/serial#property-callback-result. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-flush.
(get-connections)
Retrieves the list of currently opened serial port connections owned by the application.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [connection-infos] where:
|connection-infos| - https://developer.chrome.com/apps/serial#property-callback-connectionInfos.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/serial#method-getConnections.
Retrieves the list of currently opened serial port connections owned by the application. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [connection-infos] where: |connection-infos| - https://developer.chrome.com/apps/serial#property-callback-connectionInfos. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-getConnections.
(get-control-signals connection-id)
Retrieves the state of control signals on a given connection.
|connection-id| - The id of the connection.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [signals] where:
|signals| - https://developer.chrome.com/apps/serial#property-callback-signals.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/serial#method-getControlSignals.
Retrieves the state of control signals on a given connection. |connection-id| - The id of the connection. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [signals] where: |signals| - https://developer.chrome.com/apps/serial#property-callback-signals. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-getControlSignals.
(get-devices)
Returns information about available serial devices on the system. The list is regenerated each time this method is called.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [ports] where:
|ports| - https://developer.chrome.com/apps/serial#property-callback-ports.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Returns information about available serial devices on the system. The list is regenerated each time this method is called. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [ports] where: |ports| - https://developer.chrome.com/apps/serial#property-callback-ports. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-getDevices.
(get-info connection-id)
Retrieves the state of a given connection.
|connection-id| - The id of the opened connection.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [connection-info] where:
|connection-info| - https://developer.chrome.com/apps/serial#property-callback-connectionInfo.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Retrieves the state of a given connection. |connection-id| - The id of the opened connection. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [connection-info] where: |connection-info| - https://developer.chrome.com/apps/serial#property-callback-connectionInfo. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-getInfo.
(send connection-id data)
Writes data to the given connection.
|connection-id| - The id of the connection. |data| - The data to send.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [send-info] where:
|send-info| - https://developer.chrome.com/apps/serial#property-callback-sendInfo.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Writes data to the given connection. |connection-id| - The id of the connection. |data| - The data to send. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [send-info] where: |send-info| - https://developer.chrome.com/apps/serial#property-callback-sendInfo. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-send.
(set-break connection-id)
Suspends character transmission on a given connection and places the transmission line in a break state until the clearBreak is called.
|connection-id| - The id of the connection.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - https://developer.chrome.com/apps/serial#property-callback-result.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Suspends character transmission on a given connection and places the transmission line in a break state until the clearBreak is called. |connection-id| - The id of the connection. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - https://developer.chrome.com/apps/serial#property-callback-result. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-setBreak.
(set-control-signals connection-id signals)
Sets the state of control signals on a given connection.
|connection-id| - The id of the connection. |signals| - The set of signal changes to send to the device.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - https://developer.chrome.com/apps/serial#property-callback-result.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/serial#method-setControlSignals.
Sets the state of control signals on a given connection. |connection-id| - The id of the connection. |signals| - The set of signal changes to send to the device. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - https://developer.chrome.com/apps/serial#property-callback-result. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-setControlSignals.
(set-paused connection-id paused)
Pauses or unpauses an open connection.
|connection-id| - The id of the opened connection. |paused| - Flag to indicate whether to pause or unpause.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Pauses or unpauses an open connection. |connection-id| - The id of the opened connection. |paused| - Flag to indicate whether to pause or unpause. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-setPaused.
(tap-all-events chan)
Taps all valid non-deprecated events in chromex.app.serial namespace.
Taps all valid non-deprecated events in chromex.app.serial namespace.
(tap-on-receive-error-events channel & args)
Event raised when an error occurred while the runtime was waiting for data on the serial port. Once this event is raised, the connection may be set to paused. A 'timeout' error does not pause the connection.
Events will be put on the |channel| with signature [::on-receive-error [info]] where:
|info| - https://developer.chrome.com/apps/serial#property-onReceiveError-info.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/apps/serial#event-onReceiveError.
Event raised when an error occurred while the runtime was waiting for data on the serial port. Once this event is raised, the connection may be set to paused. A 'timeout' error does not pause the connection. Events will be put on the |channel| with signature [::on-receive-error [info]] where: |info| - https://developer.chrome.com/apps/serial#property-onReceiveError-info. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/serial#event-onReceiveError.
(tap-on-receive-events channel & args)
Event raised when data has been read from the connection.
Events will be put on the |channel| with signature [::on-receive [info]] where:
|info| - Event data.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Event raised when data has been read from the connection. Events will be put on the |channel| with signature [::on-receive [info]] where: |info| - Event data. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/serial#event-onReceive.
(update connection-id options)
Update the option settings on an open serial port connection.
|connection-id| - The id of the opened connection. |options| - Port configuration options.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - https://developer.chrome.com/apps/serial#property-callback-result.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Update the option settings on an open serial port connection. |connection-id| - The id of the opened connection. |options| - Port configuration options. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - https://developer.chrome.com/apps/serial#property-callback-result. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/serial#method-update.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close