Fixed error logging. Added more logging of SIM info.

This commit is contained in:
2024-08-04 15:59:58 +03:00
parent 90a06e6afa
commit 026c1aa3bb
6 changed files with 65 additions and 38 deletions

View File

@ -103,7 +103,7 @@ func (c *conn) checkReqs() error {
return fmt.Errorf("AT+CPIN? request: %w", err)
}
if !resp.Check() {
return fmt.Errorf("SIM card is not inserted")
return fmt.Errorf("validate SIM: error response: %s", resp)
}
return nil
}
@ -115,7 +115,7 @@ func (c *conn) ConfigurePPP() error {
return fmt.Errorf("AT+CSPN? request: %w", err)
}
if !resp.Check() {
return fmt.Errorf("failed to check SIM provider")
return fmt.Errorf("get provider: error response: %s", resp)
}
strs := strings.Split(string(resp), "\"")
if len(strs) < 3 {