diff options
author | David Barksdale <amatus@amatus.name> | 2017-01-15 21:13:18 -0600 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2017-01-15 21:13:18 -0600 |
commit | 5287141cd9692fa3702b0221b9b814ddbdfe666d (patch) | |
tree | ad21ea73ad34f4335b4506375806e535f377c3e3 /src/app/portmaster.clj | |
parent | 48f423ca49aa62a8aa9928d3085ce89032703ff2 (diff) |
Read temperature from Dallas DS18B20 sensors
Diffstat (limited to 'src/app/portmaster.clj')
-rw-r--r-- | src/app/portmaster.clj | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/app/portmaster.clj b/src/app/portmaster.clj index 1387750..3fb57e2 100644 --- a/src/app/portmaster.clj +++ b/src/app/portmaster.clj @@ -85,12 +85,12 @@ (defn init [port-name username password] - (let [socat (.. (new ProcessBuilder - (into-array ["socat" - "-v" - (str "OPEN:" port-name ",b9600,raw") - "-"])) - (redirectError (new File "/tmp/portmaster.log")) + (let [socat (.. (ProcessBuilder. + (into-array ["socat" + "-v" + (str "OPEN:" port-name ",b9600,raw") + "-"])) + (redirectError (File. "/tmp/portmaster.log")) (start)) expect (.. (new ExpectBuilder) (withInputs (into-array [(.getInputStream socat)])) @@ -100,4 +100,8 @@ (build)) executor (Executors/newSingleThreadScheduledExecutor)] (send pm assoc :socat socat :expect expect) - (.scheduleAtFixedRate executor #(send pm poll username password) 2 10 TimeUnit/SECONDS))) + (.scheduleAtFixedRate executor + #(send pm poll username password) + 2 + 10 + TimeUnit/SECONDS))) |