It seems I skipped porting the code to gracefully close a connection in the transition from 0.6 to 0.7. This is a great low-hanging fruit, so I'll leave this here for someone to picup.
We already generally have the parts in place, however they are not quite correct:
Defines a type: COTPPacketDisconnectRequest, however the third parameter is not class, but disconnectReason.
The old TPDU is defined here:
This should be an enum type. The constant names and values can be taken from here:
As soon as these changes are in place and the code has been generated, the logic for closing can be implemented by being inspired by the old drivers code: