Liking cljdoc? Tell your friends :D

dvlopt.rxtx

IO on serial ports based on jRXTX.

Any IO operation will throw an exception in case of failure.

IO on serial ports based on jRXTX.

Any IO operation will throw an exception in case of failure.
raw docstring

available-bytesclj

(available-bytes port)

Estimates how many bytes are available for reading right now.

Estimates how many bytes are available for reading right now.
sourceraw docstring

available-portsclj

(available-ports)

Gets a set of available serial ports.

Prints an error if a port is already locked but does not throw.

Gets a set of available serial ports.

Prints an error if a port is already locked but does not throw.
sourceraw docstring

closeclj

(close port)

Closes a serial port.

Closes a serial port.
sourceraw docstring

defaultsclj

Defaut values for keys and options used throughout this namespace.

Defaut values for keys and options used throughout this namespace.
sourceraw docstring

describeclj

(describe port)

Describes the current status of the given serial port by providing a map containing the same keys as the option for opening a serial port as well as a ::name and ::closed?.

Cf. serial-port

Describes the current status of the given serial port by providing a map containing
the same keys as the option for opening a serial port as well as a ::name and ::closed?.

Cf. `serial-port`
sourceraw docstring

flushclj

(flush port)

Ensures written bytes are properly flushed.

Ensures written bytes are properly flushed.
sourceraw docstring

input-streamclj

(input-stream port)

Given an open serial port, retrieves the associated java.io.InputStream.

Should not be needed unless really needed.

Given an open serial port, retrieves the associated java.io.InputStream.

Should not be needed unless really needed.
sourceraw docstring

IWritablecljprotocol

Anything that can be converted to a byte-array and then be written using a serial port.

Anything that can be converted to a byte-array and then be written using a serial port.

to-byte-arrayclj

(to-byte-array this)

Converts the given argument to a byte array.

Converts the given argument to a byte array.
sourceraw docstring

output-streamclj

(output-stream port)

Given an open serial port, retrieves the associated java.io.OutputStream.

Should not be needed unless really needed.

Given an open serial port, retrieves the associated java.io.OutputStream.

Should not be needed unless really needed.
sourceraw docstring

readclj

(read port n)
(read port n timeout-ms)

Reads an arbitrary amount of unsigned bytes from the serial port and returns them as a sequence.

If a timeout is provided, unblocks once it is up and returns what has been read up to this point. It not, blocks until n have been read, no less.

Reads an arbitrary amount of unsigned bytes from the serial port and returns them as a sequence.

If a timeout is provided, unblocks once it is up and returns what has been read up to this point.
It not, blocks until `n` have been read, no less.
sourceraw docstring

reconfigureclj

(reconfigure port port-options)

Reconfigures the given serial port on the fly by providing a map containing the same options as for opening a new port.

Missing options will not resolve to default values.

Cf. serial-port

Reconfigures the given serial port on the fly by providing a map containing the same options as for
opening a new port.

Missing options will not resolve to default values.

Cf. `serial-port`
sourceraw docstring

serial-portclj

(serial-port path)
(serial-port path port-options)

Opens a serial port at the given path.

The configuration map may contain :

::baud-rate Preferably a standard baud rate.

::data-bits How many bits per data char one of #{5 6 7 8}.

::flow-control Handshaking for preventing the sender from sending too much too fast, one of

   :none      ;; No handshaking
   :rts-cts   ;; Hardware flow-control
   :xon-xoff  ;; Software flow-control

::parity Error detection, one of :

   :even   ;; An even parity bit will be sent for each data char
   :mark   ;; Mark parity bit
   :none   ;; No parity bit
   :odd    ;; Odd parity will be sent for each data char
   :space  ;; Space parity

::stop-bits Bits sent at the end of each data char, one of #{:1 :1.5 :2}.

Ex. (serial-port "/dev/ttyUSB0" {::baud-rate 2400 ::parity :none})

Cf. defaults for defaut values relative to these options.

Opens a serial port at the given path.

The configuration map may contain :

   ::baud-rate
     Preferably a standard baud rate.

   ::data-bits
     How many bits per data char one of #{5 6 7 8}.

   ::flow-control
     Handshaking for preventing the sender from sending too much too fast, one of

       :none      ;; No handshaking
       :rts-cts   ;; Hardware flow-control
       :xon-xoff  ;; Software flow-control


   ::parity
     Error detection, one of :

       :even   ;; An even parity bit will be sent for each data char
       :mark   ;; Mark parity bit
       :none   ;; No parity bit
       :odd    ;; Odd parity will be sent for each data char
       :space  ;; Space parity

   ::stop-bits
     Bits sent at the end of each data char, one of #{:1 :1.5 :2}.


Ex. (serial-port "/dev/ttyUSB0"
                 {::baud-rate 2400
                  ::parity    :none})


Cf. `defaults` for defaut values relative to these options.
sourceraw docstring

writeclj

(write port writable)

Writes to the serial port anything satisfying the IWritable protocol.

Are already available :

Byte arrays Characters Sequences of any sort (seqables) Number converted to a single unsigned byte Strings

Writes to the serial port anything satisfying the IWritable protocol.

Are already available :

  Byte arrays
  Characters
  Sequences of any sort (seqables)
  Number converted to a single unsigned byte
  Strings
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close