Open tracycollins opened 5 years ago
Good catch, in the documentation of the serial port version 7.x.x we are using there is also no mention of writable
.
isOpen
exists since serialport 5.0.0 while this code was once created using serialport 4, so someone should make a pull request and fix this.
But I'm wondering: if writable
would be undefined
, the driver would not work at all... Is writable
still implemented in the serialport codebase or how does this even work? o_O
It is coming from the stream writable and still exists :)
In the sendUniverse method, it checks the "writable" property:
I think that it should be checking SerialPort.isOpen property instead? I can't find the writable property in the current SerialPort documentation: https://serialport.io/docs/en/api-stream
I found this while debugging a memory leak when testing an animation to be sure my app wouldn't crash if it couldn't find an Enttec device. If testing for 'writable', the driver will write to a non-existent serial port, leak memory, and eventually crash. When I changed the driver code to this, it seems to run ok: