Fixed NMEA report parsing.
This commit is contained in:
@ -132,7 +132,7 @@ func (c *conn) ConfigurePPP() error {
|
||||
config := fmt.Sprintf(pppConfig, apn, c.port.GetName(), c.port.GetBaudrate())
|
||||
|
||||
// Write to file
|
||||
f, err := os.OpenFile("/etc/ppp/peers/"+pppConfigName, os.O_CREATE | os.O_WRONLY, 0666)
|
||||
f, err := os.OpenFile("/etc/ppp/peers/"+pppConfigName, os.O_CREATE|os.O_WRONLY, 0666)
|
||||
if err != nil {
|
||||
return fmt.Errorf("open ppp config file %w", err)
|
||||
}
|
||||
@ -230,8 +230,7 @@ func (c *conn) Ping() bool {
|
||||
}
|
||||
c.logger.Println("Ping 2 resp:", string(resp))
|
||||
|
||||
|
||||
return !strings.Contains(string(resp), "Destination Host Unreachable") // tmp solution
|
||||
return !(strings.Contains(string(resp), "Destination Host Unreachable") || strings.Contains(string(resp), "Destination Net Unreachable")) // tmp solution
|
||||
}
|
||||
|
||||
func (c *conn) Close() error {
|
||||
|
Reference in New Issue
Block a user