1
0
mirror of https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git synced 2023-10-10 11:37:40 +00:00
This commit is contained in:
Jan Schneider
2017-03-25 01:45:39 +01:00
parent 9c3156f0f6
commit 63580ae33f
4 changed files with 392 additions and 52 deletions

View File

@@ -45,7 +45,28 @@ proc process {} {
if {[lindex $path 1] == "version"} {
return "\"[rmupdate::version]\""
} elseif {[lindex $path 1] == "xy"} {
} elseif {[lindex $path 1] == "get_firmware_info"} {
return [rmupdate::get_firmware_info]
} elseif {[lindex $path 1] == "install_firmware"} {
fconfigure stdout -buffering none
#puts "Content-Type: application/octet-stream"
puts "Content-Type: text/html; charset=utf-8"
puts "Status: 200 OK";
puts ""
flush stdout
after 1000
puts "Line 1\n"
flush stdout
after 1000
puts "Line 2\n"
flush stdout
after 1000
puts "Line 3\n"
flush stdout
after 1000
puts "Line 4\n"
flush stdout
return ""
}
}
error "invalid request" "Not found" 404
@@ -61,7 +82,7 @@ if [catch {process} result] {
puts ""
set result [json_string $result]
puts -nonewline "\{\"error\":\"${result}\"\}"
} else {
} elseif {$result != ""} {
puts "Content-Type: application/json"
puts "Status: 200 OK";
puts ""