ggtriada.blogg.se

Golang goserial
Golang goserial




golang goserial

Then I would write a function to read one line (read byte by byte and check if it is 13 and exit if it is). You say you want to read "response", but, I think< you aren't clear what "response" means.Ĭonsidering you are talking to a modem, what I would do is say that all modem replies are "lines" = sequence of bytes with byte=13 at the end. I think you do not have clear plan of attack. i want to read the response when i do this my example not read all chars at first time so i do iterate until there aren't chars in buffer Alternatively, just look at the source files. You could use godoc command on you computer to see what you need. syscall package looks different on different platforms. And godoc command only shows packages for the platform it runs on.

golang goserial

Why some functions, like syscall.ReadFile, is not present in web documentation?Īre you referring to ? If you are, it is running "godoc -http=:80" command on platform other them windows. I could be wrong, but I think (*rialPort).Read should work for you. Also see, for example, for "why", especially "Overlapped I/O" section.

golang goserial

#Golang goserial code#

I always look at the source code so see what it does. I don't know the syscall in windows so the following piece of code is for me "mysterious". I think, I looked at this package long time ago. Are there someone that use this packages? If you like help, just post small program for us to demonstrate your issue. It is not clear to me what your problem is. read function don't wait the response from modem ?






Golang goserial