Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
peterschwarz committed Jul 9, 2014
2 parents a9b812c + 8e333c8 commit 7e21d2a
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ pom.xml.asc
# Intellij
.idea
*.iml

# Sublime Text
*.sublime-*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Add the following to your `project.clj`

[clj-firmata 1.1.0]
[clj-firmata 1.1.1]

### Connect to a Board

Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject clj-firmata "1.1.1-SNAPSHOT"
(defproject clj-firmata "1.1.1"
:description "clj-firmata provides access to Standard Firmata (http://firmata.org/) commands via clojure"
:url "https://github.com/peterschwarz/clj-firmata"
:license {:name "Eclipse Public License"
Expand Down
23 changes: 22 additions & 1 deletion src/firmata/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,17 @@
[in]
(str (.read in) "." (.read in)))

(defmulti ^{:private true} read-sysex-event
(defmulti read-sysex-event
"Reads a sysex message.
Returns a map with, at a minimum, the key :type. This should
indicates what sort of sysex message is being received.
For example, the result of a REPORT_FIRMWARE message is
{ :type :firmaware-report
:version \"2.3\"
:name \"StandardFirmata\" }"
(fn [in] (.read in)))

(defmethod read-sysex-event REPORT_FIRMWARE
Expand Down Expand Up @@ -242,6 +252,12 @@
{:type :analog-mappings
:mappings mappings}))

(defmethod read-sysex-event STRING_DATA
[in]
(let [data (consume-sysex in "" #(str %1 (char %2)))]
{:type :string-data
:data data}))

(defmethod read-sysex-event :default
[in]
(let [values (consume-sysex in '[] #(conj %1 %2))]
Expand Down Expand Up @@ -448,6 +464,11 @@
[this]
publisher)


Object

(toString [this] (format "(#Firmata :port-name \"%s\")" port-name))

)))

(defn send-i2c-request
Expand Down
Loading

0 comments on commit 7e21d2a

Please sign in to comment.