xlab / at

AT is a framework written in Go for communication with AT-compatible devices like Huawei modems via serial port.
MIT License
120 stars 53 forks source link

notifyPort not populated if CommandPort and NotifyPort are same #19

Closed yocha closed 5 years ago

yocha commented 5 years ago

https://github.com/xlab/at/blob/7884b63edf8326b47be93c99e3e56192a98fd984/at.go#L372

This logic result in notifyPort = nil if CommandPort equals NotifyPort or NotifyPort not provided. As a result sanity check fails.

xlab commented 5 years ago

Hm, this is very strange to have both on the same serial port. I don't think it would work. But the sanityCheck might be adjusted to skip notification port for example, if it's nil.

yocha commented 5 years ago

ya... maybe I'm not understanding use cases for command and notify ports. I'm try to make this library work with Raspberry Pi 3B+ with SIM7100A GSM development board.

xlab commented 5 years ago

@yocha my Huawei dongle creates 2-3 serial ports, and notify acts like a message queue for events, and command port acts like an API server. That's the difference. I'm not sure how it works on a non-customer board. But you may find a work around and contribute it ;)

yocha commented 5 years ago

will try...