Hi
i'm trying to develop a little procedure to send a SMS via AT commands; i
found goserial package to connect to serial and a test with loop back works.
When i try to use a modem write function work but read function don't wait
the response from modem ?
Are there someone that use this packages??
I don't know the syscall in windows so the following piece of code is for
me "mysterious" ...
func (p *serialPort) Read(buf []byte) (int, error) {
if p == nil || p.f == nil {
return 0, fmt.Errorf("Invalid port on read %v %v", p, p.f)
}
p.rl.Lock()
defer p.rl.Unlock()
if err := resetEvent(p.ro.HEvent); err != nil {
return 0, err
}
var done uint32
err := syscall.ReadFile(p.fd, buf, &done, p.ro)
// fmt.Printf("\np.fd %+v,\nbuf %+v,\nbuf %s done %+v, p.ro %+v
\n",p.fd,buf,buf,done,p.ro)
if err != nil && err != syscall.ERROR_IO_PENDING {
return int(done), err
}
return getOverlappedResult(p.fd, p.ro)
}
How can i wait the response from modem ?
A curiosity.. Why some functions, like syscall.ReadFile, is not present in
web documentation?
Alex
--