Clamps Dictionary
open-ssensor-port
Function
(open-ssensor-port id serial-port &key (start-receiver t))
Register a new serial-sensor-port on serial-port, open its input, and define and start its default responders if start-receiver is t. id is used for the internal registry.
In receiver mode, sensor nodes announce their MAC addresses on boot and are registered automatically. Sensors already running when the port is opened are auto-registered on the first data packet received.
In direct mode, call add-ssensor manually after opening the port.
Returns id.
Arguments
id |
Keyword or Symbol denoting the id of the serial port. |
serial-port |
String denoting the device path of the serial port. |
:start-receiver |
Boolean indicating whether to start the receiver thread. |
Example
;; Receiver mode: (open-ssensor-port :sensors "/dev/ttyACM0") ;; Direct mode: (open-ssensor-port :sensor-1 "/dev/ttyACM0") (add-ssensor 1 :sensor-1)