saleae / logic2-automation

Logic2 Automation API
https://saleae.github.io/logic2-automation/
Apache License 2.0
19 stars 8 forks source link

[Feature request] Capture status and wait timeout #19

Open jlecuyer opened 1 year ago

jlecuyer commented 1 year ago

The requests

1) Add a facultative max_wait_seconds argument to the wait() function to set a max wait time, after which the capture would be stopped 2) Add a method to query for the capture status (is it still running or has it completed)

The context

I want to use the logic2-automation in a regression testing rack running a github self-hosted runner In case of firmware bug, the trigger for which the capture is waiting may never occur.

My Current approach

My current approach is to

1) Setup the capture as timed capture 2) Trigger the event I am capturing for 3) Sleep for the max wait time of the event 4) Call the wait method to forcefully stop the capture. 5) Parse the csv to see if the trigger occurred 6) Clean-up the analog capture to remove entry before the trigger

Although my current approach is operational, a max wait time would

Thanks you and nice job !

Jonathan

Marcus10110 commented 1 year ago

Thanks Jonathan, the existing API missed this situation.

We're tracking the request here, and I've added a possible workaround there too, although it doesn't solve this completely either: https://ideas.saleae.com/b/feature-requests/automation-api-set-a-timeout-when-looking-for-trigger/

We'll definitely want to add this in the future.

jlecuyer commented 1 year ago

Thanks @Marcus10110 👍