Hello.

We have been using your libraries for a long time and we are very thankful
to you for developing such a nice project! Recently, in our test setups we
ran into an error and upon investigation of your libsigrok project we think
that we might have found an issue.

In our test setups we use two different power supplies(*Tenma* and
*RDTech-DPS*) which we control remotely using the same Python script. We
get the issue when we read current from the power supplies. The general
flow of the script looks like this:

1) Open the device
2) Create and start a session
3) Read from the device
4) Stop the session
5) Close the device

Note: Some intermediate steps like adding the device to the session and
registering a callback function are not put here.

The above procedure works quite well with our *RDTech-DPS* devices.
However, we get an exception in the last step from the *korad-kaxxxp*
driver that controls the *Tenma* saying that the device is already closed.
Upon investigation, we found that in
the* std_serial_dev_acquisition_stop()* routine the device gets closed. In
addition, this fact applies to all device drivers that use your standard
API helper function to stop the acquisition. On the other hand, for the
device drivers that implement their
own stop acquisition function, this seems to be not the case as for the
*RDTech-DPS* driver. Actually this results in a conflict. We think that
either all device drivers should implement a close of the device in their
*dev_acquisition_stop* routine or
closing the device should be completely removed from
*std_serial_dev_acquisition_stop()*. We created a pull request that in
which we chose to remove the device closure lines in the
*std_serial_dev_acquisition_stop()* function in *std.c* file. We think
that it is not the proper place to close the device because it was the user
that explicitly opened the device and it should be the user's
responsibility to close the device when necessary. Apart from this
discussion, applying this change fixes our problem
but definitely you are the ones that would evaluate this change correctly
and make a decision.

We would be very glad if you could consider our pull request. It might also
be that we are using your library in the wrong manner. If it is the case,
we would be more than happy to hear our errors from you.

Looking forward to hearing from you and best regards,

Abdulkerim Altuntas
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to