control4 / docs-driverworks

Home Page for the Driverworks SDK
Other
41 stars 17 forks source link

OnNetworkBindingChanged not called on driver update #5

Open yeti7 opened 3 years ago

yeti7 commented 3 years ago

I'm using the latest driver template with network connection. Everything works correctly when device is initially added. The issue arises when the existing driver is updated via the composer.

The driver goes through the normal initialization, but the TCP remains bound so OnNetworkBindingChanged in c4_device_connection_base.lua is never called. This results in network not initialized correctly and communication failing with "Device is not connected" message. Auto re-connect timer is also not working.

If device is removed and re-added following the driver update then connection resumes as expected.

Maybe the solution is to detect if the connection is already bound at the time of driver initialization and re-initialize network state as it is done in OnNetworkBindingChanged handler.

WWalshC4 commented 3 years ago

This is a known issue that we are working on creating a general handler for. We're tracking it internally with tag DRIV-4166