'what is the MATLAB stopsync equivalent in Python?

I have tried to reproduce Matlab stopasync function in Python using pySerial lib. Without much success. In the MATLAB code I tried the following:

try
    fwrite(serialObj, codeDEC, 'uint8', 'async');
    pause(0.01);
catch
    stopasync(serialObj);
    fwrite(serialObj, codeDEC, 'uint8', 'async');
    pause(0.01);
end

Any tips on what library and how to migrate/use this function in Python?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source