diff --git a/Makefile b/Makefile index 05e3a6a..5ae9fa7 100644 --- a/Makefile +++ b/Makefile @@ -8,4 +8,10 @@ build: # @$Env:GOOS="linux"; $Env:GOARCH="arm"; $Env:GOARM=5 # .profile -# cgo_enabled 0 \ No newline at end of file +# cgo_enabled 0 + +push: + git status + git add -A + git commit -m "Transfer." + git push origin master \ No newline at end of file diff --git a/api/modem/at/at.go b/api/modem/at/at.go index e6f25d9..9c1c5a3 100644 --- a/api/modem/at/at.go +++ b/api/modem/at/at.go @@ -92,6 +92,7 @@ func (p *atPort) makeReq(msg string) (string, error) { } // Read readLen, err := p.port.Read(p.inputBuf) + log.Println("RAWREAD:", string(p.inputBuf[:readLen])) if err != nil { return "", fmt.Errorf("port read: %w", err) } diff --git a/api/modem/modem.go b/api/modem/modem.go index a595817..a0dda20 100644 --- a/api/modem/modem.go +++ b/api/modem/modem.go @@ -107,11 +107,11 @@ func (m *modem) checkPort(portName string) error { // Check serial connection // Connect - port := at.New(portName, m.baudrate) - if err := port.Connect(); err != nil { + m.port = at.New(portName, m.baudrate) + if err := m.port.Connect(); err != nil { return fmt.Errorf("connect: %w", err) } - defer port.Disconnect() // Do not bother about errors... + defer m.port.Disconnect() // Do not bother about errors... // Ping log.Println("Ping...") @@ -121,7 +121,7 @@ func (m *modem) checkPort(portName string) error { } // Check model - model, err := port.Request(at.CmdGet, "CGMM") + model, err := m.port.Request(at.CmdGet, "CGMM") if err != nil { return fmt.Errorf("get model: %w", err) }