When hot reload, the connected serial port was not released, so sometimes communication cannot be resumed after reconnection
I think we can do it this way
1、Provide address api like this,so we can save this address
int get address {
return _serialPtr?.address ?? 0;
}
2、Provide a static free api like this.
static void freeByAddress(int address) {
if (address > 0) {
_bindings.serial_free(ffi.Pointer.fromAddress(address));
}
}
When hot reload, the connected serial port was not released, so sometimes communication cannot be resumed after reconnection
I think we can do it this way
1、Provide address api like this,so we can save this address
int get address {
return _serialPtr?.address ?? 0;
}
2、Provide a static free api like this.
static void freeByAddress(int address) {
if (address > 0) {
_bindings.serial_free(ffi.Pointer.fromAddress(address));
}
}