Transfer.
This commit is contained in:
parent
aa6f1b45d1
commit
620c98cbf1
8
Makefile
8
Makefile
@ -8,4 +8,10 @@ build:
|
||||
# @$Env:GOOS="linux"; $Env:GOARCH="arm"; $Env:GOARM=5
|
||||
|
||||
# .profile
|
||||
# cgo_enabled 0
|
||||
# cgo_enabled 0
|
||||
|
||||
push:
|
||||
git status
|
||||
git add -A
|
||||
git commit -m "Transfer."
|
||||
git push origin master
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user