Skip to content

[RFC] DefaultDevice: Add Generic Nickname support#2343

Open
perfinion wants to merge 1 commit intoindilib:masterfrom
perfinion:indi-nicknames
Open

[RFC] DefaultDevice: Add Generic Nickname support#2343
perfinion wants to merge 1 commit intoindilib:masterfrom
perfinion:indi-nicknames

Conversation

@perfinion
Copy link

This extends the DefaultDevice class to support nicknames.

Nicknames are stored in ~/.indi/INDINicknames.xml in a format like the below. Nicknames are assoicated with a driver and stable device identifier.

The device identifier must be stable across boots and not dependent on which port the device is plugged into. Usually this will be some form of serial number of the device, but specifics are left up to each driver.

Since each identifier is per-driver, devices from different drivers can share the same nickname. The INDI framework must not try to interpret the identifier, only compare for equality since different devices might have serial numbers in different formats.

Since the device-name can't be changed once the driver is running, changes to nicknames can only take effect at the next INDI startup.

The NicknameTP should be added with addNicknameControl().

<INDINicknames>
 <nickname driver="AcmeFocuser" identifier="SN123">MainScope</nickname>
 <nickname driver="AcmeFocuser" identifier="SN456">GuideScope</nickname>
 <nickname driver="AcmeDustCap" identifier="CAP-1-2-3">MainScope</nickname>
</INDINicknames>

This extends the DefaultDevice class to support nicknames.

Nicknames are stored in ~/.indi/INDINicknames.xml in a format like the below.
Nicknames are assoicated with a driver and stable device identifier.

The device identifier must be stable across boots and not dependent on which
port the device is plugged into. Usually this will be some form of serial
number of the device, but specifics are left up to each driver.

Since each identifier is per-driver, devices from different drivers can
share the same nickname. The INDI framework must not try to interpret the
identifier, only compare for equality since different devices might have
serial numbers in different formats.

Since the device-name can't be changed once the driver is running, changes
to nicknames can only take effect at the next INDI startup.

The NicknameTP should be added with addNicknameControl().

<INDINicknames>
 <nickname driver="AcmeFocuser" identifier="SN123">MainScope</nickname>
 <nickname driver="AcmeFocuser" identifier="SN456">GuideScope</nickname>
 <nickname driver="AcmeDustCap" identifier="CAP-1-2-3">MainScope</nickname>
</INDINicknames>

Signed-off-by: Jason Zaman <jason@perfinion.com>
@perfinion
Copy link
Author

@knro @tbowers7 Here is a Request For Comments for indilib/indi-3rdparty#1226
Can you take a look and let me know if there are any major structural changes that need doing?

It builds and I've tested the XML parsing in a separate test program, but I have not finished integrating it into asi_focusers.cpp yet. I tried to add a addNicknameControl() similar to other properties in DefaultDevice, but I'm not sure how to best handle updates. The problem is I dont want to add a SerialNumberTP because it can be any stable ID, does not have to necessarily be a serial number specifically, so that is best left up to the driver, not in DefaultDevice.

Also regarding the XML, I wonder if it is better to have <driver><nickname> to be more similar to ParkData.xml (I only realized that might be better after I'd finished writing it this way, so figured i'd let you have a look first.

@knro
Copy link
Contributor

knro commented Mar 2, 2026

Great! Yes, if it is similar to ParkData.xml, it's best. I also think this feature should be disabled by default until enabled by the child driver via addNicknameControl or similar. Please let me know once you are able to test if full with the ASI driver as well so we know it works for 3rd party drivers.

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.

2 participants