Changeset 20480


Ignore:
Timestamp:
03/12/13 21:11:34 (11 years ago)
Author:
nit
Message:

[titan] extend webif

Location:
titan/titan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/httpd.h

    r20407 r20480  
    148148                *param++ = '\0';
    149149
    150         if(ostrcmp(query, "getsysteminfo") == 0)
     150        if(ostrcmp(query, "getchannellock") == 0)
     151                buf = webgetchannellock(param, fmt);
     152        else if(ostrcmp(query, "getsysteminfo") == 0)
    151153                buf = webgetsysteminfo(fmt);
    152         if(ostrcmp(query, "getrccodes") == 0)
     154        else if(ostrcmp(query, "getrccodes") == 0)
    153155                buf = webgetrccodes(fmt);
    154         if(ostrcmp(query, "getmute") == 0)
     156        else if(ostrcmp(query, "getmute") == 0)
    155157                buf = webgetmute(fmt);
    156         if(ostrcmp(query, "getvol") == 0)
     158        else if(ostrcmp(query, "getvol") == 0)
    157159                buf = webgetvol(fmt);
    158         if(ostrcmp(query, "sendrc") == 0)
     160        else if(ostrcmp(query, "sendrc") == 0)
    159161                websendrc(param, fmt);
    160         if(ostrcmp(query, "getrectimer") == 0)
     162        else if(ostrcmp(query, "getrectimer") == 0)
    161163                buf = webgetrectimer(param, 0, fmt);
    162         if(ostrcmp(query, "addrectimer") == 0)
     164        else if(ostrcmp(query, "addrectimer") == 0)
    163165                buf = webaddrectimer(param, fmt);
    164         if(ostrcmp(query, "delrectimer") == 0)
     166        else if(ostrcmp(query, "delrectimer") == 0)
    165167                buf = webdelrectimer(param, fmt);
    166         if(ostrcmp(query, "editrectimer") == 0)
     168        else if(ostrcmp(query, "editrectimer") == 0)
    167169                buf = webeditrectimer(param, fmt);
    168         if(ostrcmp(query, "rectimersend") == 0)
     170        else if(ostrcmp(query, "rectimersend") == 0)
    169171                buf = webrectimersend(param, fmt);
    170         if(ostrcmp(query, "getrectimerarchive") == 0)
     172        else if(ostrcmp(query, "getrectimerarchive") == 0)
    171173                buf = webgetrectimer(param, 1, fmt);
    172         if(ostrcmp(query, "setvol") == 0)
     174        else if(ostrcmp(query, "setvol") == 0)
    173175                buf = websetvol(param, fmt);
    174         if(ostrcmp(query, "setmute") == 0)
     176        else if(ostrcmp(query, "setmute") == 0)
    175177                buf = websetmute(param, fmt);
    176         if(ostrcmp(query, "getbouquet") == 0)
     178        else if(ostrcmp(query, "getbouquet") == 0)
    177179                buf = webgetbouquet(fmt);
    178         if(ostrcmp(query, "getsat") == 0)
     180        else if(ostrcmp(query, "getsat") == 0)
    179181                buf = webgetsat(fmt);
    180         if(ostrcmp(query, "getprovider") == 0)
     182        else if(ostrcmp(query, "getprovider") == 0)
    181183                buf = webgetprovider(fmt);
    182         if(ostrcmp(query, "getaz") == 0)
     184        else if(ostrcmp(query, "getaz") == 0)
    183185                buf = webgetaz(fmt);
    184         if(ostrcmp(query, "getconfig") == 0)
     186        else if(ostrcmp(query, "getconfig") == 0)
    185187                buf = webgetconfig(fmt);
    186         if(ostrcmp(query, "getchannelpage") == 0)
     188        else if(ostrcmp(query, "getchannelpage") == 0)
    187189                buf = webgetchannelpage(param, fmt);
    188         if(ostrcmp(query, "getallchannel") == 0)
     190        else if(ostrcmp(query, "getallchannel") == 0)
    189191                buf = webgetchannel(0, 0, 1, fmt);
    190         if(ostrcmp(query, "getbouquetchannel") == 0)
     192        else if(ostrcmp(query, "getbouquetchannel") == 0)
    191193                buf = webgetbouquetchannel(param, fmt);
    192         if(ostrcmp(query, "getsatchannel") == 0 && param != NULL)
     194        else if(ostrcmp(query, "getsatchannel") == 0 && param != NULL)
    193195                buf = webgetchannel(atoi(param), 1, 1, fmt);
    194         if(ostrcmp(query, "getproviderchannel") == 0 && param != NULL)
     196        else if(ostrcmp(query, "getproviderchannel") == 0 && param != NULL)
    195197                buf = webgetchannel(atoi(param), 2, 1, fmt);
    196         if(ostrcmp(query, "getazchannel") == 0 && param != NULL)
     198        else if(ostrcmp(query, "getazchannel") == 0 && param != NULL)
    197199                buf = webgetchannel(atoi(param), 3, 1, fmt);
    198         if(ostrcmp(query, "switch") == 0)
     200        else if(ostrcmp(query, "switch") == 0)
    199201                buf = webswitch(param, fmt);
    200         if(ostrcmp(query, "getaktservice") == 0)
     202        else if(ostrcmp(query, "getaktservice") == 0)
    201203                buf = webgetaktservice(fmt);
    202         if(ostrcmp(query, "getservice") == 0)
     204        else if(ostrcmp(query, "getservice") == 0)
    203205                buf = webgetservice(param, fmt);
    204         if(ostrcmp(query, "getepg") == 0)
     206        else if(ostrcmp(query, "getepg") == 0)
    205207                buf = webgetepg(param, fmt);
    206         if(ostrcmp(query, "getmovieepg") == 0)
     208        else if(ostrcmp(query, "getmovieepg") == 0)
    207209                buf = webgetmovieepg(param, getconfig("rec_streampath", NULL), 1, fmt);
    208         if(ostrcmp(query, "getsingleepg") == 0)
     210        else if(ostrcmp(query, "getsingleepg") == 0)
    209211                buf = webgetsingleepg(param, fmt);
    210         if(ostrcmp(query, "getgmultiepg") == 0)
     212        else if(ostrcmp(query, "getgmultiepg") == 0)
    211213                buf = webgetgmultiepg(param, fmt);
    212         if(query != NULL && ostrstr(query, "getepgsearch") == query)
     214        else if(query != NULL && ostrstr(query, "getepgsearch") == query)
    213215                buf = webgetepgsearch(query, param, fmt);
    214         if(ostrcmp(query, "getsignal") == 0)
     216        else if(ostrcmp(query, "getsignal") == 0)
    215217                buf = webgetsignal(fmt);
    216         if(ostrcmp(query, "getmoviefilelist") == 0)
     218        else if(ostrcmp(query, "getmoviefilelist") == 0)
    217219                buf = webgetfilelist(param, "getmoviefilelist", "delmoviefile", getconfig("rec_streampath", NULL), "*.avi *.dat *.divx *.flv *.mkv *.m4v *.mp4 *.mov *.mpg *.mpeg *.mts *.m2ts *.trp *.ts *.vdr *.vob *.wmv *.rm", 31, fmt);
    218         if(ostrcmp(query, "delmoviefile") == 0)
     220        else if(ostrcmp(query, "delmoviefile") == 0)
    219221                buf = webdelfile(param, "getmoviefilelist", "delmoviefile", getconfig("rec_streampath", NULL), "*.avi *.dat *.divx *.flv *.mkv *.m4v *.mp4 *.mov *.mpg *.mpeg *.mts *.m2ts *.trp *.ts *.vdr *.vob *.wmv *.rm", 31, fmt);
    220         if(ostrcmp(query, "getm3u") == 0)
     222        else if(ostrcmp(query, "getm3u") == 0)
    221223        {
    222224                buf = webgetm3u(param, *connfd, fmt);
     
    227229                }
    228230        }
    229         if(ostrcmp(query, "getvideo") == 0)
     231        else if(ostrcmp(query, "getvideo") == 0)
    230232                buf = webgetvideo(param, *connfd, fmt);
    231   if(ostrcmp(query, "videoplay") == 0 || ostrcmp(query, "videoplay=") == 0)
     233  else if(ostrcmp(query, "videoplay") == 0 || ostrcmp(query, "videoplay=") == 0)
    232234                buf = webvideo(param, fmt);
    233         if(ostrcmp(query, "getshoot") == 0)
     235        else if(ostrcmp(query, "getshoot") == 0)
    234236        {
    235237                webgetshoot(param, fmt);
     
    243245                        buf = ostrcat("shoot.html", NULL, 0, 0);
    244246        }
    245         if(query != NULL && ostrstr(query, "poweroff") == query)
     247        else if(query != NULL && ostrstr(query, "poweroff") == query)
    246248                oshutdown(1, 1);
    247         if(query != NULL && ostrstr(query, "restart") == query)
     249        else if(query != NULL && ostrstr(query, "restart") == query)
    248250                oshutdown(2, 1);
    249         if(query != NULL && ostrstr(query, "guirestart") == query)
     251        else if(query != NULL && ostrstr(query, "guirestart") == query)
    250252                oshutdown(3, 1);
    251         if(query != NULL && ostrstr(query, "standby") == query)
     253        else if(query != NULL && ostrstr(query, "standby") == query)
    252254        {
    253255                status.standby = 2;
    254256                addtimer(&screenstandby, START, 1000, 1, NULL, NULL, NULL);
    255257        }
    256         if(query != NULL && ostrstr(query, "boxstatus") == query)
     258        else if(query != NULL && ostrstr(query, "boxstatus") == query)
    257259        {
    258260                if(status.standby > 0)
     
    271273                }
    272274        }
    273         if(query != NULL && ostrstr(query, "mutestatus") == query)
     275        else if(query != NULL && ostrstr(query, "mutestatus") == query)
    274276        {
    275277                if(status.mute > 0)
     
    288290                }
    289291        }
    290         if(query != NULL && ostrstr(query, "message") == query)
     292        else if(query != NULL && ostrstr(query, "message") == query)
    291293                buf = websendmessage(query, fmt);
    292294               
  • titan/titan/httpdfunc.h

    r20479 r20480  
    29282928}
    29292929
     2930char* webgetchannellock(char* param, int fmt)
     2931{
     2932        char* buf = NULL, *param1 = NULL;
     2933        struct channel* chnode = NULL;
     2934
     2935        if(param == NULL) return NULL;
     2936
     2937        //create param1
     2938        param1 = strchr(param, '&');
     2939        if(param1 != NULL)
     2940                *param1++ = '\0';
     2941
     2942        if(param1 == NULL) return NULL;
     2943
     2944        chnode = getchannel(atoi(param), strtoull(param1, NULL, 10));
     2945        if(chnode != NULL)
     2946        {
     2947                buf = ostrcat(buf, chnode->name, 1, 0);
     2948                buf = ostrcat(buf, "#", 1, 0);
     2949                buf = ostrcat(buf, atoi(chnode->serviceid), 1, 1);
     2950                buf = ostrcat(buf, "#", 1, 0);
     2951                buf = ostrcat(buf, strtoull(chnode->transponderid, NULL, 10), 1, 1);
     2952                buf = ostrcat(buf, "#", 1, 0);
     2953
     2954                if(channelnottunable(chnode) == 1)
     2955                        buf = ostrcat(buf, "1", 1, 0);
     2956                else
     2957                        buf = ostrcat(buf, "0", 1, 0);
     2958        }
     2959        else
     2960                buf = ostrcat("no data", NULL, 0, 0);
     2961
     2962        return buf;
     2963}
     2964
    29302965#endif
Note: See TracChangeset for help on using the changeset viewer.