diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2017-07-02 10:45:47 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2017-07-15 07:38:14 +0200 |
commit | 557d19de6680576d2ba5326ef571e1eee7761161 (patch) | |
tree | 90dc664e0ccdf4e68ee4e7f8fd7734b669dbee92 | |
parent | 3774519631203e4c3b05ad6c32ce1e8aaca54d2e (diff) |
NMT: Show trafic areas in hex and allow to select unsupported areas
-rw-r--r-- | src/nmt/countries.c | 5 | ||||
-rw-r--r-- | src/nmt/main.c | 16 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/nmt/countries.c b/src/nmt/countries.c index 2c66b77..c809c91 100644 --- a/src/nmt/countries.c +++ b/src/nmt/countries.c @@ -132,12 +132,13 @@ void nmt_country_list(void) int ch_from = 0, ch_to = 0; char ch_string[32]; - printf("TA from\tTA to\tChannels\tShort\tCountry (Provider)\n"); - printf("------------------------------------------------------------------------\n"); + printf("TA from\tTA to\tYY Code\tChannels\tShort\tCountry (Provider)\n"); + printf("--------------------------------------------------------------------------------\n"); for (i = 0; nmt_country[i].short_name; i++) { printf("%s,%d\t", nmt_country[i].short_name, nmt_country[i].first_ta); if (nmt_country[i].first_ta != nmt_country[i].last_ta) printf("%s,%d", nmt_country[i].short_name, nmt_country[i].last_ta); + printf("\t%02x..%02x", (nmt_country[i].y << 4) | nmt_country[i].first_ta, (nmt_country[i].y << 4) | nmt_country[i].last_ta); for (j = 0; nmt_country[i].nmt_frequency[j].first_frequency; j++) { if (j == 0 || nmt_country[i].nmt_frequency[j].first_channel < ch_from) ch_from = nmt_country[i].nmt_frequency[j].first_channel; diff --git a/src/nmt/main.c b/src/nmt/main.c index 9bdc2e8..97dab7c 100644 --- a/src/nmt/main.c +++ b/src/nmt/main.c @@ -68,9 +68,11 @@ void print_help(const char *arg0) printf(" -Y --traffic-area <traffic area> | list\n"); printf(" NOTE: MUST MATCH WITH YOUR ROAMING SETTINGS IN THE PHONE!\n"); printf(" Your phone will not connect, if country code is different!\n"); - printf(" Give short country code and cell area seperated by comma.\n"); - printf(" (Example: SE,1 = Sweden, cell 1)\n"); - printf(" Use 'list' to get a list of available short country code names\n"); + printf(" Give short country code and traffic area seperated by comma.\n"); + printf(" (Example: Give 'SE,1' for Sweden, traffic area 1)\n"); + printf(" Add '!' to force traffic area that is not supported by country.\n"); + printf(" (Example: Give 'B,12!' for Belgium, traffic area 12)\n"); + printf(" Use 'list' to get a list of available country code names\n"); printf(" -A --area-number <area no> | 0\n"); printf(" Give area number 1..4 or 0 for no area number. (default = '%d')\n", area_no); printf(" -C --compandor 1 | 0\n"); @@ -160,9 +162,11 @@ error_ta: exit(0); } traffic_area[0] = rc + '0'; - rc = nmt_ta_by_short_name(country, atoi(p)); - if (rc < 0) - goto error_ta; + if (p[strlen(p) - 1] != '!') { + rc = nmt_ta_by_short_name(country, atoi(p)); + if (rc < 0) + goto error_ta; + } nmt_value2digits(atoi(p), traffic_area + 1, 1); traffic_area[2] = '\0'; skip_args += 2; |