C-Netz: Autoselect polarity on all transceivers

This commit is contained in:
Andreas Eversberg
2016-08-01 09:25:33 +02:00
parent 77cd21e7c2
commit b84a64f872

View File

@@ -1505,15 +1505,23 @@ void cnetz_decode_telegramm(cnetz_t *cnetz, const char *bits, double level, doub
/* auto select cell */ /* auto select cell */
if (cnetz->cell_auto) { if (cnetz->cell_auto) {
if (!match_fuz(cnetz, &telegramm, 0)) { sender_t *sender;
cnetz->cell_nr = 1; cnetz_t *c;
int nr;
if (match_fuz(cnetz, &telegramm, 0)) {
nr = 0;
selected: selected:
cnetz->cell_auto = 0;
printf("***********************************************\n"); printf("***********************************************\n");
printf("*** Autoselecting %stive FSK TX polarity! ***\n", (si[cnetz->cell_nr].flip_polarity) ? "nega" : "posi"); printf("*** Autoselecting %stive FSK TX polarity! ***\n", (si[nr].flip_polarity) ? "nega" : "posi");
printf("***********************************************\n"); printf("***********************************************\n");
} else if (!match_fuz(cnetz, &telegramm, 1)) { /* select on all transceivers */
cnetz->cell_nr = 0; for (sender = sender_head; sender; sender = sender->next) {
c = (cnetz_t *) sender;
c->cell_auto = 0;
c->cell_nr = nr;
}
} else if (match_fuz(cnetz, &telegramm, 1)) {
nr = 1;
goto selected; goto selected;
} else { } else {
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm with no cell number, ignoring!\n"); PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm with no cell number, ignoring!\n");