×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Problem with indi_getprop

  • Posts: 11
  • Thank you received: 0
Hi, look at this session:
marekb ~ $ indi_getprop | grep CONNECTION.CONNECT
EQMod Mount.CONNECTION.CONNECT=Off
Joystick.CONNECTION.CONNECT=Off
GPS NMEA.CONNECTION.CONNECT=Off
Pegasus UBP.CONNECTION.CONNECT=Off
Toupcam EP3CMOS02300KPC(USB2.0).CONNECTION.CONNECT=Off
 
marekb ~ $ indi_getprop "Pegasus UBP.CONNECTION.CONNECT"
Pegasus UBP.CONNECTION.CONNECT=Off
 
marekb ~ $ indi_getprop "Toupcam EP3CMOS02300KPC(USB2.0).CONNECTION.CONNECT"
No Toupcam EP3CMOS02300KPC(USB2.0).CONNECTION from localhost:7624

indi_getprop appears to have a problem with the device name that contains either a period or a parenthesis, in this case device "Toupcam EP3CMOS02300KPC(USB2.0)". Is there any workaround, how to use indi_getprop/indi_setprop with this device?
3 years 11 months ago #51793

Please Log in or Create an account to join the conversation.

Hmmm can you patch indi_getprop to get around this? Indeed the period would throw it off. It's written in C, so no C++ Regex can be used.
3 years 11 months ago #51812

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
I rewrrote the function crackDPE in file getINDIproperty.c and it works. But it's quick and dirty solution for today's observation without knowledge of other connections to anonother parts of code. Analogous changes need to be made in setINDIproperty.c.
/* crack spec and add to srchs[], else exit */
static void crackDPE(char *spec)
{
    char d[1024], p[1024], e[1024];
    char buf[3*1024];
    char *ptr;
 
    strncpy(buf, spec, 3*1024);
    buf[3*1024-1] = 0;
 
    if (verbose)
        fprintf(stderr, "looking for %s\n", spec);
 
    ptr = strrchr(buf, '.');
    if(!ptr) {
       fprintf(stderr, "Unknown format for property spec: %s\n", spec);
       usage();
    }
    *ptr++ = 0;
    strncpy(e, ptr, 1024);
    e[1023] = 0;
 
    ptr = strrchr(buf, '.');
    if(!ptr) {
       fprintf(stderr, "Unknown format for property spec: %s\n", spec);
       usage();
    }
    *ptr++ = 0;
    strncpy(p, ptr, 1024);
    p[1023] = 0;
 
    strncpy(d, buf, 1024);
    d[1023] = 0;
 
    addSearchDef(d, p, e);
}
3 years 11 months ago #51826

Please Log in or Create an account to join the conversation.

Time to create page: 0.481 seconds