Hello,
is it safe and possible to delete default properties without modifing the core INDI classes?
For instance, the telescope class defines SerialPort and BaudRate, but my hardware works in another way. I am wondering if it is possible to remove these properties working from the derived class so not to show them to the user.
It seems to me that deleteProperty does not get to the point since the delete properties are still listed...
It varies from driver from driver, for INDI::Telescope, it's possible to delete the port and baud rate properties in ISGetProperties() of your derived driver.
Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.
I also tried inside ::initProperties, both before and after call to INDI::Telescope::initProperties but no result...
The properties remain always visible in interfaces and also with indi_getprop.
Other ideas?
P.S.: I am working with self compiled INDI v 1.2.0 on OpenSUSE
It should work in the second function AFTER INDI::Telescope::ISGetProperties(dev) since it is that function that defines both properties. I tested it in the simulator driver and the properties are deleted from the client.
Which client are you using to determine the property had not been deleted ? I've seen some clients, dont remember offhand which, that dont remove the deleted property from displays when the delete method is invoked.
KNRO: I attempted your same test WITHOUT success.
To be sure it does not depend on my installation of the OS or of the INDI library, I repeated the whole job using a Virtual Machine downloaded from osboxes.org.
I used again the openSuse distribution 13.2, upgraded the system, installed the required packages and then a freshly downloaded indilib sources.
I loaded only the indi_simulator_telescope driver into indiserver and tried using DCD to connect (all properties appear) and disconnect (connect properties remain visible and the interface DOES NOT return back to pre-connection situation!).
At this point I also implemented the change in the driver with deleteProperty called into ISGetProperties but, as before, the properties still REMAIN VISIBLE both in DCD and with indi_getprop.
GERRYR: I only tested with these two interfaces.
AJK: in this case there are simply the deleteProperty lines of my own: all the rest is the standard distribution code...
I am going to repeat the same test within an Ubuntu VM just in case...