Ignore:
Timestamp:
05/29/12 20:06:51 (11 years ago)
Author:
gost
Message:

[ip-kammera] fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/instar/instar.h

    r16118 r16140  
    1515        char* tempcam = NULL;
    1616        char* position = NULL;
     17        char* positionstop = NULL;
    1718        int rcret = 0;
    1819        int rcode = 0;
     20        int ohnestop = 0;
    1921       
    2022        if(actcam == 1)
     
    4143               
    4244                drawscreen(instar_screen, 0);
    43                 rcret = waitrc(instar_screen, 250, 0);
     45                rcret = waitrc(instar_screen, 100, 0);
     46                ohnestop = 0;
    4447
    4548                if(rcret == getrcconfigint("rcexit", NULL)) break;
     
    4750                if(rcret == getrcconfigint("rcinfo", NULL))
    4851                {
    49                         addlist(myconfig, "InstarCamAutostart", "nein");
     52                        //addlist(myconfig, "InstarCamAutostart", "nein");
    5053                        rcode = 1;
    5154                        break;
    5255                }       
    5356                       
    54                 if(rcret == getrcconfigint("rc1", NULL))
     57                if(rcret == getrcconfigint("rc1", NULL)) {
    5558                        position = ostrcat("/decoder_control.cgi?command=", "31", 0 , 0);
    56                 if(rcret == getrcconfigint("rc2", NULL))
     59                        ohnestop = 1;
     60                }
     61                if(rcret == getrcconfigint("rc2", NULL)) {
    5762                        position = ostrcat("/decoder_control.cgi?command=", "33", 0 , 0);
    58                 if(rcret == getrcconfigint("rc3", NULL))
     63                        ohnestop = 1;
     64                }
     65                if(rcret == getrcconfigint("rc3", NULL)) {
    5966                        position = ostrcat("/decoder_control.cgi?command=", "35", 0 , 0);
    60                 if(rcret == getrcconfigint("rc4", NULL))
     67                        ohnestop = 1;
     68                }
     69                if(rcret == getrcconfigint("rc4", NULL)) {
    6170                        position = ostrcat("/decoder_control.cgi?command=", "37", 0 , 0);
    62                 if(rcret == getrcconfigint("rc5", NULL))
     71                        ohnestop = 1;
     72                }
     73                if(rcret == getrcconfigint("rc5", NULL)) {
    6374                        position = ostrcat("/decoder_control.cgi?command=", "39", 0 , 0);
    64                 if(rcret == getrcconfigint("rc6", NULL))
     75                        ohnestop = 1;
     76                }
     77                if(rcret == getrcconfigint("rc6", NULL)) {
    6578                        position = ostrcat("/decoder_control.cgi?command=", "41", 0 , 0);
    66                 if(rcret == getrcconfigint("rc7", NULL))
     79                        ohnestop = 1;
     80                }
     81                if(rcret == getrcconfigint("rc7", NULL)) {
    6782                        position = ostrcat("/decoder_control.cgi?command=", "43", 0 , 0);
    68                 if(rcret == getrcconfigint("rc8", NULL))
     83                        ohnestop = 1;
     84                }
     85                if(rcret == getrcconfigint("rc8", NULL)) {
    6986                        position = ostrcat("/decoder_control.cgi?command=", "45", 0 , 0);
    70                 if(rcret == getrcconfigint("rc9", NULL))
     87                        ohnestop = 1;
     88                }
     89                if(rcret == getrcconfigint("rc9", NULL)) {
    7190                        position = ostrcat("/decoder_control.cgi?command=", "47", 0 , 0);
    72                 if(rcret == getrcconfigint("rcup", NULL))
    73                         position = ostrcat("/decoder_control.cgi?command=", "0&onestep=1", 0 , 0);
    74                 if(rcret == getrcconfigint("rcdown", NULL))
    75                         position = ostrcat("/decoder_control.cgi?command=", "2&onestep=1", 0 , 0);
    76                 if(rcret == getrcconfigint("rcleft", NULL))
    77                         position = ostrcat("/decoder_control.cgi?command=", "4&onestep=1", 0 , 0);
    78                 if(rcret == getrcconfigint("rcright", NULL))
    79                         position = ostrcat("/decoder_control.cgi?command=", "6&onestep=1", 0 , 0);
    80                
    81                
    82                 if(position != NULL && tempcam != NULL)
    83                 {
    84                         tmpstr = ostrcat(tempcam, position, 0, 0);
    85                         system(tmpstr);
    86                         free(tmpstr); tmpstr = NULL;   
    87                         free(position); position = NULL;
     91                        ohnestop = 1;
     92                }
     93                if(positionstop == NULL)
     94                {
     95                        if(rcret == getrcconfigint("rcup", NULL)) {
     96                                position = ostrcat("/decoder_control.cgi?command=", "0", 0 , 0);
     97                                positionstop = ostrcat("/decoder_control.cgi?command=", "1", 0 , 0);
     98                        }
     99                        if(rcret == getrcconfigint("rcdown", NULL)) {
     100                                position = ostrcat("/decoder_control.cgi?command=", "2", 0 , 0);
     101                                positionstop = ostrcat("/decoder_control.cgi?command=", "3", 0 , 0);
     102                        }
     103                        if(rcret == getrcconfigint("rcleft", NULL)) {
     104                                position = ostrcat("/decoder_control.cgi?command=", "4", 0 , 0);
     105                                positionstop = ostrcat("/decoder_control.cgi?command=", "5", 0 , 0);
     106                        }
     107                        if(rcret == getrcconfigint("rcright", NULL)) {
     108                                position = ostrcat("/decoder_control.cgi?command=", "6", 0 , 0);
     109                                positionstop = ostrcat("/decoder_control.cgi?command=", "7", 0 , 0);
     110                        }
     111                        if(rcret == getrcconfigint("rcchup", NULL)) {
     112                                position = ostrcat("/decoder_control.cgi?command=", "16", 0 , 0);
     113                                positionstop = ostrcat("/decoder_control.cgi?command=", "17", 0 , 0);
     114                        }
     115                        if(rcret == getrcconfigint("rcchdown", NULL)) {
     116                                position = ostrcat("/decoder_control.cgi?command=", "18", 0 , 0);
     117                                positionstop = ostrcat("/decoder_control.cgi?command=", "19", 0 , 0);
     118                        }
     119                }
     120               
     121                if(tempcam != NULL && rcret != RCTIMEOUT)
     122                {
     123                        if(positionstop != NULL && ohnestop == 1)
     124                        {
     125                                tmpstr = ostrcat(tempcam, positionstop, 0, 0);
     126                                system(tmpstr);
     127                                free(tmpstr); tmpstr = NULL;   
     128                                free(positionstop); positionstop = NULL;
     129                        }
     130                        if(position != NULL)
     131                        {
     132                                tmpstr = ostrcat(tempcam, position, 0, 0);
     133                                system(tmpstr);
     134                                free(tmpstr); tmpstr = NULL;   
     135                                free(position); position = NULL;
     136                        }
     137                        else if(positionstop != NULL)
     138                        {
     139                                tmpstr = ostrcat(tempcam, positionstop, 0, 0);
     140                                system(tmpstr);
     141                                free(tmpstr); tmpstr = NULL;   
     142                                free(positionstop); positionstop = NULL;
     143                        }
    88144                }
    89145        }
     
    214270                        if(ostrcmp(getlist(myconfig, "InstarCam2", NULL), "ein") == 0)
    215271                        {
    216                                 cam2 = ostrcat("wget --user=", getlist(myconfig, "InstarCam2User", NULL), 0, 0);
    217                                 cam2 = ostrcat(cam2, " --password=",1, 0);
     272                                cam2 = ostrcat("wget --output-document=/tmp/instar2.jpg http://", getlist(myconfig, "InstarCam2User", NULL), 0, 0);
     273                                cam2 = ostrcat(cam2, ":",1, 0);
    218274                                cam2 = ostrcat(cam2, getlist(myconfig, "InstarCam2Pass", NULL), 1, 0);
    219                                 cam2 = ostrcat(cam2, " --output-document=/tmp/instar2.jpg http://",1, 0);
    220                                 cam2 = ostrcat(cam2, fixip(getlist(myconfig, "InstarCam2IP", NULL)), 1, 0);
    221                                 cam2 = ostrcat(cam2, ":", 1, 0);
     275                                cam2 = ostrcat(cam2, "@",1, 0);
     276                                cam2 = ostrcat(cam2, getlist(myconfig, "InstarCam2IP", NULL), 1, 0);
     277                                cam2 = ostrcat(cam2, ":",1, 0);
    222278                                cam2 = ostrcat(cam2, getlist(myconfig, "InstarCam2Port", NULL), 1, 0);
    223279                        }
Note: See TracChangeset for help on using the changeset viewer.