Open tynrol opened 3 years ago
frame.registerAddressAndNumber() is an unexported function of the mbserver package. As such, the customization
section of the docs is wrong - you can't use that function outside the mbserver package.
It gets worse: The Framer interface (which you'd receive as frame
in your func) doesn't contain that function.
I think its pretty clear by now that the project is no longer supported. :(
I am willing to put a handler on my Modbus connection and everything was going fine until the moment I tried to implement server customization as it's written in the documentation.
And when I'm trying to build it with my script:
!/bin/bash
export GOPATH=
pwd
go get github.com/tbrandon/mbserver go get github.com/goburrow/serial go build modbus.goIt appears with a message(the one and the only):
frame.registerAddressAndNumber undefined (type mbserver.Framer has no field or method registerAddressAndNumber)
This comes from the fact that registerAddressAndNumber(frame Framer) is a private function and we can't call it from outside of the package. And how do we deal with that if by documentation we are meant to call it from another package? Was it actually meant to be a private function? Do we need to override all structures and functions from that package to make it work as it was meant to work?
Hope there is a way of correctly implementing a customized server without changing function privacy status by ourselves something like this.