IRNAS / ppk2-api-python

Power Profiling Kit 2 unofficial python api.
http://irnas.eu
GNU General Public License v2.0
145 stars 37 forks source link

Serial read/write never times out if PPK2 goes in bad state #23

Closed lorjala closed 1 year ago

lorjala commented 1 year ago

After opening serial connection and if PPK2 goes in bad state then following serial reads or writes never timeout.

Exclusive flag should be passed when creating serial connection: https://github.com/IRNAS/ppk2-api-python/blob/f05ca671cf73de76c68eefe499acf745c1e81908/src/ppk2_api/ppk2_api.py#L52

Also allowing to pass read/write timeout options to pyserial through the constructor would be nice.

NejcKle commented 1 year ago

@lorjala please test the fix I have made in 7bb1d5b.

juhhov commented 1 year ago

@NejcKle thanks for looking at this. Improvement idea; would it be more versatile if kwargs would be relayed straight to Serial constructor?

NejcKle commented 1 year ago

@juhhov Great idea actually! I have added this in 3450e73.

lorjala commented 1 year ago

Thanks! This looks good now.

Please make a new release with these changes when you can.

NejcKle commented 1 year ago

@lorjala Release 0.9.1 has been published here and to https://pypi.org/project/ppk2-api/. I am closing this issue.