Open
Conversation
Many budget GSM/LTE modems expose only a single serial port for both commands and notifications, unlike Huawei devices that provide separate command and notification ports. When NotifyPort is set to the same value as CommandPort, Open() now assigns notifyPort = cmdPort so that sanityCheck passes. Callers should skip Watch() in this configuration to avoid read conflicts on the shared file descriptor.
JimScope
added a commit
to JimScope/vendel
that referenced
this pull request
Mar 23, 2026
Mark both xlab/at vendor patches as temporary with links to the upstream PRs that will make them unnecessary: - commands.go: Export Dev field (xlab/at#43) - at.go: Single-port support (xlab/at#42)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NotifyPort == CommandPort, aliasnotifyPorttocmdPortinOpen()so thatsanityCheckpassesMotivation
Many budget GSM/LTE modems (e.g. SIM800, Quectel EC25 in single-port mode) expose only one serial port. Currently, if
NotifyPortis set equal toCommandPort,Open()skips opening the notification port, leavingnotifyPortasnil. This causessanityCheckto returnErrClosed, makingSend()andInit()fail.Change
In
Open(), after the dual-port branch, add:```go
} else if d.NotifyPort != "" {
d.notifyPort = d.cmdPort
}
```
This aliases the notification port to the command port fd, allowing
sanityCheckto pass. Callers should not callWatch()in this configuration, since reading from the same fd in two goroutines would cause race conditions.Backward Compatibility
No behavioral change for existing dual-port configurations. Only affects the case where
NotifyPort == CommandPort, which previously failed withErrClosed.