C-Netz: Added option to define time slots of OgK
This commit is contained in:
parent
f468b2dd9f
commit
ff498d10e1
|
@ -677,11 +677,11 @@ again:
|
||||||
if (cnetz->auto_polarity)
|
if (cnetz->auto_polarity)
|
||||||
cnetz->negative_polarity = (cnetz->sched_ts & 7) >> 2;
|
cnetz->negative_polarity = (cnetz->sched_ts & 7) >> 2;
|
||||||
/* send on timeslots depending on the polarity:
|
/* send on timeslots depending on the polarity:
|
||||||
* positive polarity: 0, 8, 16, 24
|
* positive polarity: ts, ts+8, ts+16, ts+24
|
||||||
* negative polarity: 4, 12, 20, 28
|
* negative polarity: ts+4, ts+12, ts+20, ts+28
|
||||||
*/
|
*/
|
||||||
if (((cnetz->sched_ts & 7) == 0 && cnetz->negative_polarity == 0)
|
if (((cnetz->sched_ts & 7) == (si.timeslot & 7) && cnetz->negative_polarity == 0)
|
||||||
|| ((cnetz->sched_ts & 7) == 4 && cnetz->negative_polarity == 1)) {
|
|| ((cnetz->sched_ts & 7) == ((si.timeslot + 4) & 7) && cnetz->negative_polarity == 1)) {
|
||||||
if (cnetz->sched_r_m == 0) {
|
if (cnetz->sched_r_m == 0) {
|
||||||
/* set last time slot, so we know to which time slot the message from mobile station belongs to */
|
/* set last time slot, so we know to which time slot the message from mobile station belongs to */
|
||||||
cnetz->sched_last_ts = cnetz->sched_ts;
|
cnetz->sched_last_ts = cnetz->sched_ts;
|
||||||
|
|
|
@ -51,6 +51,7 @@ int challenge_valid;
|
||||||
uint64_t challenge;
|
uint64_t challenge;
|
||||||
int response_valid;
|
int response_valid;
|
||||||
uint64_t response;
|
uint64_t response;
|
||||||
|
uint8_t timeslot = 0;
|
||||||
uint8_t fuz_nat = 1;
|
uint8_t fuz_nat = 1;
|
||||||
uint8_t fuz_fuvst = 4;
|
uint8_t fuz_fuvst = 4;
|
||||||
uint8_t fuz_rest = 66;
|
uint8_t fuz_rest = 66;
|
||||||
|
@ -120,6 +121,11 @@ void print_help(const char *arg0)
|
||||||
printf(" It is unclear what the actual voice deviation is. Please decrease, if\n");
|
printf(" It is unclear what the actual voice deviation is. Please decrease, if\n");
|
||||||
printf(" mobile's microphone is too loud and speaker is too quiet.\n");
|
printf(" mobile's microphone is too loud and speaker is too quiet.\n");
|
||||||
printf(" (default = %.0f)\n", speech_deviation);
|
printf(" (default = %.0f)\n", speech_deviation);
|
||||||
|
printf(" -S --sysinfo timeslot=<0..31>\n");
|
||||||
|
printf(" Set time slot of OgK broadcast. There are 32 time slots, but every 8th\n");
|
||||||
|
printf(" slot is used. This means if you select time slot 0, also slots 8, 16\n");
|
||||||
|
printf(" and 24 will be used. If you select slot 14, also slots 6, 22 and 30\n");
|
||||||
|
printf(" will be used. (default = %d)\n", timeslot);
|
||||||
printf(" -S --sysinfo fuz-nat=<nat>\n");
|
printf(" -S --sysinfo fuz-nat=<nat>\n");
|
||||||
printf(" Set country ID of base station. All IDs were used inside Germany only.\n");
|
printf(" Set country ID of base station. All IDs were used inside Germany only.\n");
|
||||||
printf(" (default = %d)\n", fuz_nat);
|
printf(" (default = %d)\n", fuz_nat);
|
||||||
|
@ -139,10 +145,10 @@ void print_help(const char *arg0)
|
||||||
printf(" 2 = Higher priority base station.\n");
|
printf(" 2 = Higher priority base station.\n");
|
||||||
printf(" 3 = Highest priority base station.\n");
|
printf(" 3 = Highest priority base station.\n");
|
||||||
printf(" Note: Priority has no effect, because there is only one base station.\n");
|
printf(" Note: Priority has no effect, because there is only one base station.\n");
|
||||||
printf(" -A --sysinfo authentifikationsbit=auth>\n");
|
printf(" -S --sysinfo auth=<auth>\n");
|
||||||
printf(" Enable authentication flag on the base station. Since we cannot\n");
|
printf(" Enable authentication flag on the base station. Since we cannot\n");
|
||||||
printf(" authenticate, because we don't know the secret key and the algorithm,\n");
|
printf(" authenticate, because we don't know the secret key and the algorithm,\n");
|
||||||
printf(" we just accept any card. Useful get the vendor IDs of the phone.\n");
|
printf(" we just accept any card. Useful to get the vendor IDs of the phone.\n");
|
||||||
printf(" 0 = Disable. Even chip card phones behave like magnetic card phones.\n");
|
printf(" 0 = Disable. Even chip card phones behave like magnetic card phones.\n");
|
||||||
printf(" 1 = Enable. Chip card phones send their card ID.\n");
|
printf(" 1 = Enable. Chip card phones send their card ID.\n");
|
||||||
printf(" (default = %d)\n", authentifikationsbit);
|
printf(" (default = %d)\n", authentifikationsbit);
|
||||||
|
@ -341,6 +347,9 @@ static int handle_options(int short_option, int argi, char **argv)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
p++;
|
p++;
|
||||||
|
if (!strncasecmp(argv[argi], "timeslot=", p - argv[argi])) {
|
||||||
|
timeslot = atoi_limit(p, 0, 31);
|
||||||
|
} else
|
||||||
if (!strncasecmp(argv[argi], "fuz-nat=", p - argv[argi])) {
|
if (!strncasecmp(argv[argi], "fuz-nat=", p - argv[argi])) {
|
||||||
fuz_nat = atoi_limit(p, 0, 7);
|
fuz_nat = atoi_limit(p, 0, 7);
|
||||||
} else
|
} else
|
||||||
|
@ -556,7 +565,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
if (anzahl_gesperrter_teilnehmergruppen)
|
if (anzahl_gesperrter_teilnehmergruppen)
|
||||||
printf("Blocked subscriber with number's last 4 bits from 0x%x to 0x%x\n", teilnehmergruppensperre, (teilnehmergruppensperre + anzahl_gesperrter_teilnehmergruppen - 1) & 0xf);
|
printf("Blocked subscriber with number's last 4 bits from 0x%x to 0x%x\n", teilnehmergruppensperre, (teilnehmergruppensperre + anzahl_gesperrter_teilnehmergruppen - 1) & 0xf);
|
||||||
init_sysinfo(fuz_nat, fuz_fuvst, fuz_rest, kennung_fufst, authentifikationsbit, ws_kennung, fuvst_sperren, grenz_einbuchen, grenz_umschalten, grenz_ausloesen, mittel_umschalten, mittel_ausloesen, genauigkeit, bewertung, entfernung, reduzierung, nachbar_prio, teilnehmergruppensperre, anzahl_gesperrter_teilnehmergruppen);
|
init_sysinfo(timeslot, fuz_nat, fuz_fuvst, fuz_rest, kennung_fufst, authentifikationsbit, ws_kennung, fuvst_sperren, grenz_einbuchen, grenz_umschalten, grenz_ausloesen, mittel_umschalten, mittel_ausloesen, genauigkeit, bewertung, entfernung, reduzierung, nachbar_prio, teilnehmergruppensperre, anzahl_gesperrter_teilnehmergruppen);
|
||||||
dsp_init();
|
dsp_init();
|
||||||
rc = init_telegramm();
|
rc = init_telegramm();
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
|
@ -4,10 +4,13 @@
|
||||||
|
|
||||||
cnetz_si si;
|
cnetz_si si;
|
||||||
|
|
||||||
void init_sysinfo(uint8_t fuz_nat, uint8_t fuz_fuvst, uint8_t fuz_rest, uint8_t kennung_fufst, uint8_t authentifikationsbit, uint8_t ws_kennung, uint8_t vermittlungstechnische_sperren, uint8_t grenz_einbuchen, uint8_t grenz_umschalten, uint8_t grenz_ausloesen, uint8_t mittel_umschalten, uint8_t mittel_ausloesen, uint8_t genauigkeit, uint8_t bewertung, uint8_t entfernung, uint8_t reduzierung, uint8_t nachbar_prio, int8_t teilnehmergruppensperre, uint8_t anzahl_gesperrter_teilnehmergruppen)
|
void init_sysinfo(uint8_t timeslot, uint8_t fuz_nat, uint8_t fuz_fuvst, uint8_t fuz_rest, uint8_t kennung_fufst, uint8_t authentifikationsbit, uint8_t ws_kennung, uint8_t vermittlungstechnische_sperren, uint8_t grenz_einbuchen, uint8_t grenz_umschalten, uint8_t grenz_ausloesen, uint8_t mittel_umschalten, uint8_t mittel_ausloesen, uint8_t genauigkeit, uint8_t bewertung, uint8_t entfernung, uint8_t reduzierung, uint8_t nachbar_prio, int8_t teilnehmergruppensperre, uint8_t anzahl_gesperrter_teilnehmergruppen)
|
||||||
{
|
{
|
||||||
memset(&si, 0, sizeof(si));
|
memset(&si, 0, sizeof(si));
|
||||||
|
|
||||||
|
/* timeslot to use */
|
||||||
|
si.timeslot = timeslot;
|
||||||
|
|
||||||
/* ID of base station */
|
/* ID of base station */
|
||||||
si.fuz_nat = fuz_nat;
|
si.fuz_nat = fuz_nat;
|
||||||
si.fuz_fuvst = fuz_fuvst;
|
si.fuz_fuvst = fuz_fuvst;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
typedef struct system_information {
|
typedef struct system_information {
|
||||||
|
uint8_t timeslot; /* timeslot to use */
|
||||||
uint8_t fuz_nat; /* national network ID */
|
uint8_t fuz_nat; /* national network ID */
|
||||||
uint8_t fuz_fuvst; /* id of switching center */
|
uint8_t fuz_fuvst; /* id of switching center */
|
||||||
uint8_t fuz_rest; /* rest of base station id */
|
uint8_t fuz_rest; /* rest of base station id */
|
||||||
|
@ -23,5 +24,5 @@ typedef struct system_information {
|
||||||
|
|
||||||
extern cnetz_si si;
|
extern cnetz_si si;
|
||||||
|
|
||||||
void init_sysinfo(uint8_t fuz_nat, uint8_t fuz_fuvst, uint8_t fuz_rest, uint8_t kennung_fufst, uint8_t authentifikationsbit, uint8_t ws_kennung, uint8_t vermittlungstechnische_sperren, uint8_t grenz_einbuchen, uint8_t grenz_umschalten, uint8_t grenz_ausloesen, uint8_t mittel_umschalten, uint8_t mittel_ausloesen, uint8_t genauigkeit, uint8_t bewertung, uint8_t entfernung, uint8_t reduzierung, uint8_t nachbar_prio, int8_t teilnehmergruppensperre, uint8_t anzahl_gesperrter_teilnehmergruppen);
|
void init_sysinfo(uint8_t timeslot, uint8_t fuz_nat, uint8_t fuz_fuvst, uint8_t fuz_rest, uint8_t kennung_fufst, uint8_t authentifikationsbit, uint8_t ws_kennung, uint8_t vermittlungstechnische_sperren, uint8_t grenz_einbuchen, uint8_t grenz_umschalten, uint8_t grenz_ausloesen, uint8_t mittel_umschalten, uint8_t mittel_ausloesen, uint8_t genauigkeit, uint8_t bewertung, uint8_t entfernung, uint8_t reduzierung, uint8_t nachbar_prio, int8_t teilnehmergruppensperre, uint8_t anzahl_gesperrter_teilnehmergruppen);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue