Parse grouplists.

This commit is contained in:
Serge Vakulenko 2018-08-30 22:10:55 -07:00
parent 5794760648
commit 17560c1a41
10 changed files with 499 additions and 287 deletions

View File

@ -1,6 +1,6 @@
# #
# This configuration was generated 2018/08/30 by dmrconfig, # This configuration was generated 2018/08/30 by dmrconfig,
# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Version 0.1.40, Copyright (C) 2018 Serge Vakulenko KK6ABQ
# #
Radio: TYT MD-UV380 Radio: TYT MD-UV380
Name: - Name: -
@ -41,32 +41,33 @@ Zone Name Channels
1b - - 1b - -
# Table of scan lists. # Table of scan lists.
# 1) Zone number: 1-250 # 1) Scan list number: 1-250
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Priority channel 1 (50% of scans): -, Sel or index # 3) Priority channel 1 (50% of scans): -, Sel or index
# 4) Priority channel 2 (25% of scans): -, Sel or index # 4) Priority channel 2 (25% of scans): -, Sel or index
# 5) Designated transmit channel: -, Last or index # 5) Designated transmit channel: Last, Sel or index
# 6) List of channels: numbers and ranges (N-M) separated by comma # 6) List of channels: numbers and ranges (N-M) separated by comma
# #
Scanlist Name PCh1 PCh2 TxCh Channels Scanlist Name PCh1 PCh2 TxCh Channels
1 ScanList1 - - - 1 1 ScanList1 - - Last 1
# Table of contacts. # Table of contacts.
# 1) Contact number: 1-10000 # 1) Contact number: 1-10000
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Call type: Group, Private, All # 3) Call type: Group, Private, All
# 4) Call ID: 1...16777215 # 4) Call ID: 1...16777215
# 5) Call receive tone: -, Yes # 5) Call receive tone: -, +
# #
Contact Name Type ID RxTone Contact Name Type ID RxTone
1 Contact1 Group 1 - 1 Contact1 Group 1 -
# Table of group lists. # Table of group lists.
# 1) Group list number: 1-250 # 1) Group list number: 1-250
# 2) List of contacts: numbers and ranges (N-M) separated by comma # 2) Name: up to 16 characters, use '_' instead of space
# 3) List of contacts: numbers and ranges (N-M) separated by comma
# #
Grouplist Contacts Grouplist Name Contacts
1 1 1 GroupList1 1
# Table of text messages. # Table of text messages.
# 1) Message number: 1-50 # 1) Message number: 1-50

View File

@ -1,6 +1,6 @@
# #
# This configuration was generated 2018/08/30 by dmrconfig, # This configuration was generated 2018/08/30 by dmrconfig,
# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Version 0.1.40, Copyright (C) 2018 Serge Vakulenko KK6ABQ
# #
Radio: TYT MD-UV380 Radio: TYT MD-UV380
Name: - Name: -
@ -70,32 +70,33 @@ Zone Name Channels
1b - 6-10 1b - 6-10
# Table of scan lists. # Table of scan lists.
# 1) Zone number: 1-250 # 1) Scan list number: 1-250
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Priority channel 1 (50% of scans): -, Sel or index # 3) Priority channel 1 (50% of scans): -, Sel or index
# 4) Priority channel 2 (25% of scans): -, Sel or index # 4) Priority channel 2 (25% of scans): -, Sel or index
# 5) Designated transmit channel: -, Last or index # 5) Designated transmit channel: Last, Sel or index
# 6) List of channels: numbers and ranges (N-M) separated by comma # 6) List of channels: numbers and ranges (N-M) separated by comma
# #
Scanlist Name PCh1 PCh2 TxCh Channels Scanlist Name PCh1 PCh2 TxCh Channels
1 ScanList1 - - - 1 1 ScanList1 - - Last 1
# Table of contacts. # Table of contacts.
# 1) Contact number: 1-10000 # 1) Contact number: 1-10000
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Call type: Group, Private, All # 3) Call type: Group, Private, All
# 4) Call ID: 1...16777215 # 4) Call ID: 1...16777215
# 5) Call receive tone: -, Yes # 5) Call receive tone: -, +
# #
Contact Name Type ID RxTone Contact Name Type ID RxTone
1 Contact1 Group 1 - 1 Contact1 Group 1 -
# Table of group lists. # Table of group lists.
# 1) Group list number: 1-250 # 1) Group list number: 1-250
# 2) List of contacts: numbers and ranges (N-M) separated by comma # 2) Name: up to 16 characters, use '_' instead of space
# 3) List of contacts: numbers and ranges (N-M) separated by comma
# #
Grouplist Contacts Grouplist Name Contacts
1 1 1 GroupList1 1
# Table of text messages. # Table of text messages.
# 1) Message number: 1-50 # 1) Message number: 1-50

View File

@ -1,6 +1,6 @@
# #
# This configuration was generated 2018/08/30 by dmrconfig, # This configuration was generated 2018/08/30 by dmrconfig,
# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Version 0.1.40, Copyright (C) 2018 Serge Vakulenko KK6ABQ
# #
Radio: TYT MD-UV380 Radio: TYT MD-UV380
Name: Dit_Call Name: Dit_Call
@ -1005,75 +1005,75 @@ Zone Name Channels
55b - - 55b - -
# Table of scan lists. # Table of scan lists.
# 1) Zone number: 1-250 # 1) Scan list number: 1-250
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Priority channel 1 (50% of scans): -, Sel or index # 3) Priority channel 1 (50% of scans): -, Sel or index
# 4) Priority channel 2 (25% of scans): -, Sel or index # 4) Priority channel 2 (25% of scans): -, Sel or index
# 5) Designated transmit channel: -, Last or index # 5) Designated transmit channel: Last, Sel or index
# 6) List of channels: numbers and ranges (N-M) separated by comma # 6) List of channels: numbers and ranges (N-M) separated by comma
# #
Scanlist Name PCh1 PCh2 TxCh Channels Scanlist Name PCh1 PCh2 TxCh Channels
1 Favoritter 760 760 - 741,743 1 Favoritter 760 760 Last 741,743
2 BM_Frederikshavn 760 760 - 641,643 2 BM_Frederikshavn 760 760 Last 641,643
3 BM_Aarhus 760 760 - 480,482 3 BM_Aarhus 760 760 Last 480,482
4 BM_Aarhus_V 760 760 - 500,502 4 BM_Aarhus_V 760 760 Last 500,502
5 BM_Yding 760 760 - 741,743 5 BM_Yding 760 760 Last 741,743
6 BM_Sunds 760 760 - 721,723 6 BM_Sunds 760 760 Last 721,723
7 BM_Odense 760 760 - 681,683 7 BM_Odense 760 760 Last 681,683
8 BM_Chrfeld 760 760 - 520,522 8 BM_Chrfeld 760 760 Last 520,522
9 BM_Dronningmolle 760 760 - 540,542 9 BM_Dronningmolle 760 760 Last 540,542
10 BM_Helsingoer 760 760 - 580,582 10 BM_Helsingoer 760 760 Last 580,582
11 BM_Humlebaek 760 760 - 621,623 11 BM_Humlebaek 760 760 Last 621,623
12 BM_Gorlose 760 760 - 560,562 12 BM_Gorlose 760 760 Last 560,562
13 BM_Herlev 760 760 - 601,603 13 BM_Herlev 760 760 Last 601,603
14 BM_Regnemark 760 760 - 701,703 14 BM_Regnemark 760 760 Last 701,703
15 BM_Mogenstrup 760 760 - 661,663 15 BM_Mogenstrup 760 760 Last 661,663
16 Frederikhavn 760 760 - 142,144 16 Frederikhavn 760 760 Last 142,144
17 Vodskov 268 760 - 452,454 17 Vodskov 268 760 Last 452,454
18 Stoevring 760 760 - 325,327 18 Stoevring 760 760 Last 325,327
19 Thyholm 760 760 - 353,355 19 Thyholm 760 760 Last 353,355
20 Viborg 760 760 - 410,412 20 Viborg 760 760 Last 410,412
21 Grenaa 760 760 - 170,172 21 Grenaa 760 760 Last 170,172
22 Risskov 760 760 - 255,257 22 Risskov 760 760 Last 255,257
23 Torphoj 760 760 - 368,370 23 Torphoj 760 760 Last 368,370
24 Fredericia 760 760 - 128,130 24 Fredericia 760 760 Last 128,130
25 Esbjerg_N 760 760 - 86,88 25 Esbjerg_N 760 760 Last 86,88
26 Esbjerg 760 760 - 100,102 26 Esbjerg 760 760 Last 100,102
27 Vissenbjerg 760 760 - 438,440 27 Vissenbjerg 760 760 Last 438,440
28 Svendborg 760 760 - 339,341 28 Svendborg 760 760 Last 339,341
29 Toender 760 760 - 382,384 29 Toender 760 760 Last 382,384
30 Vejby 760 760 - 396,398 30 Vejby 760 760 Last 396,398
31 Helsingor 760 760 - 184,186 31 Helsingor 760 760 Last 184,186
32 Frederikssund 760 760 - 156,158 32 Frederikssund 760 760 Last 156,158
33 Farum 760 760 - 114,116 33 Farum 760 760 Last 114,116
34 CPH_F. 760 760 - 58,60 34 CPH_F. 760 760 Last 58,60
35 Roedovre 760 760 - 269,271 35 Roedovre 760 760 Last 269,271
36 CPH_City 760 760 - 44,46 36 CPH_City 760 760 Last 44,46
37 Hoejby 760 760 - 198,200 37 Hoejby 760 760 Last 198,200
38 Vig 760 760 - 424,426 38 Vig 760 760 Last 424,426
39 Bregninge 760 760 - 30,32 39 Bregninge 760 760 Last 30,32
40 Snertinge 760 760 - 311,313 40 Snertinge 760 760 Last 311,313
41 Regstrup 760 760 - 241,243 41 Regstrup 760 760 Last 241,243
42 Ebberup 760 760 - 72,74 42 Ebberup 760 760 Last 72,74
43 Borup 760 760 - 16,18 43 Borup 760 760 Last 16,18
44 Slagelse 760 760 - 297,299 44 Slagelse 760 760 Last 297,299
45 Naestved 760 760 - 227,229 45 Naestved 760 760 Last 227,229
46 Raadegaard 760 760 - 283,285 46 Raadegaard 760 760 Last 283,285
47 Vordingborg 760 760 - 466,468 47 Vordingborg 760 760 Last 466,468
48 Bandholm 760 760 - 1,3 48 Bandholm 760 760 Last 1,3
49 Nakskov 760 760 - 212,214 49 Nakskov 760 760 Last 212,214
50 FM_Nordjylland 760 760 - 367,793-795,797-800 50 FM_Nordjylland 760 760 Last 367,793-795,797-800
51 FM_Midtjylland 760 760 - 214,801-804,807-808,810-811 51 FM_Midtjylland 760 760 Last 214,801-804,807-808,810-811
52 FM_Syddanmark 760 760 - 812-814,818-819 52 FM_Syddanmark 760 760 Last 812-814,818-819
53 FM_Hovedstaden 760 760 - 600,820-822,824 53 FM_Hovedstaden 760 760 Last 600,820-822,824
54 FM_Sjaelland 760 760 - 15,806,827-831 54 FM_Sjaelland 760 760 Last 15,806,827-831
# Table of contacts. # Table of contacts.
# 1) Contact number: 1-10000 # 1) Contact number: 1-10000
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Call type: Group, Private, All # 3) Call type: Group, Private, All
# 4) Call ID: 1...16777215 # 4) Call ID: 1...16777215
# 5) Call receive tone: -, Yes # 5) Call receive tone: -, +
# #
Contact Name Type ID RxTone Contact Name Type ID RxTone
1 Unlink Group 4000 - 1 Unlink Group 4000 -
@ -1138,22 +1138,23 @@ Contact Name Type ID RxTone
# Table of group lists. # Table of group lists.
# 1) Group list number: 1-250 # 1) Group list number: 1-250
# 2) List of contacts: numbers and ranges (N-M) separated by comma # 2) Name: up to 16 characters, use '_' instead of space
# 3) List of contacts: numbers and ranges (N-M) separated by comma
# #
Grouplist Contacts Grouplist Name Contacts
1 17-19,24-27,30-34,49,51 1 DMR+_TS_1 17-19,24-27,30-34,49,51
2 19,35-41,59 2 DMR+_TS_2 19,35-41,59
3 21-22,34,48,51,54 3 BM_TS_1 21-22,34,48,51,54
4 19,35-47,59 4 BM_TS_2 19,35-47,59
5 17 5 001_Verden 17
6 18 6 002_Europa 18
7 20 7 027_Norden 20
8 19 8 009_Lokal_9 19
9 33 9 235_UK 33
10 34 10 238_Danmark 34
11 48 11 240_Sverige 48
12 51 12 262_Germany 51
13 19,21-22,34-48 13 HS_RX 19,21-22,34-48
# Table of text messages. # Table of text messages.
# 1) Message number: 1-50 # 1) Message number: 1-50

View File

@ -1,6 +1,6 @@
# #
# This configuration was generated 2018/08/30 by dmrconfig, # This configuration was generated 2018/08/30 by dmrconfig,
# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Version 0.1.40, Copyright (C) 2018 Serge Vakulenko KK6ABQ
# #
Radio: TYT MD-UV380 Radio: TYT MD-UV380
Name: - Name: -
@ -601,51 +601,51 @@ Zone Name Channels
32b - - 32b - -
# Table of scan lists. # Table of scan lists.
# 1) Zone number: 1-250 # 1) Scan list number: 1-250
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Priority channel 1 (50% of scans): -, Sel or index # 3) Priority channel 1 (50% of scans): -, Sel or index
# 4) Priority channel 2 (25% of scans): -, Sel or index # 4) Priority channel 2 (25% of scans): -, Sel or index
# 5) Designated transmit channel: -, Last or index # 5) Designated transmit channel: Last, Sel or index
# 6) List of channels: numbers and ranges (N-M) separated by comma # 6) List of channels: numbers and ranges (N-M) separated by comma
# #
Scanlist Name PCh1 PCh2 TxCh Channels Scanlist Name PCh1 PCh2 TxCh Channels
1 Bullion-MtnWest_ 86 86 - 1-15 1 Bullion-MtnWest_ 86 86 Last 1-15
2 Meadow-MtnWest_U 86 86 - 17-32 2 Meadow-MtnWest_U 86 86 Last 17-32
3 DT-MtnWest_U 86 86 - 33-48 3 DT-MtnWest_U 86 86 Last 33-48
4 Bear-MtnWest_U 86 86 - 49-64 4 Bear-MtnWest_U 86 86 Last 49-64
5 Park-MtnWest_U 86 86 - 65-80 5 Park-MtnWest_U 86 86 Last 65-80
6 BRidge-MtnWest_U 86 86 - 81-95 6 BRidge-MtnWest_U 86 86 Last 81-95
7 Rita-MtnWest_U Sel Sel - 97-112 7 Rita-MtnWest_U Sel Sel Last 97-112
8 RndMtn-MtnWest_U 136 136 - 113-128 8 RndMtn-MtnWest_U 136 136 Last 113-128
9 SLO-MtnWest_U 136 136 - 129-144 9 SLO-MtnWest_U 136 136 Last 129-144
10 HFD-MtnWest_U 175 175 - 145-160 10 HFD-MtnWest_U 175 175 Last 145-160
11 SCruz-NorCal_U 175 175 - 161-175 11 SCruz-NorCal_U 175 175 Last 161-175
12 SJ1-NorCal_U 190 190 - 176-190 12 SJ1-NorCal_U 190 190 Last 176-190
13 SJ2-NorCal_U 311 311 - 191-204 13 SJ2-NorCal_U 311 311 Last 191-204
14 SJ3-NorCal_U 311 311 - 206-220 14 SJ3-NorCal_U 311 311 Last 206-220
15 FMT-NorCal_U 311 311 - 221-235 15 FMT-NorCal_U 311 311 Last 221-235
16 WLNTCRK-NorCal_U 311 311 - 236-250 16 WLNTCRK-NorCal_U 311 311 Last 236-250
17 SBruno-NorCal_U 311 311 - 251-265 17 SBruno-NorCal_U 311 311 Last 251-265
18 Oakland-NorCal_U 311 311 - 266-280 18 Oakland-NorCal_U 311 311 Last 266-280
19 Lvrmore-NorCal_U 311 311 - 281-295 19 Lvrmore-NorCal_U 311 311 Last 281-295
20 Mt_Oso-NorCal_U 311 311 - 296-310 20 Mt_Oso-NorCal_U 311 311 Last 296-310
21 Salinas-NorCal_U 311 311 - 311-325 21 Salinas-NorCal_U 311 311 Last 311-325
22 Pismo-NorCal_U 403 403 - 326-340 22 Pismo-NorCal_U 403 403 Last 326-340
23 SMaria-NorCal_U 403 403 - 341-355 23 SMaria-NorCal_U 403 403 Last 341-355
24 Rita-MtnWest_V 403 403 - 356-371 24 Rita-MtnWest_V 403 403 Last 356-371
25 Park-MtnWest_V 403 403 - 372-387 25 Park-MtnWest_V 403 403 Last 372-387
26 Meadow-MtnWest_V 403 403 - 388-403 26 Meadow-MtnWest_V 403 403 Last 388-403
27 Bullion-NorCal_V - - - 404-418 27 Bullion-NorCal_V - - Last 404-418
28 Sonora-NorCal_V - - - 419-433 28 Sonora-NorCal_V - - Last 419-433
29 Diablo-NorCal_V - - - 434-448 29 Diablo-NorCal_V - - Last 434-448
30 Sac-NorCal_V - - - 449-463 30 Sac-NorCal_V - - Last 449-463
# Table of contacts. # Table of contacts.
# 1) Contact number: 1-10000 # 1) Contact number: 1-10000
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Call type: Group, Private, All # 3) Call type: Group, Private, All
# 4) Call ID: 1...16777215 # 4) Call ID: 1...16777215
# 5) Call receive tone: -, Yes # 5) Call receive tone: -, +
# #
Contact Name Type ID RxTone Contact Name Type ID RxTone
1 Local Group 2 - 1 Local Group 2 -
@ -673,10 +673,11 @@ Contact Name Type ID RxTone
# Table of group lists. # Table of group lists.
# 1) Group list number: 1-250 # 1) Group list number: 1-250
# 2) List of contacts: numbers and ranges (N-M) separated by comma # 2) Name: up to 16 characters, use '_' instead of space
# 3) List of contacts: numbers and ranges (N-M) separated by comma
# #
Grouplist Contacts Grouplist Name Contacts
1 1 1 GroupList1 1
# Table of text messages. # Table of text messages.
# 1) Message number: 1-50 # 1) Message number: 1-50

View File

@ -1,6 +1,6 @@
# #
# This configuration was generated 2018/08/30 by dmrconfig, # This configuration was generated 2018/08/30 by dmrconfig,
# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Version 0.1.40, Copyright (C) 2018 Serge Vakulenko KK6ABQ
# #
Radio: TYT MD-UV380 Radio: TYT MD-UV380
Name: YourCall-Here Name: YourCall-Here
@ -1084,25 +1084,25 @@ Zone Name Channels
8b - 606,714,718,736,738,808,816,818,820,822,824,826,828,830,832,848 8b - 606,714,718,736,738,808,816,818,820,822,824,826,828,830,832,848
# Table of scan lists. # Table of scan lists.
# 1) Zone number: 1-250 # 1) Scan list number: 1-250
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Priority channel 1 (50% of scans): -, Sel or index # 3) Priority channel 1 (50% of scans): -, Sel or index
# 4) Priority channel 2 (25% of scans): -, Sel or index # 4) Priority channel 2 (25% of scans): -, Sel or index
# 5) Designated transmit channel: -, Last or index # 5) Designated transmit channel: Last, Sel or index
# 6) List of channels: numbers and ranges (N-M) separated by comma # 6) List of channels: numbers and ranges (N-M) separated by comma
# #
Scanlist Name PCh1 PCh2 TxCh Channels Scanlist Name PCh1 PCh2 TxCh Channels
1 Public_Safety 992 992 Last 112-116 1 Public_Safety 992 992 Sel 112-116
2 FavHamOnlyScan 992 992 Last 60-63 2 FavHamOnlyScan 992 992 Sel 60-63
3 Capitol_Pk_Scan - - - 994-1000 3 Capitol_Pk_Scan - - Last 994-1000
4 BawFaw_Scan - - - 1003-1010 4 BawFaw_Scan - - Last 1003-1010
# Table of contacts. # Table of contacts.
# 1) Contact number: 1-10000 # 1) Contact number: 1-10000
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Call type: Group, Private, All # 3) Call type: Group, Private, All
# 4) Call ID: 1...16777215 # 4) Call ID: 1...16777215
# 5) Call receive tone: -, Yes # 5) Call receive tone: -, +
# #
Contact Name Type ID RxTone Contact Name Type ID RxTone
1 B1_Local Group 1 - 1 B1_Local Group 1 -
@ -1536,11 +1536,12 @@ Contact Name Type ID RxTone
# Table of group lists. # Table of group lists.
# 1) Group list number: 1-250 # 1) Group list number: 1-250
# 2) List of contacts: numbers and ranges (N-M) separated by comma # 2) Name: up to 16 characters, use '_' instead of space
# 3) List of contacts: numbers and ranges (N-M) separated by comma
# #
Grouplist Contacts Grouplist Name Contacts
1 4,75,292-293,327,411-412,419,423 1 Hotspot_Rx_List 4,75,292-293,327,411-412,419,423
2 5,11,265-269,271,280-281,283,329-330,420-422,427 2 PNW_All 5,11,265-269,271,280-281,283,329-330,420-422,427
# Table of text messages. # Table of text messages.
# 1) Message number: 1-50 # 1) Message number: 1-50

View File

@ -1,6 +1,6 @@
# #
# This configuration was generated 2018/08/30 by dmrconfig, # This configuration was generated 2018/08/30 by dmrconfig,
# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Version 0.1.40, Copyright (C) 2018 Serge Vakulenko KK6ABQ
# #
Radio: TYT MD-380 Radio: TYT MD-380
Name: YOURCALL Name: YOURCALL
@ -69,60 +69,60 @@ Zone Name Channels
3 Hot_Spot 2,7 3 Hot_Spot 2,7
# Table of scan lists. # Table of scan lists.
# 1) Zone number: 1-250 # 1) Scan list number: 1-250
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Priority channel 1 (50% of scans): -, Sel or index # 3) Priority channel 1 (50% of scans): -, Sel or index
# 4) Priority channel 2 (25% of scans): -, Sel or index # 4) Priority channel 2 (25% of scans): -, Sel or index
# 5) Designated transmit channel: -, Last or index # 5) Designated transmit channel: Last, Sel or index
# 6) List of channels: numbers and ranges (N-M) separated by comma # 6) List of channels: numbers and ranges (N-M) separated by comma
# #
Scanlist Name PCh1 PCh2 TxCh Channels Scanlist Name PCh1 PCh2 TxCh Channels
1 Daly_City Sel Sel - - 1 Daly_City Sel Sel Last -
2 Oakland Sel Sel - - 2 Oakland Sel Sel Last -
3 Palo_Alto Sel Sel - - 3 Palo_Alto Sel Sel Last -
4 San_Jose_4 Sel Sel - - 4 San_Jose_4 Sel Sel Last -
5 Moffett Sel Sel - - 5 Moffett Sel Sel Last -
6 Auburn Sel Sel - - 6 Auburn Sel Sel Last -
7 Bodega Sel Sel - - 7 Bodega Sel Sel Last -
8 Dixon Sel Sel - - 8 Dixon Sel Sel Last -
9 Fremont_1 Sel Sel - - 9 Fremont_1 Sel Sel Last -
10 Fremont_2 Sel Sel - - 10 Fremont_2 Sel Sel Last -
11 Gilroy Sel Sel - - 11 Gilroy Sel Sel Last -
12 Gualala Sel Sel - - 12 Gualala Sel Sel Last -
13 Livermore Sel Sel - - 13 Livermore Sel Sel Last -
14 Mariposa_MB Sel Sel - - 14 Mariposa_MB Sel Sel Last -
15 Milpitas Sel Sel - - 15 Milpitas Sel Sel Last -
16 Modesto Sel Sel - - 16 Modesto Sel Sel Last -
17 Mt._Oso Sel Sel - - 17 Mt._Oso Sel Sel Last -
18 New_Cuyama Sel Sel - - 18 New_Cuyama Sel Sel Last -
19 Novato Sel Sel - - 19 Novato Sel Sel Last -
20 Pittsburg Sel Sel - - 20 Pittsburg Sel Sel Last -
21 Pleasanton Sel Sel - - 21 Pleasanton Sel Sel Last -
22 Salinas Sel Sel - - 22 Salinas Sel Sel Last -
23 San_Jose_1 Sel Sel - - 23 San_Jose_1 Sel Sel Last -
24 San_Jose_2 Sel Sel - - 24 San_Jose_2 Sel Sel Last -
25 San_Jose_3 Sel Sel - - 25 San_Jose_3 Sel Sel Last -
26 San_Luis_Obispo Sel Sel - - 26 San_Luis_Obispo Sel Sel Last -
27 Sanel_Mtn Sel Sel - - 27 Sanel_Mtn Sel Sel Last -
28 Santa_Cruz Sel Sel - - 28 Santa_Cruz Sel Sel Last -
29 Santa_Maria Sel Sel - - 29 Santa_Maria Sel Sel Last -
30 Santa_Rosa Sel Sel - - 30 Santa_Rosa Sel Sel Last -
31 Sebastopol Sel Sel - - 31 Sebastopol Sel Sel Last -
32 Sonoma Sel Sel - - 32 Sonoma Sel Sel Last -
33 Sonoma_Mtn Sel Sel - 1 33 Sonoma_Mtn Sel Sel Last 1
34 Sonora Sel Sel - - 34 Sonora Sel Sel Last -
35 S._Lake_Tahoe Sel Sel - - 35 S._Lake_Tahoe Sel Sel Last -
36 Tuolumne Sel Sel - - 36 Tuolumne Sel Sel Last -
37 Turlock Sel Sel - - 37 Turlock Sel Sel Last -
38 Walnut_Creek Sel Sel - - 38 Walnut_Creek Sel Sel Last -
39 Talk_Around Sel Sel - - 39 Talk_Around Sel Sel Last -
# Table of contacts. # Table of contacts.
# 1) Contact number: 1-1000 # 1) Contact number: 1-1000
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Call type: Group, Private, All # 3) Call type: Group, Private, All
# 4) Call ID: 1...16777215 # 4) Call ID: 1...16777215
# 5) Call receive tone: -, Yes # 5) Call receive tone: -, +
# #
Contact Name Type ID RxTone Contact Name Type ID RxTone
1 Local Group 2 - 1 Local Group 2 -
@ -144,10 +144,11 @@ Contact Name Type ID RxTone
# Table of group lists. # Table of group lists.
# 1) Group list number: 1-250 # 1) Group list number: 1-250
# 2) List of contacts: numbers and ranges (N-M) separated by comma # 2) Name: up to 16 characters, use '_' instead of space
# 3) List of contacts: numbers and ranges (N-M) separated by comma
# #
Grouplist Contacts Grouplist Name Contacts
1 1-2 1 Amateur_T2 1-2
# Table of text messages. # Table of text messages.
# 1) Message number: 1-50 # 1) Message number: 1-50

View File

@ -1,6 +1,6 @@
# #
# This configuration was generated 2018/08/30 by dmrconfig, # This configuration was generated 2018/08/30 by dmrconfig,
# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Version 0.1.40, Copyright (C) 2018 Serge Vakulenko KK6ABQ
# #
Radio: TYT MD-380 Radio: TYT MD-380
Name: noname Name: noname
@ -1030,61 +1030,61 @@ Zone Name Channels
40 Turlock.rptr 909-922 40 Turlock.rptr 909-922
# Table of scan lists. # Table of scan lists.
# 1) Zone number: 1-250 # 1) Scan list number: 1-250
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Priority channel 1 (50% of scans): -, Sel or index # 3) Priority channel 1 (50% of scans): -, Sel or index
# 4) Priority channel 2 (25% of scans): -, Sel or index # 4) Priority channel 2 (25% of scans): -, Sel or index
# 5) Designated transmit channel: -, Last or index # 5) Designated transmit channel: Last, Sel or index
# 6) List of channels: numbers and ranges (N-M) separated by comma # 6) List of channels: numbers and ranges (N-M) separated by comma
# #
Scanlist Name PCh1 PCh2 TxCh Channels Scanlist Name PCh1 PCh2 TxCh Channels
1 PAARA_(SJ)_w6otx Sel - - 1-24 1 PAARA_(SJ)_w6otx Sel - Last 1-24
2 PaloAlto_k6otr Sel - - 25-48 2 PaloAlto_k6otr Sel - Last 25-48
3 DalyCity_n6amg Sel - - 49-72 3 DalyCity_n6amg Sel - Last 49-72
4 MoffettFld_w6cmu Sel - - 73-96 4 MoffettFld_w6cmu Sel - Last 73-96
5 SanJose_k6hle Sel - - 97-120 5 SanJose_k6hle Sel - Last 97-120
6 CrystalPk_k6hle Sel - - 121-144 6 CrystalPk_k6hle Sel - Last 121-144
7 LomaPrieta_w6yyy Sel - - 145-168 7 LomaPrieta_w6yyy Sel - Last 145-168
8 Gilroy_k6sia Sel - - 169-192 8 Gilroy_k6sia Sel - Last 169-192
9 MtAllison_w6tcp Sel - - 193-216 9 MtAllison_w6tcp Sel - Last 193-216
10 Milpitas_wa6kpx Sel - - 217-240 10 Milpitas_wa6kpx Sel - Last 217-240
11 Oakland_k6lnk Sel - - 241-264 11 Oakland_k6lnk Sel - Last 241-264
12 SantaCruz_wa6ycz Sel - - 265-288 12 SantaCruz_wa6ycz Sel - Last 265-288
13 Salinas_w6jso Sel - - 289-312 13 Salinas_w6jso Sel - Last 289-312
14 Direct - - - 317-323 14 Direct - - Last 317-323
15 BlankDigital - - - 313-316 15 BlankDigital - - Last 313-316
16 Pleasanton_n6ldj Sel - - 333-356 16 Pleasanton_n6ldj Sel - Last 333-356
17 Livermore_k6lrg Sel - - 357-380 17 Livermore_k6lrg Sel - Last 357-380
18 Pittsburg_k6pit Sel - - 381-404 18 Pittsburg_k6pit Sel - Last 381-404
19 WalnutCrk_k6lnk Sel - - 405-428 19 WalnutCrk_k6lnk Sel - Last 405-428
20 WalnutCrk2_n6mvt Sel - - 429-452 20 WalnutCrk2_n6mvt Sel - Last 429-452
21 Novato_kg6mzv Sel - - 453-476 21 Novato_kg6mzv Sel - Last 453-476
22 SanelMtn_nn6j Sel - - 477-500 22 SanelMtn_nn6j Sel - Last 477-500
23 SonomaCity_w6pe Sel - - 501-524 23 SonomaCity_w6pe Sel - Last 501-524
24 SonomaMtn_nn6j Sel - - 525-548 24 SonomaMtn_nn6j Sel - Last 525-548
25 SantaRosa_k6acs Sel - - 549-572 25 SantaRosa_k6acs Sel - Last 549-572
26 Sebstopol_kc6sot Sel - - 573-596 26 Sebstopol_kc6sot Sel - Last 573-596
27 BodegaBay_kj6qbm Sel - - 597-620 27 BodegaBay_kj6qbm Sel - Last 597-620
28 Gualala_k6lnk Sel - - 621-644 28 Gualala_k6lnk Sel - Last 621-644
29 SLO_k6acr Sel - - 645-668 29 SLO_k6acr Sel - Last 645-668
30 SantaMaria_k6acr Sel - - 669-692 30 SantaMaria_k6acr Sel - Last 669-692
31 NewCuyama_k7az Sel - - 693-716 31 NewCuyama_k7az Sel - Last 693-716
32 Dixon_Sac._k6jwn Sel - - 717-740 32 Dixon_Sac._k6jwn Sel - Last 717-740
33 Auburn_ng6d Sel - - 741-764 33 Auburn_ng6d Sel - Last 741-764
34 SoLkTahoe_wa6ewv Sel - - 765-788 34 SoLkTahoe_wa6ewv Sel - Last 765-788
35 Sonora_kj6nro Sel - - 789-812 35 Sonora_kj6nro Sel - Last 789-812
36 Tuolumne_kj6nro Sel - - 813-836 36 Tuolumne_kj6nro Sel - Last 813-836
37 MtBullion_k6acr Sel - - 837-860 37 MtBullion_k6acr Sel - Last 837-860
38 MtOso_k6acr Sel - - 861-884 38 MtOso_k6acr Sel - Last 861-884
39 Modesto_k6acr Sel - - 885-908 39 Modesto_k6acr Sel - Last 885-908
40 Turlock_k6acr Sel - - 909-932 40 Turlock_k6acr Sel - Last 909-932
# Table of contacts. # Table of contacts.
# 1) Contact number: 1-1000 # 1) Contact number: 1-1000
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Call type: Group, Private, All # 3) Call type: Group, Private, All
# 4) Call ID: 1...16777215 # 4) Call ID: 1...16777215
# 5) Call receive tone: -, Yes # 5) Call receive tone: -, +
# #
Contact Name Type ID RxTone Contact Name Type ID RxTone
1 Local Group 2 - 1 Local Group 2 -
@ -1595,11 +1595,12 @@ Contact Name Type ID RxTone
# Table of group lists. # Table of group lists.
# 1) Group list number: 1-250 # 1) Group list number: 1-250
# 2) List of contacts: numbers and ranges (N-M) separated by comma # 2) Name: up to 16 characters, use '_' instead of space
# 3) List of contacts: numbers and ranges (N-M) separated by comma
# #
Grouplist Contacts Grouplist Name Contacts
1 5-11,16-26,28-33,35-37,49 1 TS1.BM.TalkGrps 5-11,16-26,28-33,35-37,49
2 1-4 2 TS2.BM.TlkGrps 1-4
# Table of text messages. # Table of text messages.
# 1) Message number: 1-50 # 1) Message number: 1-50

View File

@ -1,6 +1,6 @@
# #
# This configuration was generated 2018/08/30 by dmrconfig, # This configuration was generated 2018/08/30 by dmrconfig,
# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Version 0.1.40, Copyright (C) 2018 Serge Vakulenko KK6ABQ
# #
Radio: TYT MD-380 Radio: TYT MD-380
Name: MYCALL Name: MYCALL
@ -318,60 +318,60 @@ Zone Name Channels
39 Walnut_Creek 70-74 39 Walnut_Creek 70-74
# Table of scan lists. # Table of scan lists.
# 1) Zone number: 1-250 # 1) Scan list number: 1-250
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Priority channel 1 (50% of scans): -, Sel or index # 3) Priority channel 1 (50% of scans): -, Sel or index
# 4) Priority channel 2 (25% of scans): -, Sel or index # 4) Priority channel 2 (25% of scans): -, Sel or index
# 5) Designated transmit channel: -, Last or index # 5) Designated transmit channel: Last, Sel or index
# 6) List of channels: numbers and ranges (N-M) separated by comma # 6) List of channels: numbers and ranges (N-M) separated by comma
# #
Scanlist Name PCh1 PCh2 TxCh Channels Scanlist Name PCh1 PCh2 TxCh Channels
1 Daly_City 140 140 - 134-147 1 Daly_City 140 140 Last 134-147
2 Oakland 140 140 - 56-69 2 Oakland 140 140 Last 56-69
3 Palo_Alto 140 140 - 80-93 3 Palo_Alto 140 140 Last 80-93
4 San_Jose_4 140 140 - 191-204 4 San_Jose_4 140 140 Last 191-204
5 Moffett 140 140 - 172-185 5 Moffett 140 140 Last 172-185
6 Auburn 140 140 - 153-157 6 Auburn 140 140 Last 153-157
7 Bodega 140 140 - 129-133 7 Bodega 140 140 Last 129-133
8 Dixon 140 140 - 46-50 8 Dixon 140 140 Last 46-50
9 Fremont_1 140 140 - 215-219 9 Fremont_1 140 140 Last 215-219
10 Fremont_2 140 140 - 210-214 10 Fremont_2 140 140 Last 210-214
11 Gilroy 140 140 - 99-103 11 Gilroy 140 140 Last 99-103
12 Gualala 140 140 - 51-55 12 Gualala 140 140 Last 51-55
13 Livermore 140 140 - 75-79 13 Livermore 140 140 Last 75-79
14 Mariposa_MB 140 140 - 1-5 14 Mariposa_MB 140 140 Last 1-5
15 Milpitas 140 140 - 230-234 15 Milpitas 140 140 Last 230-234
16 Modesto 140 140 - 11-15 16 Modesto 140 140 Last 11-15
17 Mt._Oso 140 140 - 6-10 17 Mt._Oso 140 140 Last 6-10
18 New_Cuyama 140 140 - 104-108 18 New_Cuyama 140 140 Last 104-108
19 Novato 140 140 - 114-118 19 Novato 140 140 Last 114-118
20 Pittsburg 140 140 - 94-98 20 Pittsburg 140 140 Last 94-98
21 Pleasanton 140 140 - 148-152 21 Pleasanton 140 140 Last 148-152
22 Salinas 140 140 - 186-190 22 Salinas 140 140 Last 186-190
23 San_Jose_1 140 140 - 220-224 23 San_Jose_1 140 140 Last 220-224
24 San_Jose_2 140 140 - 36-40 24 San_Jose_2 140 140 Last 36-40
25 San_Jose_3 140 140 - 41-45 25 San_Jose_3 140 140 Last 41-45
26 San_Luis_Obispo 140 140 - 16-20 26 San_Luis_Obispo 140 140 Last 16-20
27 Sanel_Mtn 140 140 - 158-162 27 Sanel_Mtn 140 140 Last 158-162
28 Santa_Cruz 140 140 - 235-239 28 Santa_Cruz 140 140 Last 235-239
29 Santa_Maria 140 140 - 21-25 29 Santa_Maria 140 140 Last 21-25
30 Santa_Rosa 140 140 - 31-35 30 Santa_Rosa 140 140 Last 31-35
31 Sebastopol 140 140 - 109-113 31 Sebastopol 140 140 Last 109-113
32 Sonoma 140 140 - 205-209 32 Sonoma 140 140 Last 205-209
33 Sonoma_Mtn 140 140 - 163-167 33 Sonoma_Mtn 140 140 Last 163-167
34 Sonora 140 140 - 119-123 34 Sonora 140 140 Last 119-123
35 S._Lake_Tahoe 140 140 - 225-229 35 S._Lake_Tahoe 140 140 Last 225-229
36 Tuolumne 140 140 - 124-128 36 Tuolumne 140 140 Last 124-128
37 Turlock 140 140 - 26-30 37 Turlock 140 140 Last 26-30
38 Walnut_Creek 140 140 - 70-74 38 Walnut_Creek 140 140 Last 70-74
39 Talk_Around 227 227 - 168-171 39 Talk_Around 227 227 Last 168-171
# Table of contacts. # Table of contacts.
# 1) Contact number: 1-1000 # 1) Contact number: 1-1000
# 2) Name: up to 16 characters, use '_' instead of space # 2) Name: up to 16 characters, use '_' instead of space
# 3) Call type: Group, Private, All # 3) Call type: Group, Private, All
# 4) Call ID: 1...16777215 # 4) Call ID: 1...16777215
# 5) Call receive tone: -, Yes # 5) Call receive tone: -, +
# #
Contact Name Type ID RxTone Contact Name Type ID RxTone
1 Local Group 2 - 1 Local Group 2 -
@ -412,11 +412,12 @@ Contact Name Type ID RxTone
# Table of group lists. # Table of group lists.
# 1) Group list number: 1-250 # 1) Group list number: 1-250
# 2) List of contacts: numbers and ranges (N-M) separated by comma # 2) Name: up to 16 characters, use '_' instead of space
# 3) List of contacts: numbers and ranges (N-M) separated by comma
# #
Grouplist Contacts Grouplist Name Contacts
1 3-11,13-17,20-32,34 1 Amateur_T1 3-11,13-17,20-32,34
2 1-2,18-19,33 2 Amateur_T2 1-2,18-19,33
# Table of text messages. # Table of text messages.
# 1) Message number: 1-50 # 1) Message number: 1-50

106
md380.c
View File

@ -409,6 +409,8 @@ static int zone_append(int zone_index, int cnum)
int i; int i;
for (i=0; i<16; i++) { for (i=0; i<16; i++) {
if (z->member[i] == cnum)
return 1;
if (z->member[i] == 0) { if (z->member[i] == 0) {
z->member[i] = cnum; z->member[i] = cnum;
return 1; return 1;
@ -469,6 +471,8 @@ static int scanlist_append(int list_index, int cnum)
int i; int i;
for (i=0; i<31; i++) { for (i=0; i<31; i++) {
if (sl->member[i] == cnum)
return 1;
if (sl->member[i] == 0) { if (sl->member[i] == 0) {
sl->member[i] = cnum; sl->member[i] = cnum;
return 1; return 1;
@ -496,6 +500,33 @@ static void setup_contact(int index, const char *name, int type, int id, int rxt
utf8_decode(ct->name, name, 16); utf8_decode(ct->name, name, 16);
} }
static void setup_grouplist(int index, const char *name)
{
grouplist_t *gl = (grouplist_t*) &radio_mem[OFFSET_GLISTS + index*96];
utf8_decode(gl->name, name, 16);
}
//
// Add contact to a grouplist.
// Return 0 on failure.
//
static int grouplist_append(int index, int cnum)
{
grouplist_t *gl = (grouplist_t*) &radio_mem[OFFSET_GLISTS + index*96];
int i;
for (i=0; i<32; i++) {
if (gl->member[i] == cnum)
return 1;
if (gl->member[i] == 0) {
gl->member[i] = cnum;
return 1;
}
}
return 0;
}
// //
// Check that the radio does support this frequency. // Check that the radio does support this frequency.
// //
@ -1121,10 +1152,11 @@ static void md380_print_config(radio_device_t *radio, FILE *out, int verbose)
if (verbose) { if (verbose) {
fprintf(out, "# Table of group lists.\n"); fprintf(out, "# Table of group lists.\n");
fprintf(out, "# 1) Group list number: 1-%d\n", NGLISTS); fprintf(out, "# 1) Group list number: 1-%d\n", NGLISTS);
fprintf(out, "# 2) List of contacts: numbers and ranges (N-M) separated by comma\n"); fprintf(out, "# 2) Name: up to 16 characters, use '_' instead of space\n");
fprintf(out, "# 3) List of contacts: numbers and ranges (N-M) separated by comma\n");
fprintf(out, "#\n"); fprintf(out, "#\n");
} }
fprintf(out, "Grouplist Contacts\n"); fprintf(out, "Grouplist Name Contacts\n");
for (i=0; i<NGLISTS; i++) { for (i=0; i<NGLISTS; i++) {
grouplist_t *gl = (grouplist_t*) &radio_mem[OFFSET_GLISTS + i*96]; grouplist_t *gl = (grouplist_t*) &radio_mem[OFFSET_GLISTS + i*96];
@ -1134,6 +1166,8 @@ static void md380_print_config(radio_device_t *radio, FILE *out, int verbose)
} }
fprintf(out, "%5d ", i + 1); fprintf(out, "%5d ", i + 1);
print_unicode(out, gl->name, 16, 1);
fprintf(out, " ");
if (gl->member[0]) { if (gl->member[0]) {
print_chanlist(out, gl->member, 32); print_chanlist(out, gl->member, 32);
} else { } else {
@ -1859,8 +1893,74 @@ static int parse_contact(int first_row, char *line)
// //
static int parse_grouplist(int first_row, char *line) static int parse_grouplist(int first_row, char *line)
{ {
//TODO: parse grouplist Contacts char num_str[256], name_str[256], list_str[256];
int glnum;
if (sscanf(line, "%s %s %s", num_str, name_str, list_str) != 3)
return 0; return 0;
glnum = strtoul(num_str, 0, 10);
if (glnum < 1 || glnum > NGLISTS) {
fprintf(stderr, "Bad group list number.\n");
return 0;
}
if (first_row) {
// On first entry, erase the Grouplists table.
memset(&radio_mem[OFFSET_GLISTS], 0, NGLISTS*96);
}
setup_grouplist(glnum-1, name_str);
if (*list_str != '-') {
char *str = list_str;
int range = 0;
int last = 0;
// Parse contact list.
for (;;) {
char *eptr;
int cnum = strtoul(str, &eptr, 10);
if (eptr == str) {
fprintf(stderr, "Group list %d: wrong contact list '%s'.\n", glnum, str);
return 0;
}
if (cnum < 1 || cnum > NCONTACTS) {
fprintf(stderr, "Group list %d: wrong contact number %d.\n", glnum, cnum);
return 0;
}
if (range) {
// Add range.
int c;
for (c=last+1; c<=cnum; c++) {
if (!grouplist_append(glnum-1, c)) {
fprintf(stderr, "Group list %d: too many contacts.\n", glnum);
return 0;
}
}
} else {
// Add single contact.
if (!grouplist_append(glnum-1, cnum)) {
fprintf(stderr, "Group list %d: too many contacts.\n", glnum);
return 0;
}
}
if (*eptr == 0)
break;
if (*eptr != ',' && *eptr != '-') {
fprintf(stderr, "Group list %d: wrong contact list '%s'.\n", glnum, eptr);
return 0;
}
range = (*eptr == '-');
last = cnum;
str = eptr + 1;
}
}
return 1;
} }
// //

110
uv380.c
View File

@ -427,6 +427,8 @@ static int zone_append(int zone_index, int b_flag, int cnum)
if (b_flag) { if (b_flag) {
for (i=0; i<64; i++) { for (i=0; i<64; i++) {
if (zext->member_b[i] == cnum)
return 1;
if (zext->member_b[i] == 0) { if (zext->member_b[i] == 0) {
zext->member_b[i] = cnum; zext->member_b[i] = cnum;
return 1; return 1;
@ -434,12 +436,16 @@ static int zone_append(int zone_index, int b_flag, int cnum)
} }
} else { } else {
for (i=0; i<16; i++) { for (i=0; i<16; i++) {
if (z->member_a[i] == cnum)
return 1;
if (z->member_a[i] == 0) { if (z->member_a[i] == 0) {
z->member_a[i] = cnum; z->member_a[i] = cnum;
return 1; return 1;
} }
} }
for (i=0; i<48; i++) { for (i=0; i<48; i++) {
if (zext->ext_a[i] == cnum)
return 1;
if (zext->ext_a[i] == 0) { if (zext->ext_a[i] == 0) {
zext->ext_a[i] = cnum; zext->ext_a[i] = cnum;
return 1; return 1;
@ -503,6 +509,8 @@ static int scanlist_append(int list_index, int cnum)
int i; int i;
for (i=0; i<31; i++) { for (i=0; i<31; i++) {
if (sl->member[i] == cnum)
return 1;
if (sl->member[i] == 0) { if (sl->member[i] == 0) {
sl->member[i] = cnum; sl->member[i] = cnum;
return 1; return 1;
@ -530,6 +538,33 @@ static void setup_contact(int index, const char *name, int type, int id, int rxt
utf8_decode(ct->name, name, 16); utf8_decode(ct->name, name, 16);
} }
static void setup_grouplist(int index, const char *name)
{
grouplist_t *gl = (grouplist_t*) &radio_mem[OFFSET_GLISTS + index*96];
utf8_decode(gl->name, name, 16);
}
//
// Add contact to a grouplist.
// Return 0 on failure.
//
static int grouplist_append(int index, int cnum)
{
grouplist_t *gl = (grouplist_t*) &radio_mem[OFFSET_GLISTS + index*96];
int i;
for (i=0; i<32; i++) {
if (gl->member[i] == cnum)
return 1;
if (gl->member[i] == 0) {
gl->member[i] = cnum;
return 1;
}
}
return 0;
}
// //
// Check that the radio does support this frequency. // Check that the radio does support this frequency.
// //
@ -1179,10 +1214,11 @@ static void uv380_print_config(radio_device_t *radio, FILE *out, int verbose)
if (verbose) { if (verbose) {
fprintf(out, "# Table of group lists.\n"); fprintf(out, "# Table of group lists.\n");
fprintf(out, "# 1) Group list number: 1-%d\n", NGLISTS); fprintf(out, "# 1) Group list number: 1-%d\n", NGLISTS);
fprintf(out, "# 2) List of contacts: numbers and ranges (N-M) separated by comma\n"); fprintf(out, "# 2) Name: up to 16 characters, use '_' instead of space\n");
fprintf(out, "# 3) List of contacts: numbers and ranges (N-M) separated by comma\n");
fprintf(out, "#\n"); fprintf(out, "#\n");
} }
fprintf(out, "Grouplist Contacts\n"); fprintf(out, "Grouplist Name Contacts\n");
for (i=0; i<NGLISTS; i++) { for (i=0; i<NGLISTS; i++) {
grouplist_t *gl = (grouplist_t*) &radio_mem[OFFSET_GLISTS + i*96]; grouplist_t *gl = (grouplist_t*) &radio_mem[OFFSET_GLISTS + i*96];
@ -1192,6 +1228,8 @@ static void uv380_print_config(radio_device_t *radio, FILE *out, int verbose)
} }
fprintf(out, "%5d ", i + 1); fprintf(out, "%5d ", i + 1);
print_unicode(out, gl->name, 16, 1);
fprintf(out, " ");
if (gl->member[0]) { if (gl->member[0]) {
print_chanlist(out, gl->member, 32); print_chanlist(out, gl->member, 32);
} else { } else {
@ -1932,8 +1970,74 @@ static int parse_contact(int first_row, char *line)
// //
static int parse_grouplist(int first_row, char *line) static int parse_grouplist(int first_row, char *line)
{ {
//TODO: parse grouplist Contacts char num_str[256], name_str[256], list_str[256];
int glnum;
if (sscanf(line, "%s %s %s", num_str, name_str, list_str) != 3)
return 0; return 0;
glnum = strtoul(num_str, 0, 10);
if (glnum < 1 || glnum > NGLISTS) {
fprintf(stderr, "Bad group list number.\n");
return 0;
}
if (first_row) {
// On first entry, erase the Grouplists table.
memset(&radio_mem[OFFSET_GLISTS], 0, NGLISTS*96);
}
setup_grouplist(glnum-1, name_str);
if (*list_str != '-') {
char *str = list_str;
int range = 0;
int last = 0;
// Parse contact list.
for (;;) {
char *eptr;
int cnum = strtoul(str, &eptr, 10);
if (eptr == str) {
fprintf(stderr, "Group list %d: wrong contact list '%s'.\n", glnum, str);
return 0;
}
if (cnum < 1 || cnum > NCONTACTS) {
fprintf(stderr, "Group list %d: wrong contact number %d.\n", glnum, cnum);
return 0;
}
if (range) {
// Add range.
int c;
for (c=last+1; c<=cnum; c++) {
if (!grouplist_append(glnum-1, c)) {
fprintf(stderr, "Group list %d: too many contacts.\n", glnum);
return 0;
}
}
} else {
// Add single contact.
if (!grouplist_append(glnum-1, cnum)) {
fprintf(stderr, "Group list %d: too many contacts.\n", glnum);
return 0;
}
}
if (*eptr == 0)
break;
if (*eptr != ',' && *eptr != '-') {
fprintf(stderr, "Group list %d: wrong contact list '%s'.\n", glnum, eptr);
return 0;
}
range = (*eptr == '-');
last = cnum;
str = eptr + 1;
}
}
return 1;
} }
// //