diff --git a/examples/md-uv380-empty.conf b/examples/md-uv380-empty.conf index 51665e5..530c940 100644 --- a/examples/md-uv380-empty.conf +++ b/examples/md-uv380-empty.conf @@ -1,6 +1,6 @@ # -# This configuration was generated 2018/08/29 by dmrconfig, -# Version 0.1.32, Copyright (C) 2018 Serge Vakulenko KK6ABQ +# This configuration was generated 2018/08/30 by dmrconfig, +# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Radio: TYT MD-UV380 Name: - @@ -8,6 +8,10 @@ ID: 1234 Last Programmed Date: 2018-08-20 12:41:08 CPS Software Version: V01.07 +# Text displayed when the radio powers up. +Welcome Line 1: - +Welcome Line 2: - + # Table of analog channels. # 1) Channel number: 1-3000 # 2) Name: up to 16 characters, use '_' instead of space @@ -15,13 +19,14 @@ CPS Software Version: V01.07 # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Tone -# 11) Guard tone for receive, or '-' to disable -# 12) Guard tone for transmit, or '-' to disable -# 13) Bandwidth in kHz: 12.5, 20, 25 +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Tone +# 12) Guard tone for receive, or '-' to disable +# 13) Guard tone for transmit, or '-' to disable +# 14) Bandwidth in kHz: 12.5, 20, 25 # Analog Name Receive Transmit Power Scan AS Sq TOT RO Admit RxTone TxTone Width 1 Channel1 400.000 +0 High - - 1 60 - - - - 12.5 diff --git a/examples/md-uv380-factory.conf b/examples/md-uv380-factory.conf index 0ca4afb..970d574 100644 --- a/examples/md-uv380-factory.conf +++ b/examples/md-uv380-factory.conf @@ -1,6 +1,6 @@ # -# This configuration was generated 2018/08/29 by dmrconfig, -# Version 0.1.32, Copyright (C) 2018 Serge Vakulenko KK6ABQ +# This configuration was generated 2018/08/30 by dmrconfig, +# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Radio: TYT MD-UV380 Name: - @@ -8,6 +8,10 @@ ID: 1234 Last Programmed Date: 2018-07-13 16:02:59 CPS Software Version: V01.07 +# Text displayed when the radio powers up. +Welcome Line 1: - +Welcome Line 2: - + # Table of digital channels. # 1) Channel number: 1-3000 # 2) Name: up to 16 characters, use '_' instead of space @@ -15,15 +19,16 @@ CPS Software Version: V01.07 # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index in Scanlist table -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Color -# 11) Color code: 1, 2, 3... 15 -# 12) Time slot: 1 or 2 -# 13) In call criteria: -, Admit, TXInt -# 14) Receive group list: - or index in Grouplist table -# 15) Contact for transmit: - or index in Contacts table +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Color +# 12) Color code: 1, 2, 3... 15 +# 13) Time slot: 1 or 2 +# 14) In call criteria: -, Admit, TXInt +# 15) Receive group list: - or index in Grouplist table +# 16) Contact for transmit: - or index in Contacts table # Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color Slot InCall RxGL TxContact 1 Channel1 431.125 +0 Low - - 3 60 - - 1 1 - 1 1 @@ -42,13 +47,14 @@ Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Tone -# 11) Guard tone for receive, or '-' to disable -# 12) Guard tone for transmit, or '-' to disable -# 13) Bandwidth in kHz: 12.5, 20, 25 +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Tone +# 12) Guard tone for receive, or '-' to disable +# 13) Guard tone for transmit, or '-' to disable +# 14) Bandwidth in kHz: 12.5, 20, 25 # Analog Name Receive Transmit Power Scan AS Sq TOT RO Admit RxTone TxTone Width 5 Channel5 435.525 +0 High - - 3 60 - - 82.5 82.5 12.5 diff --git a/examples/md-uv380_bm_2018-08-07.conf b/examples/md-uv380_bm_2018-08-07.conf index 1804231..4fe49e7 100644 --- a/examples/md-uv380_bm_2018-08-07.conf +++ b/examples/md-uv380_bm_2018-08-07.conf @@ -1,6 +1,6 @@ # -# This configuration was generated 2018/08/29 by dmrconfig, -# Version 0.1.32, Copyright (C) 2018 Serge Vakulenko KK6ABQ +# This configuration was generated 2018/08/30 by dmrconfig, +# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Radio: TYT MD-UV380 Name: Dit_Call @@ -8,6 +8,10 @@ ID: 238 Last Programmed Date: 2018-08-05 17:54:47 CPS Software Version: V01.32 +# Text displayed when the radio powers up. +Welcome Line 1: Husk_ID +Welcome Line 2: og_Call + # Table of digital channels. # 1) Channel number: 1-3000 # 2) Name: up to 16 characters, use '_' instead of space @@ -15,15 +19,16 @@ CPS Software Version: V01.32 # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index in Scanlist table -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Color -# 11) Color code: 1, 2, 3... 15 -# 12) Time slot: 1 or 2 -# 13) In call criteria: -, Admit, TXInt -# 14) Receive group list: - or index in Grouplist table -# 15) Contact for transmit: - or index in Contacts table +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Color +# 12) Color code: 1, 2, 3... 15 +# 13) Time slot: 1 or 2 +# 14) In call criteria: -, Admit, TXInt +# 15) Receive group list: - or index in Grouplist table +# 16) Contact for transmit: - or index in Contacts table # Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color Slot InCall RxGL TxContact 1 Bandholm_LK_238 434.650 -2 High 48 - 1 180 - Color 15 1 Admit 1 34 @@ -806,13 +811,14 @@ Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Tone -# 11) Guard tone for receive, or '-' to disable -# 12) Guard tone for transmit, or '-' to disable -# 13) Bandwidth in kHz: 12.5, 20, 25 +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Tone +# 12) Guard tone for receive, or '-' to disable +# 13) Guard tone for transmit, or '-' to disable +# 14) Bandwidth in kHz: 12.5, 20, 25 # Analog Name Receive Transmit Power Scan AS Sq TOT RO Admit RxTone TxTone Width 15 Bandholm_FM 434.650 -2 High 54 - 1 180 - - 82.5 82.5 12.5 diff --git a/examples/md2017-7-23-2017.conf b/examples/md2017-7-23-2017.conf index f36fda3..05b7ddb 100644 --- a/examples/md2017-7-23-2017.conf +++ b/examples/md2017-7-23-2017.conf @@ -1,6 +1,6 @@ # -# This configuration was generated 2018/08/29 by dmrconfig, -# Version 0.1.32, Copyright (C) 2018 Serge Vakulenko KK6ABQ +# This configuration was generated 2018/08/30 by dmrconfig, +# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Radio: TYT MD-UV380 Name: - @@ -8,6 +8,10 @@ ID: 1234 Last Programmed Date: 2017-07-23 19:19:23 CPS Software Version: V01.17 +# Text displayed when the radio powers up. +Welcome Line 1: - +Welcome Line 2: - + # Table of digital channels. # 1) Channel number: 1-3000 # 2) Name: up to 16 characters, use '_' instead of space @@ -15,15 +19,16 @@ CPS Software Version: V01.17 # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index in Scanlist table -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Color -# 11) Color code: 1, 2, 3... 15 -# 12) Time slot: 1 or 2 -# 13) In call criteria: -, Admit, TXInt -# 14) Receive group list: - or index in Grouplist table -# 15) Contact for transmit: - or index in Contacts table +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Color +# 12) Color code: 1, 2, 3... 15 +# 13) Time slot: 1 or 2 +# 14) In call criteria: -, Admit, TXInt +# 15) Receive group list: - or index in Grouplist table +# 16) Contact for transmit: - or index in Contacts table # Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color Slot InCall RxGL TxContact 1 MB-Local 442.2875 +5 High 1 - 1 180 - - 1 2 - - 1 @@ -497,13 +502,14 @@ Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Tone -# 11) Guard tone for receive, or '-' to disable -# 12) Guard tone for transmit, or '-' to disable -# 13) Bandwidth in kHz: 12.5, 20, 25 +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Tone +# 12) Guard tone for receive, or '-' to disable +# 13) Guard tone for transmit, or '-' to disable +# 14) Bandwidth in kHz: 12.5, 20, 25 # Analog Name Receive Transmit Power Scan AS Sq TOT RO Admit RxTone TxTone Width 464 N6DL_147.33 147.330 +0.6 High - - 1 180 - - - 100.0 25 diff --git a/examples/md2017-DualHotspot-PNW-2017-07-19.conf b/examples/md2017-DualHotspot-PNW-2017-07-19.conf index 62c6d9c..d364fd3 100644 --- a/examples/md2017-DualHotspot-PNW-2017-07-19.conf +++ b/examples/md2017-DualHotspot-PNW-2017-07-19.conf @@ -1,6 +1,6 @@ # -# This configuration was generated 2018/08/29 by dmrconfig, -# Version 0.1.32, Copyright (C) 2018 Serge Vakulenko KK6ABQ +# This configuration was generated 2018/08/30 by dmrconfig, +# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Radio: TYT MD-UV380 Name: YourCall-Here @@ -8,6 +8,10 @@ ID: 12345678 Last Programmed Date: 2017-07-19 07:09:13 CPS Software Version: V01.16 +# Text displayed when the radio powers up. +Welcome Line 1: YourName +Welcome Line 2: YourCall + # Table of digital channels. # 1) Channel number: 1-3000 # 2) Name: up to 16 characters, use '_' instead of space @@ -15,15 +19,16 @@ CPS Software Version: V01.16 # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index in Scanlist table -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Color -# 11) Color code: 1, 2, 3... 15 -# 12) Time slot: 1 or 2 -# 13) In call criteria: -, Admit, TXInt -# 14) Receive group list: - or index in Grouplist table -# 15) Contact for transmit: - or index in Contacts table +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Color +# 12) Color code: 1, 2, 3... 15 +# 13) Time slot: 1 or 2 +# 14) In call criteria: -, Admit, TXInt +# 15) Receive group list: - or index in Grouplist table +# 16) Contact for transmit: - or index in Contacts table # Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color Slot InCall RxGL TxContact 171 dSmplx1_441.000 441.000 +0 High - - 1 180 - Color 1 1 Admit - 10 @@ -874,13 +879,14 @@ Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color # 4) Transmit frequency or +/- offset in MHz # 5) Transmit power: High, Mid, Low # 6) Scan list: - or index -# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Tone -# 11) Guard tone for receive, or '-' to disable -# 12) Guard tone for transmit, or '-' to disable -# 13) Bandwidth in kHz: 12.5, 20, 25 +# 7) Autoscan flag: -, + +# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Tone +# 12) Guard tone for receive, or '-' to disable +# 13) Guard tone for transmit, or '-' to disable +# 14) Bandwidth in kHz: 12.5, 20, 25 # Analog Name Receive Transmit Power Scan AS Sq TOT RO Admit RxTone TxTone Width 1 01_PRMARY_145.37 145.370 -0.6 High - - 1 180 - - - 136.5 25 diff --git a/examples/md380-baynet-full-codeplug-rev1.conf b/examples/md380-baynet-full-codeplug-rev1.conf index e4590fc..636538f 100644 --- a/examples/md380-baynet-full-codeplug-rev1.conf +++ b/examples/md380-baynet-full-codeplug-rev1.conf @@ -1,6 +1,6 @@ # -# This configuration was generated 2018/08/29 by dmrconfig, -# Version 0.1.32, Copyright (C) 2018 Serge Vakulenko KK6ABQ +# This configuration was generated 2018/08/30 by dmrconfig, +# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Radio: TYT MD-380 Name: YOURCALL @@ -8,22 +8,27 @@ ID: 1234567 Last Programmed Date: 2018-03-29 10:33:50 CPS Software Version: V01.34 +# Text displayed when the radio powers up. +Welcome Line 1: WELCOME +Welcome Line 2: YOURCALL + # Table of digital channels. # 1) Channel number: 1-1000 # 2) Name: up to 16 characters, use '_' instead of space # 3) Receive frequency in MHz # 4) Transmit frequency or +/- offset in MHz -# 5) Transmit power: High, Mid, Low +# 5) Transmit power: High, Low # 6) Scan list: - or index in Scanlist table -# 7) Squelch level: Normal, Tight -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Color -# 11) Color code: 1, 2, 3... 15 -# 12) Time slot: 1 or 2 -# 13) In call criteria: -, Admit, TXInt -# 14) Receive group list: - or index in Grouplist table -# 15) Contact for transmit: - or index in Contacts table +# 7) Autoscan flag: -, + +# 8) Squelch level: Normal, Tight +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Color +# 12) Color code: 1, 2, 3... 15 +# 13) Time slot: 1 or 2 +# 14) In call criteria: -, Admit, TXInt +# 15) Receive group list: - or index in Grouplist table +# 16) Contact for transmit: - or index in Contacts table # Digital Name Receive Transmit Power Scan AS Squelch TOT RO Admit Color Slot InCall RxGL TxContact 1 Black_DMR 444.350 +5 High - - Normal 60 - - 1 2 - - 15 @@ -37,15 +42,16 @@ Digital Name Receive Transmit Power Scan AS Squelch TOT RO Admit # 2) Name: up to 16 characters, use '_' instead of space # 3) Receive frequency in MHz # 4) Transmit frequency or +/- offset in MHz -# 5) Transmit power: High, Mid, Low +# 5) Transmit power: High, Low # 6) Scan list: - or index -# 7) Squelch level: Normal, Tight -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Tone -# 11) Guard tone for receive, or '-' to disable -# 12) Guard tone for transmit, or '-' to disable -# 13) Bandwidth in kHz: 12.5, 20, 25 +# 7) Autoscan flag: -, + +# 8) Squelch level: Normal, Tight +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Tone +# 12) Guard tone for receive, or '-' to disable +# 13) Guard tone for transmit, or '-' to disable +# 14) Bandwidth in kHz: 12.5, 20, 25 # Analog Name Receive Transmit Power Scan AS Squelch TOT RO Admit RxTone TxTone Width 3 Black_FM 443.225 +5 High - - Normal - - - 100.0 100.0 25 diff --git a/examples/md380-generic-norcal-uhf-20161103b.conf b/examples/md380-generic-norcal-uhf-20161103b.conf index c5751f7..ce341dc 100644 --- a/examples/md380-generic-norcal-uhf-20161103b.conf +++ b/examples/md380-generic-norcal-uhf-20161103b.conf @@ -1,6 +1,6 @@ # -# This configuration was generated 2018/08/29 by dmrconfig, -# Version 0.1.32, Copyright (C) 2018 Serge Vakulenko KK6ABQ +# This configuration was generated 2018/08/30 by dmrconfig, +# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Radio: TYT MD-380 Name: noname @@ -8,22 +8,27 @@ ID: 1234 Last Programmed Date: 2016-09-11 21:46:59 CPS Software Version: V01.32 +# Text displayed when the radio powers up. +Welcome Line 1: noname +Welcome Line 2: noDMRid + # Table of digital channels. # 1) Channel number: 1-1000 # 2) Name: up to 16 characters, use '_' instead of space # 3) Receive frequency in MHz # 4) Transmit frequency or +/- offset in MHz -# 5) Transmit power: High, Mid, Low +# 5) Transmit power: High, Low # 6) Scan list: - or index in Scanlist table -# 7) Squelch level: Normal, Tight -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Color -# 11) Color code: 1, 2, 3... 15 -# 12) Time slot: 1 or 2 -# 13) In call criteria: -, Admit, TXInt -# 14) Receive group list: - or index in Grouplist table -# 15) Contact for transmit: - or index in Contacts table +# 7) Autoscan flag: -, + +# 8) Squelch level: Normal, Tight +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Color +# 12) Color code: 1, 2, 3... 15 +# 13) Time slot: 1 or 2 +# 14) In call criteria: -, Admit, TXInt +# 15) Receive group list: - or index in Grouplist table +# 16) Contact for transmit: - or index in Contacts table # Digital Name Receive Transmit Power Scan AS Squelch TOT RO Admit Color Slot InCall RxGL TxContact 1 PAARA_(SJ)_w6otx 444.475 +5 High 1 + Normal 90 - Color 1 2 - 2 1 @@ -954,15 +959,16 @@ Digital Name Receive Transmit Power Scan AS Squelch TOT RO Admit # 2) Name: up to 16 characters, use '_' instead of space # 3) Receive frequency in MHz # 4) Transmit frequency or +/- offset in MHz -# 5) Transmit power: High, Mid, Low +# 5) Transmit power: High, Low # 6) Scan list: - or index -# 7) Squelch level: Normal, Tight -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Tone -# 11) Guard tone for receive, or '-' to disable -# 12) Guard tone for transmit, or '-' to disable -# 13) Bandwidth in kHz: 12.5, 20, 25 +# 7) Autoscan flag: -, + +# 8) Squelch level: Normal, Tight +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Tone +# 12) Guard tone for receive, or '-' to disable +# 13) Guard tone for transmit, or '-' to disable +# 14) Bandwidth in kHz: 12.5, 20, 25 # Analog Name Receive Transmit Power Scan AS Squelch TOT RO Admit RxTone TxTone Width 323 NatlSmplx_446.0 446.000 +0 High 14 - Normal 90 - - - - 25 diff --git a/examples/md380-norcal-brandmeister.conf b/examples/md380-norcal-brandmeister.conf index 7b2407c..7582904 100644 --- a/examples/md380-norcal-brandmeister.conf +++ b/examples/md380-norcal-brandmeister.conf @@ -1,6 +1,6 @@ # -# This configuration was generated 2018/08/29 by dmrconfig, -# Version 0.1.32, Copyright (C) 2018 Serge Vakulenko KK6ABQ +# This configuration was generated 2018/08/30 by dmrconfig, +# Version 0.1.37, Copyright (C) 2018 Serge Vakulenko KK6ABQ # Radio: TYT MD-380 Name: MYCALL @@ -8,22 +8,27 @@ ID: 1234 Last Programmed Date: 2016-10-20 17:49:09 CPS Software Version: V01.32 +# Text displayed when the radio powers up. +Welcome Line 1: MYCALL +Welcome Line 2: MYNAME + # Table of digital channels. # 1) Channel number: 1-1000 # 2) Name: up to 16 characters, use '_' instead of space # 3) Receive frequency in MHz # 4) Transmit frequency or +/- offset in MHz -# 5) Transmit power: High, Mid, Low +# 5) Transmit power: High, Low # 6) Scan list: - or index in Scanlist table -# 7) Squelch level: Normal, Tight -# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 -# 9) Receive only: -, + -# 10) Admit criteria: -, Free, Color -# 11) Color code: 1, 2, 3... 15 -# 12) Time slot: 1 or 2 -# 13) In call criteria: -, Admit, TXInt -# 14) Receive group list: - or index in Grouplist table -# 15) Contact for transmit: - or index in Contacts table +# 7) Autoscan flag: -, + +# 8) Squelch level: Normal, Tight +# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555 +# 10) Receive only: -, + +# 11) Admit criteria: -, Free, Color +# 12) Color code: 1, 2, 3... 15 +# 13) Time slot: 1 or 2 +# 14) In call criteria: -, Admit, TXInt +# 15) Receive group list: - or index in Grouplist table +# 16) Contact for transmit: - or index in Contacts table # Digital Name Receive Transmit Power Scan AS Squelch TOT RO Admit Color Slot InCall RxGL TxContact 1 K6ACR_MB_CA 444.7875 +5 High 14 + Normal 60 - Color 1 1 - 1 9 diff --git a/main.c b/main.c index 0bcf7ab..20f5b2e 100644 --- a/main.c +++ b/main.c @@ -140,7 +140,6 @@ int main(int argc, char **argv) // Print configuration from image file. // Load image from file. radio_read_image(argv[0]); - radio_print_version(stdout); radio_print_config(stdout, ! isatty(1)); } else { @@ -159,7 +158,6 @@ int main(int argc, char **argv) perror(filename); exit(-1); } - radio_print_version(conf); radio_print_config(conf, 1); fclose(conf); } diff --git a/md380.c b/md380.c index 4adea7c..4e7bd34 100644 --- a/md380.c +++ b/md380.c @@ -113,6 +113,7 @@ typedef struct { #define ADMIT_ALWAYS 0 #define ADMIT_CH_FREE 1 #define ADMIT_TONE 2 +#define ADMIT_COLOR 3 // Byte 5 uint8_t _unused5 : 4, // 0 @@ -324,7 +325,20 @@ static const char *SIGNALING_SYSTEM[] = { "-", "DTMF-1", "DTMF-2", "DTMF-3", "DT // static void md380_print_version(radio_device_t *radio, FILE *out) { - // Nothing to print. + unsigned char *timestamp = &radio_mem[OFFSET_TIMESTMP]; + static const char charmap[16] = "0123456789:;<=>?"; + + if (*timestamp != 0xff) { + fprintf(out, "Last Programmed Date: %d%d%d%d-%d%d-%d%d", + timestamp[0] >> 4, timestamp[0] & 15, timestamp[1] >> 4, timestamp[1] & 15, + timestamp[2] >> 4, timestamp[2] & 15, timestamp[3] >> 4, timestamp[3] & 15); + fprintf(out, " %d%d:%d%d:%d%d\n", + timestamp[4] >> 4, timestamp[4] & 15, timestamp[5] >> 4, timestamp[5] & 15, + timestamp[6] >> 4, timestamp[6] & 15); + fprintf(out, "CPS Software Version: V%c%c.%c%c\n", + charmap[timestamp[7] & 15], charmap[timestamp[8] & 15], + charmap[timestamp[9] & 15], charmap[timestamp[10] & 15]); + } } // @@ -407,15 +421,14 @@ static void print_freq(FILE *out, unsigned data) } } -#if 0 // // Check that the radio does support this frequency. // static int is_valid_frequency(int mhz) { - if (mhz >= 108 && mhz <= 520) + if (mhz >= 136 && mhz <= 174) return 1; - if (mhz >= 700 && mhz <= 999) + if (mhz >= 400 && mhz <= 480) return 1; return 0; } @@ -423,11 +436,13 @@ static int is_valid_frequency(int mhz) // // Set the parameters for a given memory channel. // -static void setup_channel(int i, char *name, double rx_mhz, double tx_mhz, - int tmode, int power, int wide, int scan, int isam) +static void setup_channel(int i, int mode, char *name, double rx_mhz, double tx_mhz, + int power, int scanlist, int autoscan, int squelch, int tot, int rxonly, + int admit, int colorcode, int timeslot, int incall, int grouplist, int contact) { //TODO: always set Data Call Confirmed=1 (wait for SMS acknowledge) //TODO: always set talkaround=0 +#if 0 memory_channel_t *ch = i + (memory_channel_t*) &radio_mem[OFFSET_CHANNELS]; hz_to_freq((int) (rx_mhz * 1000000.0), ch->rxfreq); @@ -467,8 +482,8 @@ static void setup_channel(int i, char *name, double rx_mhz, double tx_mhz, *scan_data |= scan << scan_shift; encode_name(i, name); -} #endif +} // // Convert a 4-byte frequency value from binary coded decimal @@ -583,8 +598,6 @@ static void print_id(FILE *out) { general_settings_t *gs = (general_settings_t*) &radio_mem[OFFSET_SETTINGS]; unsigned id = gs->radio_id[0] | (gs->radio_id[1] << 8) | (gs->radio_id[2] << 16); - unsigned char *timestamp = &radio_mem[OFFSET_TIMESTMP]; - static const char charmap[16] = "0123456789:;<=>?"; fprintf(out, "Name: "); if (gs->radio_name[0] != 0 && gs->radio_name[0] != 0xffff) { @@ -593,18 +606,6 @@ static void print_id(FILE *out) fprintf(out, "-"); } fprintf(out, "\nID: %u\n", id); - - if (*timestamp != 0xff) { - fprintf(out, "Last Programmed Date: %d%d%d%d-%d%d-%d%d", - timestamp[0] >> 4, timestamp[0] & 15, timestamp[1] >> 4, timestamp[1] & 15, - timestamp[2] >> 4, timestamp[2] & 15, timestamp[3] >> 4, timestamp[3] & 15); - fprintf(out, " %d%d:%d%d:%d%d\n", - timestamp[4] >> 4, timestamp[4] & 15, timestamp[5] >> 4, timestamp[5] & 15, - timestamp[6] >> 4, timestamp[6] & 15); - fprintf(out, "CPS Software Version: V%c%c.%c%c\n", - charmap[timestamp[7] & 15], charmap[timestamp[8] & 15], - charmap[timestamp[9] & 15], charmap[timestamp[10] & 15]); - } } static void print_intro(FILE *out) @@ -751,17 +752,18 @@ static void print_digital_channels(FILE *out, int verbose) fprintf(out, "# 2) Name: up to 16 characters, use '_' instead of space\n"); fprintf(out, "# 3) Receive frequency in MHz\n"); fprintf(out, "# 4) Transmit frequency or +/- offset in MHz\n"); - fprintf(out, "# 5) Transmit power: High, Mid, Low\n"); + fprintf(out, "# 5) Transmit power: High, Low\n"); fprintf(out, "# 6) Scan list: - or index in Scanlist table\n"); - fprintf(out, "# 7) Squelch level: Normal, Tight\n"); - fprintf(out, "# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555\n"); - fprintf(out, "# 9) Receive only: -, +\n"); - fprintf(out, "# 10) Admit criteria: -, Free, Color\n"); - fprintf(out, "# 11) Color code: 1, 2, 3... 15\n"); - fprintf(out, "# 12) Time slot: 1 or 2\n"); - fprintf(out, "# 13) In call criteria: -, Admit, TXInt\n"); - fprintf(out, "# 14) Receive group list: - or index in Grouplist table\n"); - fprintf(out, "# 15) Contact for transmit: - or index in Contacts table\n"); + fprintf(out, "# 7) Autoscan flag: -, +\n"); + fprintf(out, "# 8) Squelch level: Normal, Tight\n"); + fprintf(out, "# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555\n"); + fprintf(out, "# 10) Receive only: -, +\n"); + fprintf(out, "# 11) Admit criteria: -, Free, Color\n"); + fprintf(out, "# 12) Color code: 1, 2, 3... 15\n"); + fprintf(out, "# 13) Time slot: 1 or 2\n"); + fprintf(out, "# 14) In call criteria: -, Admit, TXInt\n"); + fprintf(out, "# 15) Receive group list: - or index in Grouplist table\n"); + fprintf(out, "# 16) Contact for transmit: - or index in Contacts table\n"); fprintf(out, "#\n"); } fprintf(out, "Digital Name Receive Transmit Power Scan AS Squelch TOT RO Admit Color Slot InCall RxGL TxContact"); @@ -841,15 +843,16 @@ static void print_analog_channels(FILE *out, int verbose) fprintf(out, "# 2) Name: up to 16 characters, use '_' instead of space\n"); fprintf(out, "# 3) Receive frequency in MHz\n"); fprintf(out, "# 4) Transmit frequency or +/- offset in MHz\n"); - fprintf(out, "# 5) Transmit power: High, Mid, Low\n"); + fprintf(out, "# 5) Transmit power: High, Low\n"); fprintf(out, "# 6) Scan list: - or index\n"); - fprintf(out, "# 7) Squelch level: Normal, Tight\n"); - fprintf(out, "# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555\n"); - fprintf(out, "# 9) Receive only: -, +\n"); - fprintf(out, "# 10) Admit criteria: -, Free, Tone\n"); - fprintf(out, "# 11) Guard tone for receive, or '-' to disable\n"); - fprintf(out, "# 12) Guard tone for transmit, or '-' to disable\n"); - fprintf(out, "# 13) Bandwidth in kHz: 12.5, 20, 25\n"); + fprintf(out, "# 7) Autoscan flag: -, +\n"); + fprintf(out, "# 8) Squelch level: Normal, Tight\n"); + fprintf(out, "# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555\n"); + fprintf(out, "# 10) Receive only: -, +\n"); + fprintf(out, "# 11) Admit criteria: -, Free, Tone\n"); + fprintf(out, "# 12) Guard tone for receive, or '-' to disable\n"); + fprintf(out, "# 13) Guard tone for transmit, or '-' to disable\n"); + fprintf(out, "# 14) Bandwidth in kHz: 12.5, 20, 25\n"); fprintf(out, "#\n"); } fprintf(out, "Analog Name Receive Transmit Power Scan AS Squelch TOT RO Admit RxTone TxTone Width"); @@ -936,6 +939,8 @@ static void md380_print_config(radio_device_t *radio, FILE *out, int verbose) fprintf(out, "Radio: %s\n", radio->name); print_id(out); + if (verbose) + md380_print_version(radio, out); print_intro(out); // @@ -1227,24 +1232,160 @@ static void md380_parse_parameter(radio_device_t *radio, char *param, char *valu // Start_flag is 1 for the first table row. // Return 0 on failure. // -static int parse_digital_channel(int first_row, char *line) +static int parse_digital_channel(radio_device_t *radio, int first_row, char *line) { - //TODO: parse digital channel Name - //TODO: parse digital channel Receive - //TODO: parse digital channel Transmit - //TODO: parse digital channel Power - //TODO: parse digital channel Scan - //TODO: parse digital channel AS - //TODO: parse digital channel Sq - //TODO: parse digital channel TOT - //TODO: parse digital channel RO - //TODO: parse digital channel Admit - //TODO: parse digital channel Color - //TODO: parse digital channel Slot - //TODO: parse digital channel InCall - //TODO: parse digital channel RxGL - //TODO: parse digital channel TxContact - return 0; + char num_str[256], name_str[256], rxfreq_str[256], offset_str[256]; + char power_str[256], scanlist_str[256], autoscan_str[256], squelch_str[256]; + char tot_str[256], rxonly_str[256], admit_str[256], colorcode_str[256]; + char slot_str[256], incall_str[256], grouplist_str[256], contact_str[256]; + int num, power, scanlist, autoscan, squelch, tot, rxonly, admit; + int colorcode, timeslot, incall, grouplist, contact; + double rx_mhz, tx_mhz; + + if (sscanf(line, "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s", + num_str, name_str, rxfreq_str, offset_str, + power_str, scanlist_str, autoscan_str, squelch_str, + tot_str, rxonly_str, admit_str, colorcode_str, + slot_str, incall_str, grouplist_str, contact_str) != 16) + return 0; + + num = atoi(num_str); + if (num < 1 || num > NCHAN) { + fprintf(stderr, "Bad channel number.\n"); + return 0; + } + + if (sscanf(rxfreq_str, "%lf", &rx_mhz) != 1 || + !is_valid_frequency(rx_mhz)) { + fprintf(stderr, "Bad receive frequency.\n"); + return 0; + } + if (sscanf(offset_str, "%lf", &tx_mhz) != 1) { +badtx: fprintf(stderr, "Bad transmit frequency.\n"); + return 0; + } + if (offset_str[0] == '-' || offset_str[0] == '+') + tx_mhz += rx_mhz; + if (! is_valid_frequency(tx_mhz)) + goto badtx; + + if (strcasecmp("High", power_str) == 0) { + power = POWER_HIGH; + } else if (strcasecmp("Low", power_str) == 0) { + power = POWER_LOW; + } else { + fprintf(stderr, "Bad power level.\n"); + return 0; + } + + if (*scanlist_str == '-') { + scanlist = 0; + } else { + scanlist = atoi(scanlist_str); + if (scanlist == 0 || scanlist > NSCANL) { + fprintf(stderr, "Bad scanlist.\n"); + return 0; + } + } + + if (*autoscan_str == '-') { + autoscan = 0; + } else if (*autoscan_str == '+') { + autoscan = 1; + } else { + fprintf(stderr, "Bad autoscan flag.\n"); + return 0; + } + + squelch = atoi(squelch_str); + if (squelch > 9) { + fprintf(stderr, "Bad squelch level.\n"); + return 0; + } + + tot = atoi(tot_str); + if (tot > 37) { + fprintf(stderr, "Bad timeout timer.\n"); + return 0; + } + tot *= 15; + + if (*rxonly_str == '-') { + rxonly = 0; + } else if (*rxonly_str == '+') { + rxonly = 1; + } else { + fprintf(stderr, "Bad receive only flag.\n"); + return 0; + } + + if (*admit_str == '-' || strcasecmp("Always", admit_str) == 0) { + admit = ADMIT_ALWAYS; + } else if (strcasecmp("Free", admit_str) == 0) { + admit = ADMIT_CH_FREE; + } else if (strcasecmp("Color", admit_str) == 0) { + admit = ADMIT_COLOR; + } else { + fprintf(stderr, "Bad admit criteria.\n"); + return 0; + } + + colorcode = atoi(colorcode_str); + if (colorcode < 1 || colorcode > 15) { + fprintf(stderr, "Bad color code.\n"); + return 0; + } + + timeslot = atoi(slot_str); + if (timeslot < 1 || timeslot > 2) { + fprintf(stderr, "Bad timeslot.\n"); + return 0; + } + + if (*incall_str == '-' || strcasecmp("Always", incall_str) == 0) { + incall = INCALL_ALWAYS; + } else if (strcasecmp("Admit", incall_str) == 0) { + incall = INCALL_ADMIT; + } else { + fprintf(stderr, "Bad incall criteria.\n"); + return 0; + } + + if (*grouplist_str == '-') { + grouplist = 0; + } else { + grouplist = atoi(grouplist_str); + if (grouplist == 0 || grouplist > NGLISTS) { + fprintf(stderr, "Bad receive grouplist.\n"); + return 0; + } + } + + if (*contact_str == '-') { + contact = 0; + } else { + contact = atoi(contact_str); + if (contact == 0 || contact > NCONTACTS) { + fprintf(stderr, "Bad transmit contact.\n"); + return 0; + } + } + + if (first_row && radio->channel_count == 0) { + // On first entry, erase the channel table. + int i; + for (i=0; ichannel_count++; + return 1; } // @@ -1252,7 +1393,7 @@ static int parse_digital_channel(int first_row, char *line) // Start_flag is 1 for the first table row. // Return 0 on failure. // -static int parse_analog_channel(int first_row, char *line) +static int parse_analog_channel(radio_device_t *radio, int first_row, char *line) { #if 1 //TODO: parse analog channel Name @@ -1339,16 +1480,17 @@ badtx: fprintf(stderr, "Bad transmit frequency.\n"); return 0; } - if (first_row) { + if (first_row && radio->channel_count == 0) { // On first entry, erase the channel table. int i; for (i=0; ichannel_count++; return 1; #endif } @@ -1490,8 +1632,8 @@ static int md380_parse_header(radio_device_t *radio, char *line) static int md380_parse_row(radio_device_t *radio, int table_id, int first_row, char *line) { switch (table_id) { - case 'D': return parse_digital_channel(first_row, line); - case 'A': return parse_analog_channel(first_row, line); + case 'D': return parse_digital_channel(radio, first_row, line); + case 'A': return parse_analog_channel(radio, first_row, line); case 'Z': return parse_zones(first_row, line); case 'S': return parse_scanlist(first_row, line); case 'C': return parse_contact(first_row, line); diff --git a/radio.c b/radio.c index 936efa2..7be74a6 100644 --- a/radio.c +++ b/radio.c @@ -194,6 +194,7 @@ void radio_parse_config(char *filename) exit(-1); } + device->channel_count = 0; while (fgets(line, sizeof(line), conf)) { line[sizeof(line)-1] = 0; diff --git a/radio.h b/radio.h index 6f80843..1de546b 100644 --- a/radio.h +++ b/radio.h @@ -89,6 +89,7 @@ struct _radio_device_t { int (*parse_header)(radio_device_t *radio, char *line); int (*parse_row)(radio_device_t *radio, int table_id, int first_row, char *line); void (*update_timestamp)(radio_device_t *radio); + int channel_count; }; extern radio_device_t radio_md380; // TYT MD-380 diff --git a/util.c b/util.c index 7bf3ad6..fcd5bba 100644 --- a/util.c +++ b/util.c @@ -271,11 +271,18 @@ int utf8_to_unicode(const char **p) // // Decode UTF-8 string into UCS-2 string, at most nsym characters. +// Replace underscore by space. // void utf8_decode(unsigned short *dst, const char *src, unsigned nsym) { for (; nsym > 0; nsym--) { - if ((*dst++ = utf8_to_unicode(&src)) == 0) { + int ch = utf8_to_unicode(&src); + + if (ch == '_') + ch = ' '; + *dst++ = ch; + + if (ch == 0) { // Clear the remaining bytes. while (--nsym > 0) *dst++ = 0; diff --git a/uv380.c b/uv380.c index d112964..04ea1d1 100644 --- a/uv380.c +++ b/uv380.c @@ -106,6 +106,7 @@ typedef struct { #define ADMIT_ALWAYS 0 #define ADMIT_CH_FREE 1 #define ADMIT_TONE 2 +#define ADMIT_COLOR 3 // Byte 5 uint8_t _unused7 : 4, // 0 @@ -342,7 +343,20 @@ static const char *TURNOFF_FREQ[] = { "259.2", "55.2", "???", "-" }; // static void uv380_print_version(radio_device_t *radio, FILE *out) { - // Nothing to print. + unsigned char *timestamp = &radio_mem[OFFSET_TIMESTMP]; + static const char charmap[16] = "0123456789:;<=>?"; + + if (*timestamp != 0xff) { + fprintf(out, "Last Programmed Date: %d%d%d%d-%d%d-%d%d", + timestamp[0] >> 4, timestamp[0] & 15, timestamp[1] >> 4, timestamp[1] & 15, + timestamp[2] >> 4, timestamp[2] & 15, timestamp[3] >> 4, timestamp[3] & 15); + fprintf(out, " %d%d:%d%d:%d%d\n", + timestamp[4] >> 4, timestamp[4] & 15, timestamp[5] >> 4, timestamp[5] & 15, + timestamp[6] >> 4, timestamp[6] & 15); + fprintf(out, "CPS Software Version: V%c%c.%c%c\n", + charmap[timestamp[7] & 15], charmap[timestamp[8] & 15], + charmap[timestamp[9] & 15], charmap[timestamp[10] & 15]); + } } // @@ -423,15 +437,14 @@ static void print_freq(FILE *out, unsigned data) } } -#if 0 // // Check that the radio does support this frequency. // static int is_valid_frequency(int mhz) { - if (mhz >= 108 && mhz <= 520) + if (mhz >= 136 && mhz <= 174) return 1; - if (mhz >= 700 && mhz <= 999) + if (mhz >= 400 && mhz <= 480) return 1; return 0; } @@ -439,11 +452,13 @@ static int is_valid_frequency(int mhz) // // Set the parameters for a given memory channel. // -static void setup_channel(int i, char *name, double rx_mhz, double tx_mhz, - int tmode, int power, int wide, int scan, int isam) +static void setup_channel(int i, int mode, char *name, double rx_mhz, double tx_mhz, + int power, int scanlist, int autoscan, int squelch, int tot, int rxonly, + int admit, int colorcode, int timeslot, int incall, int grouplist, int contact) { //TODO: always set Data Call Confirmed=1 (wait for SMS acknowledge) //TODO: always set talkaround=0 +#if 0 memory_channel_t *ch = i + (memory_channel_t*) &radio_mem[OFFSET_CHANNELS]; hz_to_freq((int) (rx_mhz * 1000000.0), ch->rxfreq); @@ -483,8 +498,8 @@ static void setup_channel(int i, char *name, double rx_mhz, double tx_mhz, *scan_data |= scan << scan_shift; encode_name(i, name); -} #endif +} // // Convert a 4-byte frequency value from binary coded decimal @@ -599,8 +614,6 @@ static void print_id(FILE *out) { general_settings_t *gs = (general_settings_t*) &radio_mem[OFFSET_SETTINGS]; unsigned id = gs->radio_id[0] | (gs->radio_id[1] << 8) | (gs->radio_id[2] << 16); - unsigned char *timestamp = &radio_mem[OFFSET_TIMESTMP]; - static const char charmap[16] = "0123456789:;<=>?"; fprintf(out, "Name: "); if (gs->radio_name[0] != 0 && gs->radio_name[0] != 0xffff) { @@ -609,18 +622,6 @@ static void print_id(FILE *out) fprintf(out, "-"); } fprintf(out, "\nID: %u\n", id); - - if (*timestamp != 0xff) { - fprintf(out, "Last Programmed Date: %d%d%d%d-%d%d-%d%d", - timestamp[0] >> 4, timestamp[0] & 15, timestamp[1] >> 4, timestamp[1] & 15, - timestamp[2] >> 4, timestamp[2] & 15, timestamp[3] >> 4, timestamp[3] & 15); - fprintf(out, " %d%d:%d%d:%d%d\n", - timestamp[4] >> 4, timestamp[4] & 15, timestamp[5] >> 4, timestamp[5] & 15, - timestamp[6] >> 4, timestamp[6] & 15); - fprintf(out, "CPS Software Version: V%c%c.%c%c\n", - charmap[timestamp[7] & 15], charmap[timestamp[8] & 15], - charmap[timestamp[9] & 15], charmap[timestamp[10] & 15]); - } } static void print_intro(FILE *out) @@ -771,15 +772,16 @@ static void print_digital_channels(FILE *out, int verbose) fprintf(out, "# 4) Transmit frequency or +/- offset in MHz\n"); fprintf(out, "# 5) Transmit power: High, Mid, Low\n"); fprintf(out, "# 6) Scan list: - or index in Scanlist table\n"); - fprintf(out, "# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n"); - fprintf(out, "# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555\n"); - fprintf(out, "# 9) Receive only: -, +\n"); - fprintf(out, "# 10) Admit criteria: -, Free, Color\n"); - fprintf(out, "# 11) Color code: 1, 2, 3... 15\n"); - fprintf(out, "# 12) Time slot: 1 or 2\n"); - fprintf(out, "# 13) In call criteria: -, Admit, TXInt\n"); - fprintf(out, "# 14) Receive group list: - or index in Grouplist table\n"); - fprintf(out, "# 15) Contact for transmit: - or index in Contacts table\n"); + fprintf(out, "# 7) Autoscan flag: -, +\n"); + fprintf(out, "# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n"); + fprintf(out, "# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555\n"); + fprintf(out, "# 10) Receive only: -, +\n"); + fprintf(out, "# 11) Admit criteria: -, Free, Color\n"); + fprintf(out, "# 12) Color code: 1, 2, 3... 15\n"); + fprintf(out, "# 13) Time slot: 1 or 2\n"); + fprintf(out, "# 14) In call criteria: -, Admit, TXInt\n"); + fprintf(out, "# 15) Receive group list: - or index in Grouplist table\n"); + fprintf(out, "# 16) Contact for transmit: - or index in Contacts table\n"); fprintf(out, "#\n"); } fprintf(out, "Digital Name Receive Transmit Power Scan AS Sq TOT RO Admit Color Slot InCall RxGL TxContact"); @@ -865,13 +867,14 @@ static void print_analog_channels(FILE *out, int verbose) fprintf(out, "# 4) Transmit frequency or +/- offset in MHz\n"); fprintf(out, "# 5) Transmit power: High, Mid, Low\n"); fprintf(out, "# 6) Scan list: - or index\n"); - fprintf(out, "# 7) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n"); - fprintf(out, "# 8) Transmit timeout timer in seconds: 0, 15, 30, 45... 555\n"); - fprintf(out, "# 9) Receive only: -, +\n"); - fprintf(out, "# 10) Admit criteria: -, Free, Tone\n"); - fprintf(out, "# 11) Guard tone for receive, or '-' to disable\n"); - fprintf(out, "# 12) Guard tone for transmit, or '-' to disable\n"); - fprintf(out, "# 13) Bandwidth in kHz: 12.5, 20, 25\n"); + fprintf(out, "# 7) Autoscan flag: -, +\n"); + fprintf(out, "# 8) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n"); + fprintf(out, "# 9) Transmit timeout timer in seconds: 0, 15, 30, 45... 555\n"); + fprintf(out, "# 10) Receive only: -, +\n"); + fprintf(out, "# 11) Admit criteria: -, Free, Tone\n"); + fprintf(out, "# 12) Guard tone for receive, or '-' to disable\n"); + fprintf(out, "# 13) Guard tone for transmit, or '-' to disable\n"); + fprintf(out, "# 14) Bandwidth in kHz: 12.5, 20, 25\n"); fprintf(out, "#\n"); } fprintf(out, "Analog Name Receive Transmit Power Scan AS Sq TOT RO Admit RxTone TxTone Width"); @@ -959,6 +962,8 @@ static void uv380_print_config(radio_device_t *radio, FILE *out, int verbose) fprintf(out, "Radio: %s\n", radio->name); print_id(out); + if (verbose) + uv380_print_version(radio, out); print_intro(out); // @@ -1270,24 +1275,164 @@ static void uv380_parse_parameter(radio_device_t *radio, char *param, char *valu // Start_flag is 1 for the first table row. // Return 0 on failure. // -static int parse_digital_channel(int first_row, char *line) +static int parse_digital_channel(radio_device_t *radio, int first_row, char *line) { - //TODO: parse digital channel Name - //TODO: parse digital channel Receive - //TODO: parse digital channel Transmit - //TODO: parse digital channel Power - //TODO: parse digital channel Scan - //TODO: parse digital channel AS - //TODO: parse digital channel Sq - //TODO: parse digital channel TOT - //TODO: parse digital channel RO - //TODO: parse digital channel Admit - //TODO: parse digital channel Color - //TODO: parse digital channel Slot - //TODO: parse digital channel InCall - //TODO: parse digital channel RxGL - //TODO: parse digital channel TxContact - return 0; + char num_str[256], name_str[256], rxfreq_str[256], offset_str[256]; + char power_str[256], scanlist_str[256], autoscan_str[256], squelch_str[256]; + char tot_str[256], rxonly_str[256], admit_str[256], colorcode_str[256]; + char slot_str[256], incall_str[256], grouplist_str[256], contact_str[256]; + int num, power, scanlist, autoscan, squelch, tot, rxonly, admit; + int colorcode, timeslot, incall, grouplist, contact; + double rx_mhz, tx_mhz; + + if (sscanf(line, "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s", + num_str, name_str, rxfreq_str, offset_str, + power_str, scanlist_str, autoscan_str, squelch_str, + tot_str, rxonly_str, admit_str, colorcode_str, + slot_str, incall_str, grouplist_str, contact_str) != 16) + return 0; + + num = atoi(num_str); + if (num < 1 || num > NCHAN) { + fprintf(stderr, "Bad channel number.\n"); + return 0; + } + + if (sscanf(rxfreq_str, "%lf", &rx_mhz) != 1 || + !is_valid_frequency(rx_mhz)) { + fprintf(stderr, "Bad receive frequency.\n"); + return 0; + } + if (sscanf(offset_str, "%lf", &tx_mhz) != 1) { +badtx: fprintf(stderr, "Bad transmit frequency.\n"); + return 0; + } + if (offset_str[0] == '-' || offset_str[0] == '+') + tx_mhz += rx_mhz; + if (! is_valid_frequency(tx_mhz)) + goto badtx; + + if (strcasecmp("High", power_str) == 0) { + power = POWER_HIGH; + } else if (strcasecmp("Mid", power_str) == 0) { + power = POWER_MIDDLE; + } else if (strcasecmp("Low", power_str) == 0) { + power = POWER_LOW; + } else { + fprintf(stderr, "Bad power level.\n"); + return 0; + } + + if (*scanlist_str == '-') { + scanlist = 0; + } else { + scanlist = atoi(scanlist_str); + if (scanlist == 0 || scanlist > NSCANL) { + fprintf(stderr, "Bad scanlist.\n"); + return 0; + } + } + + if (*autoscan_str == '-') { + autoscan = 0; + } else if (*autoscan_str == '+') { + autoscan = 1; + } else { + fprintf(stderr, "Bad autoscan flag.\n"); + return 0; + } + + squelch = atoi(squelch_str); + if (squelch > 9) { + fprintf(stderr, "Bad squelch level.\n"); + return 0; + } + + tot = atoi(tot_str); + if (tot > 37) { + fprintf(stderr, "Bad timeout timer.\n"); + return 0; + } + tot *= 15; + + if (*rxonly_str == '-') { + rxonly = 0; + } else if (*rxonly_str == '+') { + rxonly = 1; + } else { + fprintf(stderr, "Bad receive only flag.\n"); + return 0; + } + + if (*admit_str == '-' || strcasecmp("Always", admit_str) == 0) { + admit = ADMIT_ALWAYS; + } else if (strcasecmp("Free", admit_str) == 0) { + admit = ADMIT_CH_FREE; + } else if (strcasecmp("Color", admit_str) == 0) { + admit = ADMIT_COLOR; + } else { + fprintf(stderr, "Bad admit criteria.\n"); + return 0; + } + + colorcode = atoi(colorcode_str); + if (colorcode < 1 || colorcode > 15) { + fprintf(stderr, "Bad color code.\n"); + return 0; + } + + timeslot = atoi(slot_str); + if (timeslot < 1 || timeslot > 2) { + fprintf(stderr, "Bad timeslot.\n"); + return 0; + } + + if (*incall_str == '-' || strcasecmp("Always", incall_str) == 0) { + incall = INCALL_ALWAYS; + } else if (strcasecmp("Admit", incall_str) == 0) { + incall = INCALL_ADMIT; + } else if (strcasecmp("TXInt", incall_str) == 0) { + incall = INCALL_TXINT; + } else { + fprintf(stderr, "Bad incall criteria.\n"); + return 0; + } + + if (*grouplist_str == '-') { + grouplist = 0; + } else { + grouplist = atoi(grouplist_str); + if (grouplist == 0 || grouplist > NGLISTS) { + fprintf(stderr, "Bad receive grouplist.\n"); + return 0; + } + } + + if (*contact_str == '-') { + contact = 0; + } else { + contact = atoi(contact_str); + if (contact == 0 || contact > NCONTACTS) { + fprintf(stderr, "Bad transmit contact.\n"); + return 0; + } + } + + if (first_row && radio->channel_count == 0) { + // On first entry, erase the channel table. + int i; + for (i=0; ichannel_count++; + return 1; } // @@ -1295,7 +1440,7 @@ static int parse_digital_channel(int first_row, char *line) // Start_flag is 1 for the first table row. // Return 0 on failure. // -static int parse_analog_channel(int first_row, char *line) +static int parse_analog_channel(radio_device_t *radio, int first_row, char *line) { #if 1 //TODO: parse analog channel Name @@ -1382,16 +1527,17 @@ badtx: fprintf(stderr, "Bad transmit frequency.\n"); return 0; } - if (first_row) { + if (first_row && radio->channel_count == 0) { // On first entry, erase the channel table. int i; for (i=0; ichannel_count++; return 1; #endif } @@ -1533,8 +1679,8 @@ static int uv380_parse_header(radio_device_t *radio, char *line) static int uv380_parse_row(radio_device_t *radio, int table_id, int first_row, char *line) { switch (table_id) { - case 'D': return parse_digital_channel(first_row, line); - case 'A': return parse_analog_channel(first_row, line); + case 'D': return parse_digital_channel(radio, first_row, line); + case 'A': return parse_analog_channel(radio, first_row, line); case 'Z': return parse_zones(first_row, line); case 'S': return parse_scanlist(first_row, line); case 'C': return parse_contact(first_row, line);