espat: change Response() method to use a passed-in timeout value instead of fixed pauses.

Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
Ron Evans
2019-06-26 09:13:29 +02:00
parent 1b81b992c2
commit 59aece351a
4 changed files with 43 additions and 63 deletions
+2 -4
View File
@@ -80,11 +80,8 @@ func main() {
input[i+1] = byte('\n')
adaptor.Write(input[:i+2])
// give the ESP8266 a chance to respond.
time.Sleep(10 * time.Millisecond)
// display response
console.Write(adaptor.Response())
console.Write(adaptor.Response(100))
// prompt
prompt()
@@ -118,6 +115,7 @@ func connectToAP() {
// provide access point
func provideAP() {
time.Sleep(500 * time.Millisecond)
console.Write([]byte("Starting wifi network as access point '"))
console.Write([]byte(ssid))
console.Write([]byte("'...\r\n"))