Changeset 42191


Ignore:
Timestamp:
04/27/18 17:47:39 (5 years ago)
Author:
gost
Message:

[titan] test unicable2

Location:
titan/titan
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/frontenddev.h

    r41930 r42191  
    111111        }
    112112
     113        node->feloffrequency_uni = 0;
     114       
    113115        if(satcrfrequ == 0)
    114116        {
     
    125127        else
    126128        {
    127                 int lof = (node->feaktband & 1) ? lofh : lofl;
    128                 unsigned int tmp = (frequency - lof) + satcrfrequ;
    129                 node->feloffrequency = (tmp / 4) - 350000;
    130                 node->feunicable = 1;
    131         }
    132 
    133         debug(200, "tuning to freq %d (befor lof %d), band=%d, unicable=%d", node->feloffrequency, frequency, node->feaktband, node->feunicable);
     129                tmpstr = ostrcat(node->feshortname, "_lnb_satcr", 0, 0);
     130                int satcr = getconfigint(tmpstr, node->feaktnr) - 1;
     131                free(tmpstr); tmpstr = NULL;
     132                if(satcr < 8)
     133                {
     134                        int lof = (node->feaktband & 1) ? lofh : lofl;
     135                        unsigned int tmp = (frequency - lof) + satcrfrequ;
     136                        node->feloffrequency = (tmp / 4) - 350000;
     137                        node->feunicable = 1;
     138                }
     139                else
     140                {
     141                        int lof = (node->feaktband & 1) ? lofh : lofl;
     142                        unsigned int tmp = (frequency - lof) - 100000;
     143                        node->feloffrequency = (1000 + 2 * tmp) / (2 *1000); //round to multiple of 1000
     144                        node->feloffrequency_uni = frequency - lof -(satcrfrequ - (satcrfrequ - (tmp - (1000 * node->feloffrequency))));
     145                        node->feunicable = 1;
     146                }
     147        }
     148
     149        debug(200, "tuning to freq %d (befor lof %d), band=%d, unicable=%d unicableoff=%d", node->feloffrequency, frequency, node->feaktband, node->feunicable, node->feloffrequency_uni);
    134150        return node->feaktband;
    135151}
     
    11801196        free(tmpstr); tmpstr = NULL;
    11811197
    1182         unicabletune |= ((satcr & 0x7) << 13);
    1183         unicabletune |= (((aktdiseqc - 1) & 0x1) << 12);
    1184         unicabletune |= (((!node->feaktpolarization) & 0x1) << 11);
    1185         unicabletune |= ((node->feaktband & 0x1) << 10);
    1186         unicabletune |= ((node->feloffrequency / 1000) & 0x3ff);
    1187 
    1188         debug(200, "unicabletune %04X", unicabletune);
    1189        
    1190         if(status.firstunicablewait == 0)
    1191         {
    1192                 status.firstunicablewait = getconfigint("firstunicablewait", NULL);
     1198        if(satcr < 8)
     1199        {
     1200                int unicabletune = 0;
     1201
     1202                unicabletune |= ((satcr & 0x7) << 13);
     1203                unicabletune |= (((aktdiseqc - 1) & 0x1) << 12);
     1204                unicabletune |= (((!node->feaktpolarization) & 0x1) << 11);
     1205                unicabletune |= ((node->feaktband & 0x1) << 10);
     1206                unicabletune |= ((node->feloffrequency / 1000) & 0x3ff);
     1207
     1208                debug(200, "unicabletune %04X", unicabletune);
     1209       
    11931210                if(status.firstunicablewait == 0)
    1194                         status.firstunicablewait = 1000;
    1195         }               
    1196        
    1197         if(status.firstunicablewait > 0)
    1198         {
    1199                 usleep(status.firstunicablewait * 1000);
    1200                 status.firstunicablewait = -1;
    1201         }
    1202        
    1203         fesetvoltage(node, SEC_VOLTAGE_13, 15);
    1204         fesetvoltage(node, SEC_VOLTAGE_18, 15);
    1205         fesettone(node, SEC_TONE_OFF, 15);
    1206 
    1207         //feunicable
    1208         //byte1 (bit 7/6/5) -> satcr number
    1209         //byte1 (bit 4/3/2) -> lnb number
    1210         //byte1 (bit 1/0) -> frequ
    1211         //byte0 -> frequ
    1212        
    1213         cmd.msg[0] = 0xE0;
    1214         cmd.msg[1] = 0x10;
    1215         cmd.msg[2] = 0x5A;
    1216         cmd.msg[3] = (unicabletune >> 8) & 0xff;
    1217         cmd.msg[4] = unicabletune & 0xff;
    1218         cmd.msg_len = 5;
     1211                {
     1212                        status.firstunicablewait = getconfigint("firstunicablewait", NULL);
     1213                        if(status.firstunicablewait == 0)
     1214                                status.firstunicablewait = 1000;
     1215                }               
     1216       
     1217                if(status.firstunicablewait > 0)
     1218                {
     1219                        usleep(status.firstunicablewait * 1000);
     1220                        status.firstunicablewait = -1;
     1221                }
     1222       
     1223                fesetvoltage(node, SEC_VOLTAGE_13, 15);
     1224                fesetvoltage(node, SEC_VOLTAGE_18, 15);
     1225                fesettone(node, SEC_TONE_OFF, 15);
     1226
     1227                //feunicable
     1228                //byte1 (bit 7/6/5) -> satcr number
     1229                //byte1 (bit 4/3/2) -> lnb number
     1230                //byte1 (bit 1/0) -> frequ
     1231                //byte0 -> frequ
     1232       
     1233                cmd.msg[0] = 0xE0;
     1234                cmd.msg[1] = 0x10;
     1235                cmd.msg[2] = 0x5A;
     1236                cmd.msg[3] = (unicabletune >> 8) & 0xff;
     1237                cmd.msg[4] = unicabletune & 0xff;
     1238                cmd.msg_len = 5;
     1239        }
     1240        else
     1241        {
     1242                uint64_t unicabletune = 0;
     1243
     1244                unicabletune |= ((satcr & 0x1F) << 19);
     1245                unicabletune |= (((node->feloffrequency / 1000) & 0x7ff) << 8);
     1246                unicabletune |= (((aktdiseqc - 1) & 0x1) << 2);
     1247                unicabletune |= (((!node->feaktpolarization) & 0x1) << 1);
     1248                unicabletune |= (node->feaktband & 0x1);
     1249               
     1250                debug(200, "unicabletune %04X", unicabletune);
     1251       
     1252                if(status.firstunicablewait == 0)
     1253                {
     1254                        status.firstunicablewait = getconfigint("firstunicablewait", NULL);
     1255                        if(status.firstunicablewait == 0)
     1256                                status.firstunicablewait = 1000;
     1257                }               
     1258       
     1259                if(status.firstunicablewait > 0)
     1260                {
     1261                        usleep(status.firstunicablewait * 1000);
     1262                        status.firstunicablewait = -1;
     1263                }
     1264       
     1265                fesetvoltage(node, SEC_VOLTAGE_13, 15);
     1266                fesetvoltage(node, SEC_VOLTAGE_18, 15);
     1267                fesettone(node, SEC_TONE_OFF, 15);
     1268
     1269                //feunicable 2
     1270                //byte2 (bit 7/6/5/4/3) -> satcr number
     1271                //byte2 (bit 2/1/0) -> frequ
     1272                //byte1 -> frequ
     1273                //byte0 (bit 3/1/0) -> lnb number
     1274               
     1275                cmd.msg[0] = 0x70;
     1276                cmd.msg[1] = (unicabletune >> 16) & 0xff;
     1277                cmd.msg[2] = (unicabletune >> 8) & 0xff;
     1278                cmd.msg[3] = unicabletune & 0xff;
     1279                cmd.msg_len = 4;
     1280        }       
    12191281
    12201282        debug(200, "send diseqc unicable cmd (%s)", node->feshortname);
     
    17511813        {
    17521814                fesetunicable(node);
    1753                 char* tmpstr = ostrcat(node->feshortname, "_lnb_satcrfrequ", 0, 0);
    1754                 node->feloffrequency = getconfigint(tmpstr, node->feaktnr) * 1000;
    1755                 free(tmpstr); tmpstr = NULL;
     1815                if(node->feloffrequency_uni == 0)
     1816                {
     1817                        char* tmpstr = ostrcat(node->feshortname, "_lnb_satcrfrequ", 0, 0);
     1818                        node->feloffrequency = getconfigint(tmpstr, node->feaktnr) * 1000;
     1819                        free(tmpstr); tmpstr = NULL;
     1820          }
     1821          else
     1822                node->feloffrequency = node->feloffrequency_uni;
    17561823        }
    17571824
  • titan/titan/lnbconfig.h

    r18302 r42191  
    160160        addchoicebox(satcr, "7", "7");
    161161        addchoicebox(satcr, "8", "8");
     162       
     163        addchoicebox(satcr, "9", "9");
     164        addchoicebox(satcr, "10", "10");
     165        addchoicebox(satcr, "11", "11");
     166        addchoicebox(satcr, "12", "12");
     167        addchoicebox(satcr, "13", "13");
     168        addchoicebox(satcr, "14", "14");
     169        addchoicebox(satcr, "15", "15");
     170        addchoicebox(satcr, "16", "16");
     171        addchoicebox(satcr, "17", "17");
     172        addchoicebox(satcr, "18", "18");
     173       
    162174
    163175        changeinput(satcrfrequ1, NULL);
    164         addchoicebox(satcrfrequ1, "1284", "1284");
     176        /*addchoicebox(satcrfrequ1, "1284", "1284");
    165177        addchoicebox(satcrfrequ1, "1400", "1400");
    166178        addchoicebox(satcrfrequ1, "1516", "1516");
     
    169181        addchoicebox(satcrfrequ1, "1864", "1864");
    170182        addchoicebox(satcrfrequ1, "1980", "1980");
    171         addchoicebox(satcrfrequ1, "2096", "2096");
     183        addchoicebox(satcrfrequ1, "2096", "2096");*/
     184       
     185        addchoicebox(satcrfrequ1, "984", "984");
     186        addchoicebox(satcrfrequ1, "1020", "1020");
     187        addchoicebox(satcrfrequ1, "1056", "1056");
     188        addchoicebox(satcrfrequ1, "1092", "1092");
     189        addchoicebox(satcrfrequ1, "1210", "1210");
     190        addchoicebox(satcrfrequ1, "1420", "1420");
     191        addchoicebox(satcrfrequ1, "1680", "1680");
     192        addchoicebox(satcrfrequ1, "2040", "2040");
     193       
     194        addchoicebox(satcrfrequ1, "1128", "1128");
     195        addchoicebox(satcrfrequ1, "1164", "1164");
     196        addchoicebox(satcrfrequ1, "1256", "1256");
     197        addchoicebox(satcrfrequ1, "1292", "1292");
     198        addchoicebox(satcrfrequ1, "1328", "1328");
     199        addchoicebox(satcrfrequ1, "1364", "1364");
     200        addchoicebox(satcrfrequ1, "1458", "1458");
     201        addchoicebox(satcrfrequ1, "1494", "1494");
     202        addchoicebox(satcrfrequ1, "1530", "1530");
     203        addchoicebox(satcrfrequ1, "1566", "1566");
     204       
     205
     206       
     207       
    172208
    173209        changelnb(voltagemode, tonemode, loftype, lofl, lofh, threshold, satcr, satcrfrequ1, satcrfrequ2, feshortname, lnbnr);
  • titan/titan/struct.h

    r42129 r42191  
    10851085        int feunicable;
    10861086        unsigned int feloffrequency;
     1087        unsigned int feloffrequency_uni;
    10871088        int feaktband;
    10881089        int feaktpolarization;
Note: See TracChangeset for help on using the changeset viewer.