flagxor / ueforth

Apache License 2.0
90 stars 26 forks source link

modification for login #26

Open MPETREMANN11 opened 1 year ago

MPETREMANN11 commented 1 year ago

There is one point on which a small modification should be made.

It's in this definition:

: login ( z z -- ) WIFI_MODE_STA Wifi.mode WiFi.begin begin WiFi.localIP 0= while 100 ms repeat WiFi.localIP ip. cr z" forth" MDNS.begin if ." MDNS started" else ." MDNS failed" then cr ;

Except to recompile all the ESP32Forth code, no way to change "forth" to the MDNS. It's annoying if you want to communicate with multiple ESP32forth boards on the same network. One solution would be to have a vectorized word:

defer myMDNS : MDNSforth s" forth" ; ' MDNSforth is myMDNS

: login ( z z -- ) WIFI_MODE_STA Wifi.mode WiFi.begin begin WiFi.localIP 0= while 100 ms repeat WiFi.localIP ip. cr myMDNS MDNS.begin if ." MDNS started" else ." MDNS failed" then cr ;

That's what I suggest. If you can see better, no problem.

Cordially