Fixed NMEA report parsing.

This commit is contained in:
2024-08-02 19:16:39 +03:00
parent 9bc94bfe7c
commit e2e02ebbfe
3 changed files with 20 additions and 12 deletions

View File

@ -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 {