The current connectHandler has the following signature:
func(device Device, connected bool)
In case of connection failure or unexpected disconnection, we only have the connected boolean value. But more information can be exposed through an error object.
After a quick experimentation I was able to retrieve the following disconnection error message: The connection has timed out unexpectedly. from the underlying stack, and I think this is really worth the change.
My proposal, is to update the connect handler with an error parameter:
func(device Device, connected bool, err error)
The current connectHandler has the following signature:
In case of connection failure or unexpected disconnection, we only have the
connectedboolean value. But more information can be exposed through an error object.After a quick experimentation I was able to retrieve the following disconnection error message:
The connection has timed out unexpectedly.from the underlying stack, and I think this is really worth the change.My proposal, is to update the connect handler with an error parameter: