Skip to content

gentl: always call IFUpdateDeviceList before IFOpenDevice #1002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

psoftware
Copy link

Fixes #1001.

I am not sure this is the right way to fix it. In arvgentlsystem.c I see there is a device hashmap which is updated by the _discover function. That function invokes TLOpen -> IFOpen -> IFOpenDevice -> IFClose -> TLClose and keeps the hashmap updated with the current internal list of the gentl producer. Introducing this patch would allow to have a not up-to-date hashmap.

@henriquesimoes
Copy link
Contributor

@xiaoqiangwang, just pinging you since you first implemented the support for GenTL and might not be watching the repository. ;)

@xiaoqiangwang
Copy link

I thought of that but decided it would violate the "do-one-thing" principle. There is a public API, arv_update_device_list for that.

@EmmanuelP
Copy link
Contributor

I've just had a quick look. This patch is simple, but does not feel right. I think it would be better to make aravis not call IFClose and TLClose automatically on the last use. It would also probably improve the performance on device opening.

@psoftware
Copy link
Author

I thought of that but decided it would violate the "do-one-thing" principle. There is a public API, arv_update_device_list for that.

Surely it does not follow that rule, which also bothered me. Maybe this requirement should be moved above the interface.

I've just had a quick look. This patch is simple, but does not feel right. I think it would be better to make aravis not call IFClose and TLClose automatically on the last use. It would also probably improve the performance on device opening.

It was the easiest way to avoid changing things at the caller site. Consider also that the internal implementation does not feel right too. The internal device hashmap cache is updated by the _discover function, which performs the opening of TLSystem, TLInterface, Device, etc. and closing all of them at the end, which makes all entries invalid, unless the caller performs a scan first before opening any of the scanned devices.

I will be able to work on this starting from the next week if you have any ideas (: Thank you for your reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot open Alkeria cameras
4 participants