(to-bytes this)
Converts the type to bytes
Converts the type to bytes
Deprecated; use close!
instead
Deprecated; use `close!` instead
Deprecated; use listen!
instead
Deprecated; use `listen!` instead
(listen! port handler)
(listen! port handler skip-buffered?)
Register a function to be called for every byte received on the specified port.
Only one listener is allowed at a time.
Register a function to be called for every byte received on the specified port. Only one listener is allowed at a time.
(open path
&
{:keys [baud-rate databits stopbits parity]
:or {baud-rate 115200
databits DATABITS_8
stopbits STOPBITS_1
parity PARITY_NONE}})
Returns an opened serial port. Allows you to specify the
Additionally, setting the value of :
(open "/dev/ttyUSB0") (open "/dev/ttyUSB0" :baud-rate 9200)
Returns an opened serial port. Allows you to specify the * :baud-rate (defaults to 115200) * :stopbits (defaults to STOPBITS_1) * :databits (defaults to DATABITS_8) * :parity (defaults to PARITY_NONE). Additionally, setting the value of : (open "/dev/ttyUSB0") (open "/dev/ttyUSB0" :baud-rate 9200)
(port-identifiers)
Returns a seq representing all port identifiers visible to the system
Returns a seq representing all port identifiers visible to the system
Deprecated; use port-identifiers
Deprecated; use `port-identifiers`
Deprecated; use unlisten!
instead
Deprecated; use `unlisten!` instead
(skip-input! port)
(skip-input! port to-drop)
Skips a specified amount of buffered input data.
Skips a specified amount of buffered input data.
(unlisten! port)
De-register the listening fn for the specified port
De-register the listening fn for the specified port
(write port & data)
Writes the given data to the port and returns it. All number literals are treated as bytes. By extending the protocol Bytable, any arbitray values can be sent to the output stream. For example: (extend-protocol Bytable String (to-bytes [this] (.getBytes this "ASCII")))
Writes the given data to the port and returns it. All number literals are treated as bytes. By extending the protocol Bytable, any arbitray values can be sent to the output stream. For example: (extend-protocol Bytable String (to-bytes [this] (.getBytes this "ASCII")))
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close