Skip to content

Commit

Permalink
Fix for #81
Browse files Browse the repository at this point in the history
  • Loading branch information
mame82 committed Feb 5, 2020
1 parent e7e5d3f commit 6c4b84a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions rbuild_debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
echo compiling ...
env GOOS=linux GOARCH=arm GOARM=6 go build -gcflags "all=-N -l" -o build/P4wnP1_service cmd/P4wnP1_service/P4wnP1_service.go
env GOOS=linux GOARCH=arm GOARM=6 go build -o build/P4wnP1_cli cmd/P4wnP1_cli/P4wnP1_cli.go
env GOOS=linux GOARCH=arm GOARM=6 go build -o /tmp/ntest ntest.go

echo uploading ...
scp /tmp/ntest 172.16.0.1:~/P4wnP1/build
scp build/P4wnP1_service 172.16.0.1:~/P4wnP1/build
scp build/P4wnP1_cli 172.16.0.1:~/P4wnP1/build

5 changes: 3 additions & 2 deletions service/wifi.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@ type hostapdOutMonitor struct {
func (m *hostapdOutMonitor) Write(p []byte) (n int, err error) {
// if result already received, the write could exit (early out)
if m.resultReceived.IsSet() {
return n, nil
// fix endless loop of writing 'CTRL-EVENT-TERMINATING'
return len(p), nil
}

// check if buffer contains relevant strings (assume write is called line wise by the hosted process
Expand Down Expand Up @@ -557,7 +558,7 @@ type wpaSupplicantOutMonitor struct {
func (m *wpaSupplicantOutMonitor) Write(p []byte) (n int, err error) {
// if result already received, the write could exit (early out)
if m.resultReceived.IsSet() {
return n, nil
return len(p), nil
}

// check if buffer contains relevant strings (assume write is called line wise by the hosted process
Expand Down

0 comments on commit 6c4b84a

Please sign in to comment.