Sort of working over web.
This commit is contained in:
@ -106,7 +106,7 @@ window.onload = function() {
|
|||||||
| constant index-html
|
| constant index-html
|
||||||
|
|
||||||
variable webserver
|
variable webserver
|
||||||
500 constant out-size
|
20000 constant out-size
|
||||||
200 stream input-stream
|
200 stream input-stream
|
||||||
out-size dup stream output-stream
|
out-size dup stream output-stream
|
||||||
create out-string out-size 1+ allot align
|
create out-string out-size 1+ allot align
|
||||||
@ -118,8 +118,9 @@ create out-string out-size 1+ allot align
|
|||||||
|
|
||||||
: handle-input
|
: handle-input
|
||||||
z" cmd" webserver @ WebServer.hasArg if
|
z" cmd" webserver @ WebServer.hasArg if
|
||||||
z" cmd" webserver @ WebServer.arg input-stream >stream
|
z" cmd" webserver @ WebServer.arg input-stream >stream pause
|
||||||
out-string out-size output-stream stream>
|
out-string out-size output-stream stream>
|
||||||
|
out-string z>s arduino-type
|
||||||
200 z" text/plain" out-string webserver @ WebServer.send
|
200 z" text/plain" out-string webserver @ WebServer.send
|
||||||
else
|
else
|
||||||
500 z" text/plain" z" Missing Input" webserver @ WebServer.send
|
500 z" text/plain" z" Missing Input" webserver @ WebServer.send
|
||||||
@ -141,7 +142,7 @@ create out-string out-size 1+ allot align
|
|||||||
again
|
again
|
||||||
;
|
;
|
||||||
|
|
||||||
' do-serve 10 10 task webserver-task
|
' do-serve 1000 1000 task webserver-task
|
||||||
|
|
||||||
: serve
|
: serve
|
||||||
['] serve-type is type
|
['] serve-type is type
|
||||||
@ -151,6 +152,6 @@ create out-string out-size 1+ allot align
|
|||||||
|
|
||||||
: wifi ( z z -- )
|
: wifi ( z z -- )
|
||||||
WIFI_MODE_STA Wifi.mode
|
WIFI_MODE_STA Wifi.mode
|
||||||
WiFi.begin 1000 ms WiFi.localIP ip. cr
|
WiFi.begin begin WiFi.localIP 0= while 100 ms repeat WiFi.localIP ip. cr
|
||||||
z" ueforth" MDNS.begin if ." MDNS started" else ." MDNS failed" then cr ;
|
z" ueforth" MDNS.begin if ." MDNS started" else ." MDNS failed" then cr ;
|
||||||
: webui ( z z -- ) wifi serve ;
|
: webui ( z z -- ) wifi serve ;
|
||||||
|
|||||||
@ -20,5 +20,4 @@
|
|||||||
swap 0 do over c@ over ch>stream swap 1+ swap loop 2drop ;
|
swap 0 do over c@ over ch>stream swap 1+ swap loop 2drop ;
|
||||||
: stream> ( a n st -- )
|
: stream> ( a n st -- )
|
||||||
begin over 1 > over empty? 0= and while
|
begin over 1 > over empty? 0= and while
|
||||||
." ch "
|
|
||||||
dup stream>ch >r rot dup r> swap c! 1+ rot 1- rot repeat 2drop 0 swap c! ;
|
dup stream>ch >r rot dup r> swap c! 1+ rot 1- rot repeat 2drop 0 swap c! ;
|
||||||
|
|||||||
Reference in New Issue
Block a user