@@ -53,7 +53,7 @@ func (h *hub) run() {
53
53
h .connections [c ] = true
54
54
// send supported commands
55
55
c .send <- []byte ("{\" Version\" : \" " + version + "\" } " )
56
- c .send <- []byte ("{\" Commands\" : [\" list\" , \" open [portName] [baud] [bufferAlgorithm (optional)]\" , \" send [portName] [cmd]\" , \" sendnobuf [portName] [cmd]\" , \" close [portName]\" , \" bufferalgorithms\" , \" baudrates\" , \" restart\" , \" exit\" , \" program [portName] [board:name] [$path/to/filename/without/extension]\" ]} " )
56
+ c .send <- []byte ("{\" Commands\" : [\" list\" , \" open [portName] [baud] [bufferAlgorithm (optional)]\" , \" send [portName] [cmd]\" , \" sendnobuf [portName] [cmd]\" , \" close [portName]\" , \" bufferalgorithms\" , \" baudrates\" , \" restart\" , \" exit\" , \" program [portName] [board:name] [$path/to/filename/without/extension]\" , \" programfromurl [portName] [board:name] [urlToHexFile] \" ]} " )
57
57
c .send <- []byte ("{\" Hostname\" : \" " + * hostname + "\" } " )
58
58
case c := <- h .unregister :
59
59
delete (h .connections , c )
@@ -169,14 +169,23 @@ func checkCmd(m []byte) {
169
169
go spErr ("You did not specify a port to close" )
170
170
}
171
171
172
+ } else if strings .HasPrefix (sl , "programfromurl" ) {
173
+
174
+ args := strings .Split (s , " " )
175
+ if len (args ) == 4 {
176
+ go spProgramFromUrl (args [1 ], args [2 ], args [3 ])
177
+ } else {
178
+ go spErr ("You did not specify a port, a board to program and/or a URL" )
179
+ }
180
+
172
181
} else if strings .HasPrefix (sl , "program" ) {
173
182
174
183
args := strings .Split (s , " " )
175
184
if len (args ) > 3 {
176
185
var slice []string = args [3 :len (args )]
177
186
go spProgram (args [1 ], args [2 ], strings .Join (slice , " " ))
178
187
} else {
179
- go spErr ("You did not specify a port, a board to program and a filename" )
188
+ go spErr ("You did not specify a port, a board to program and/or a filename" )
180
189
}
181
190
182
191
} else if strings .HasPrefix (sl , "sendjson" ) {
0 commit comments