Changeset 41090
- Timestamp:
- 11/01/17 21:19:31 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/frontenddev.h
r41088 r41090 304 304 return(dvbnode); 305 305 } 306 } 307 dvbnode = dvbnode->next; 308 } 309 if(dvbfirst != NULL) 310 dvbnode = dvbfirst; 311 else 312 dvbnode = dvbdev; 313 314 //suche tuner der die gewuenschte orbitalpos kann und belegt ist und dessen looptuner es kann 315 while(dvbnode != NULL) 316 { 317 //FRONTENDDEV first in the list 318 if(dvbnode->type != FRONTENDDEV) break; 319 320 //check if tuner is deactivate 321 if(dvbnode->deactive == 1) 322 { 323 dvbnode = dvbnode->next; 324 continue; 325 } 326 if(dvbnode->type == FRONTENDDEV && dvbnode->feinfo->type == tpnode->fetype && dvbnode->felock != 0) 327 { 328 if(flag == 2 && status.aktservice->fedev == dvbnode) 329 { 330 dvbnode = dvbnode->next; 331 continue; 332 } 333 //check if tuner is main tuner 334 if(getconfig(dvbnode->feshortname, NULL) != NULL) 335 { 336 dvbnode = dvbnode->next; 337 continue; 338 } 339 if(dvbnode->feaktpolarization != tpnode->polarization || dvbnode->feakttransponder->orbitalpos != tpnode->orbitalpos) 340 { 341 dvbnode = dvbnode->next; 342 continue; 343 } 344 found = 0; 345 //check looptuner is free 346 tmpstr = getconfigbyval(dvbnode->feshortname, NULL); 347 CharPtrTmp[0] = NULL; 348 while(tmpstr != NULL) //found loop tuner 349 { 350 tmpdvbnode = fegetbyshortname(tmpstr); 351 //if(flag != 1) printf("****** test tuner1 %s -> %s\n", dvbnode->feshortname, tmpdvbnode->feshortname); 352 if(tmpdvbnode != NULL && tmpdvbnode->felock == 0) 353 { 354 found = 99; 355 break; 356 } 357 else 358 { 359 CharPtrTmp[found] = tmpdvbnode; 360 found = found + 1; 361 } 362 tmpstr = getconfigbyval(tmpstr, NULL); //loop tuner also loop ? 363 } 364 CharPtrTmp[0] = NULL; 365 if(found != 99) 366 { 367 dvbnode = dvbnode->next; 368 continue; 369 } 370 tmpstr = ostrcat(dvbnode->feshortname, "_sat", 0, 0); 371 for(i = 1; i <= getmaxsat(dvbnode->feshortname); i++) 372 { 373 tmpnr = oitoa(i); 374 orbitalpos = getconfigint(tmpstr, tmpnr); 375 if(orbitalpos == tpnode->orbitalpos) 376 { 377 fegetconfig(dvbnode, tpnode, &aktnr, tmpnr); 378 if(flag == 3) 379 band = calclof(dvbnode, tpnode, aktnr, 0); 380 else 381 band = calclof(dvbnode, tpnode, aktnr, 1); 382 found = 0; 383 if(tmpdvbnode != NULL && tmpdvbnode->feaktband != band) 384 { 385 found = -1; 386 break; 387 } 388 389 if(flag == 1) 390 { 391 free(tmpstr); tmpstr = NULL; 392 free(tmpnr); tmpnr = NULL; 393 return tmpdvbnode; 394 } 395 dvbnode->feaktband = band; 396 dvbnode->feaktpolarization = tpnode->polarization; 397 398 tmpdvbnode->felasttransponder = tmpdvbnode->feakttransponder; 399 tmpdvbnode->feakttransponder = tpnode; 400 tmpdvbnode->feaktpolarization = tpnode->polarization; 401 free(tmpdvbnode->feaktnr); 402 if(aktnr != NULL) 403 tmpdvbnode->feaktnr = ostrcat(aktnr, NULL, 0, 0); 404 else 405 tmpdvbnode->feaktnr = NULL; 406 407 free(tmpstr); tmpstr = NULL; 408 free(tmpnr); tmpnr = NULL; 409 if(flag != 1) debug(200, "found free tuner witch same orbitalpos %s", dvbnode->feshortname); 410 if(flag != 1) printf("------ found free loop tuner: %s witch same orbitalpos main tuner: %s\n", tmpdvbnode->feshortname, dvbnode->feshortname); 411 return tmpdvbnode; 412 } 413 free(tmpnr); tmpnr = NULL; 414 } 415 free(tmpstr); tmpstr = NULL; 416 if(found == -1) 417 break; 306 418 } 307 419 dvbnode = dvbnode->next; … … 406 518 return dvbnode; 407 519 } 408 if(tmpdvbnode != NULL) 520 521 found = 0; 522 while(CharPtrTmp[found] != NULL) 409 523 { 410 tmpdvbnode->feaktband = band; 411 tmpdvbnode->feaktpolarization = tpnode->polarization; 524 CharPtrTmp[found]->feaktband = band; 525 CharPtrTmp[found]->feaktpolarization = tpnode->polarization; 526 found = found + 1; 412 527 } 528 //if(tmpdvbnode != NULL) 529 //{ 530 // tmpdvbnode->feaktband = band; 531 // tmpdvbnode->feaktpolarization = tpnode->polarization; 532 //} 413 533 dvbnode->felasttransponder = dvbnode->feakttransponder; 414 534 dvbnode->feakttransponder = tpnode; … … 553 673 return dvbnode; 554 674 } 555 if(tmpdvbnode != NULL) 675 found = 0; 676 while(CharPtrTmp[found] != NULL) 556 677 { 557 tmpdvbnode->feaktband = band; 558 tmpdvbnode->feaktpolarization = tpnode->polarization; 678 CharPtrTmp[found]->feaktband = band; 679 CharPtrTmp[found]->feaktpolarization = tpnode->polarization; 680 found = found + 1; 559 681 } 682 //if(tmpdvbnode != NULL) 683 //{ 684 // tmpdvbnode->feaktband = band; 685 // tmpdvbnode->feaktpolarization = tpnode->polarization; 686 //} 560 687 dvbnode->felasttransponder = dvbnode->feakttransponder; 561 688 dvbnode->feakttransponder = tpnode; … … 2221 2348 { 2222 2349 err("FE_SET_PROPERTY failed -> use procfs to switch delivery system tuner %d mode %s type %d",tuner->devnr ,value, type); 2350 } 2223 2351 hypridtuner = getconfig("hypridtuner", NULL); 2224 2352 if(hypridtuner != NULL) … … 2247 2375 free(buf); buf = NULL; 2248 2376 return 1; //true 2249 }2377 2250 2378 return 0; //true 2251 2379
Note: See TracChangeset
for help on using the changeset viewer.