diff --git a/README.md b/README.md index 9224676..dcf157d 100644 --- a/README.md +++ b/README.md @@ -126,11 +126,6 @@ In the case of analog FM zone names, all repeaters go into the specified zone, s Radius for proximity search (default 25) -tg Only include DMR repeaters that have talkgroups defined (default true) - -tg_source string - One of ('most' 'rfinder' 'details'). - RadioID has two fields that may contain talkgroup info, 'details' and 'rfinder'. - By default dmrfill uses the data from whichever field has the most talkgroups defined. - Selecting 'rfinder' or 'details' uses the named field. (default "most") -units string Distance units for proximity search, one of ('miles' 'km') (default "miles") -v verbose logging diff --git a/codeplug.go b/codeplug.go index dd76dde..6310d16 100644 --- a/codeplug.go +++ b/codeplug.go @@ -10,227 +10,227 @@ import ( type Codeplug struct { Version string `yaml:"version"` Settings struct { - IntroLine1 string `yaml:"introLine1"` - IntroLine2 string `yaml:"introLine2"` - MicLevel int `yaml:"micLevel"` - Speech bool `yaml:"speech"` - Power string `yaml:"power"` - Squelch int `yaml:"squelch"` - Vox int `yaml:"vox"` - Tot int `yaml:"tot"` - Anytone struct { - SubChannel bool `yaml:"subChannel"` - SelectedVFO string `yaml:"selectedVFO"` - ModeA string `yaml:"modeA"` - ModeB string `yaml:"modeB"` - VfoScanType string `yaml:"vfoScanType"` - MinVFOScanFrequencyUHF string `yaml:"minVFOScanFrequencyUHF"` - MaxVFOScanFrequencyUHF string `yaml:"maxVFOScanFrequencyUHF"` - MinVFOScanFrequencyVHF string `yaml:"minVFOScanFrequencyVHF"` - MaxVFOScanFrequencyVHF string `yaml:"maxVFOScanFrequencyVHF"` - KeepLastCaller bool `yaml:"keepLastCaller"` - VfoStep string `yaml:"vfoStep"` - SteType string `yaml:"steType"` - SteFrequency int `yaml:"steFrequency"` - SteDuration string `yaml:"steDuration"` - TbstFrequency string `yaml:"tbstFrequency"` - ProMode bool `yaml:"proMode"` - MaintainCallChannel bool `yaml:"maintainCallChannel"` - BootSettings struct { - BootDisplay string `yaml:"bootDisplay"` - BootPasswordEnabled bool `yaml:"bootPasswordEnabled"` - BootPassword string `yaml:"bootPassword"` - DefaultChannel bool `yaml:"defaultChannel"` - GpsCheck bool `yaml:"gpsCheck"` - Reset bool `yaml:"reset"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"bootSettings"` - PowerSaveSettings struct { - AutoShutdown int `yaml:"autoShutdown"` - ResetAutoShutdownOnCall bool `yaml:"resetAutoShutdownOnCall"` - PowerSave string `yaml:"powerSave"` - Atpc bool `yaml:"atpc"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"powerSaveSettings"` - KeySettings struct { - FuncKey1Short string `yaml:"funcKey1Short"` - FuncKey1Long string `yaml:"funcKey1Long"` - FuncKey2Short string `yaml:"funcKey2Short"` - FuncKey2Long string `yaml:"funcKey2Long"` - FuncKey3Short string `yaml:"funcKey3Short"` - FuncKey3Long string `yaml:"funcKey3Long"` - FuncKey4Short string `yaml:"funcKey4Short"` - FuncKey4Long string `yaml:"funcKey4Long"` - FuncKey5Short string `yaml:"funcKey5Short"` - FuncKey5Long string `yaml:"funcKey5Long"` - FuncKey6Short string `yaml:"funcKey6Short"` - FuncKey6Long string `yaml:"funcKey6Long"` - FuncKeyAShort string `yaml:"funcKeyAShort"` - FuncKeyALong string `yaml:"funcKeyALong"` - FuncKeyBShort string `yaml:"funcKeyBShort"` - FuncKeyBLong string `yaml:"funcKeyBLong"` - FuncKeyCShort string `yaml:"funcKeyCShort"` - FuncKeyCLong string `yaml:"funcKeyCLong"` - FuncKeyDShort string `yaml:"funcKeyDShort"` - FuncKeyDLong string `yaml:"funcKeyDLong"` - LongPressDuration string `yaml:"longPressDuration"` - AutoKeyLock bool `yaml:"autoKeyLock"` - KnobLock bool `yaml:"knobLock"` - KeypadLock bool `yaml:"keypadLock"` - SideKeysLock bool `yaml:"sideKeysLock"` - ForcedKeyLock bool `yaml:"forcedKeyLock"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"keySettings"` - ToneSettings struct { - KeyTone bool `yaml:"keyTone"` - KeyToneLevel int `yaml:"keyToneLevel"` - SmsAlert bool `yaml:"smsAlert"` - CallAlert bool `yaml:"callAlert"` - DmrTalkPermit bool `yaml:"dmrTalkPermit"` - DmrReset bool `yaml:"dmrReset"` - FmTalkPermit bool `yaml:"fmTalkPermit"` - DmrIdle bool `yaml:"dmrIdle"` - FmIdle bool `yaml:"fmIdle"` - Startup bool `yaml:"startup"` - Tot bool `yaml:"tot"` - CallMelody struct { - Bpm int `yaml:"bpm"` - Melody string `yaml:"melody"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"callMelody"` - IdleMelody struct { - Bpm int `yaml:"bpm"` - Melody string `yaml:"melody"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"idleMelody"` - ResetMelody struct { - Bpm int `yaml:"bpm"` - Melody string `yaml:"melody"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"resetMelody"` - CallEndMelody struct { - Bpm int `yaml:"bpm"` - Melody string `yaml:"melody"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"callEndMelody"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"toneSettings"` - DisplaySettings struct { - DisplayFrequency bool `yaml:"displayFrequency"` - Brightness int `yaml:"brightness"` - BacklightDuration int `yaml:"backlightDuration"` - BacklightDurationTX int `yaml:"backlightDurationTX"` - BacklightDurationRX int `yaml:"backlightDurationRX"` - CustomChannelBackground bool `yaml:"customChannelBackground"` - VolumeChangePrompt bool `yaml:"volumeChangePrompt"` - CallEndPrompt bool `yaml:"callEndPrompt"` - ShowClock bool `yaml:"showClock"` - ShowCall bool `yaml:"showCall"` - ShowContact bool `yaml:"showContact"` - ShowChannelNumber bool `yaml:"showChannelNumber"` - ShowColorCode bool `yaml:"showColorCode"` - ShowTimeSlot bool `yaml:"showTimeSlot"` - ShowChannelType bool `yaml:"showChannelType"` - ShowLastHeard bool `yaml:"showLastHeard"` - LastCallerDisplay string `yaml:"lastCallerDisplay"` - CallColor string `yaml:"callColor"` - StandbyTextColor string `yaml:"standbyTextColor"` - StandbyBackgroundColor string `yaml:"standbyBackgroundColor"` - ChannelNameColor string `yaml:"channelNameColor"` - ChannelBNameColor string `yaml:"channelBNameColor"` - ZoneNameColor string `yaml:"zoneNameColor"` - ZoneBNameColor string `yaml:"zoneBNameColor"` - Language string `yaml:"language"` - DateFormat string `yaml:"dateFormat"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"displaySettings"` - AudioSettings struct { - VoxDelay string `yaml:"voxDelay"` - VoxSource string `yaml:"voxSource"` - Recording bool `yaml:"recording"` - Enhance bool `yaml:"enhance"` - MuteDelay string `yaml:"muteDelay"` - MaxVolume int `yaml:"maxVolume"` - MaxHeadPhoneVolume int `yaml:"maxHeadPhoneVolume"` - EnableFMMicGain bool `yaml:"enableFMMicGain"` - FmMicGain int `yaml:"fmMicGain"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"audioSettings"` - MenuSettings struct { - Duration string `yaml:"duration"` - Separator bool `yaml:"separator"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"menuSettings"` - AutoRepeaterSettings struct { - DirectionA string `yaml:"directionA"` - DirectionB string `yaml:"directionB"` - VhfMin string `yaml:"vhfMin"` - VhfMax string `yaml:"vhfMax"` - UhfMin string `yaml:"uhfMin"` - UhfMax string `yaml:"uhfMax"` - Vhf2Min string `yaml:"vhf2Min"` - Vhf2Max string `yaml:"vhf2Max"` - Uhf2Min string `yaml:"uhf2Min"` - Uhf2Max string `yaml:"uhf2Max"` - Offsets []interface{} `yaml:"offsets"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"autoRepeaterSettings"` - DmrSettings struct { - GroupCallHangTime string `yaml:"groupCallHangTime"` - ManualGroupCallHangTime string `yaml:"manualGroupCallHangTime"` - PrivateCallHangTime string `yaml:"privateCallHangTime"` - ManualPrivateCallHangTime string `yaml:"manualPrivateCallHangTime"` - PreWaveDelay int `yaml:"preWaveDelay"` - WakeHeadPeriod int `yaml:"wakeHeadPeriod"` - FilterOwnID bool `yaml:"filterOwnID"` - MonitorSlotMatch string `yaml:"monitorSlotMatch"` - MonitorColorCodeMatch bool `yaml:"monitorColorCodeMatch"` - MonitorIDMatch bool `yaml:"monitorIDMatch"` - MonitorTimeSlotHold bool `yaml:"monitorTimeSlotHold"` - SmsFormat string `yaml:"smsFormat"` - SendTalkerAlias bool `yaml:"sendTalkerAlias"` - TalkerAliasSource string `yaml:"talkerAliasSource"` - TalkerAliasEncoding string `yaml:"talkerAliasEncoding"` - Encryption string `yaml:"encryption"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"dmrSettings"` - GpsSettings struct { - Units string `yaml:"units"` - TimeZone string `yaml:"timeZone"` - ReportPosition bool `yaml:"reportPosition"` - UpdatePeriod string `yaml:"updatePeriod"` - Mode string `yaml:"mode"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"gpsSettings"` - RoamingSettings struct { - AutoRoam bool `yaml:"autoRoam"` - AutoRoamPeriod string `yaml:"autoRoamPeriod"` - AutoRoamDelay int `yaml:"autoRoamDelay"` - RoamStart string `yaml:"roamStart"` - RoamReturn string `yaml:"roamReturn"` - RangeCheck bool `yaml:"rangeCheck"` - CheckInterval string `yaml:"checkInterval"` - RetryCount int `yaml:"retryCount"` - OutOfRangeAlert string `yaml:"outOfRangeAlert"` - Notification bool `yaml:"notification"` - NotificationCount int `yaml:"notificationCount"` - GpsRoaming bool `yaml:"gpsRoaming"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"roamingSettings"` - BluetoothSettings struct { - PttLatch bool `yaml:"pttLatch"` - PttSleepTimer int `yaml:"pttSleepTimer"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"bluetoothSettings"` - SimplexRepeaterSettings struct { - Enabled bool `yaml:"enabled"` - Monitor bool `yaml:"monitor"` - TimeSlot string `yaml:"timeSlot"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"simplexRepeaterSettings"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"anytone,omitempty"` - DefaultID string `yaml:"defaultID,omitempty"` + // IntroLine1 string `yaml:"introLine1"` + // IntroLine2 string `yaml:"introLine2"` + // MicLevel int `yaml:"micLevel"` + // Speech bool `yaml:"speech"` + // Power string `yaml:"power"` + // Squelch int `yaml:"squelch"` + // Vox int `yaml:"vox"` + // Tot int `yaml:"tot"` + // Anytone struct { + // SubChannel bool `yaml:"subChannel"` + // SelectedVFO string `yaml:"selectedVFO"` + // ModeA string `yaml:"modeA"` + // ModeB string `yaml:"modeB"` + // VfoScanType string `yaml:"vfoScanType"` + // MinVFOScanFrequencyUHF string `yaml:"minVFOScanFrequencyUHF"` + // MaxVFOScanFrequencyUHF string `yaml:"maxVFOScanFrequencyUHF"` + // MinVFOScanFrequencyVHF string `yaml:"minVFOScanFrequencyVHF"` + // MaxVFOScanFrequencyVHF string `yaml:"maxVFOScanFrequencyVHF"` + // KeepLastCaller bool `yaml:"keepLastCaller"` + // VfoStep string `yaml:"vfoStep"` + // SteType string `yaml:"steType"` + // SteFrequency int `yaml:"steFrequency"` + // SteDuration string `yaml:"steDuration"` + // TbstFrequency string `yaml:"tbstFrequency"` + // ProMode bool `yaml:"proMode"` + // MaintainCallChannel bool `yaml:"maintainCallChannel"` + // BootSettings struct { + // BootDisplay string `yaml:"bootDisplay"` + // BootPasswordEnabled bool `yaml:"bootPasswordEnabled"` + // BootPassword string `yaml:"bootPassword"` + // DefaultChannel bool `yaml:"defaultChannel"` + // GpsCheck bool `yaml:"gpsCheck"` + // Reset bool `yaml:"reset"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"bootSettings"` + // PowerSaveSettings struct { + // AutoShutdown int `yaml:"autoShutdown"` + // ResetAutoShutdownOnCall bool `yaml:"resetAutoShutdownOnCall"` + // PowerSave string `yaml:"powerSave"` + // Atpc bool `yaml:"atpc"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"powerSaveSettings"` + // KeySettings struct { + // FuncKey1Short string `yaml:"funcKey1Short"` + // FuncKey1Long string `yaml:"funcKey1Long"` + // FuncKey2Short string `yaml:"funcKey2Short"` + // FuncKey2Long string `yaml:"funcKey2Long"` + // FuncKey3Short string `yaml:"funcKey3Short"` + // FuncKey3Long string `yaml:"funcKey3Long"` + // FuncKey4Short string `yaml:"funcKey4Short"` + // FuncKey4Long string `yaml:"funcKey4Long"` + // FuncKey5Short string `yaml:"funcKey5Short"` + // FuncKey5Long string `yaml:"funcKey5Long"` + // FuncKey6Short string `yaml:"funcKey6Short"` + // FuncKey6Long string `yaml:"funcKey6Long"` + // FuncKeyAShort string `yaml:"funcKeyAShort"` + // FuncKeyALong string `yaml:"funcKeyALong"` + // FuncKeyBShort string `yaml:"funcKeyBShort"` + // FuncKeyBLong string `yaml:"funcKeyBLong"` + // FuncKeyCShort string `yaml:"funcKeyCShort"` + // FuncKeyCLong string `yaml:"funcKeyCLong"` + // FuncKeyDShort string `yaml:"funcKeyDShort"` + // FuncKeyDLong string `yaml:"funcKeyDLong"` + // LongPressDuration string `yaml:"longPressDuration"` + // AutoKeyLock bool `yaml:"autoKeyLock"` + // KnobLock bool `yaml:"knobLock"` + // KeypadLock bool `yaml:"keypadLock"` + // SideKeysLock bool `yaml:"sideKeysLock"` + // ForcedKeyLock bool `yaml:"forcedKeyLock"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"keySettings"` + // ToneSettings struct { + // KeyTone bool `yaml:"keyTone"` + // KeyToneLevel int `yaml:"keyToneLevel"` + // SmsAlert bool `yaml:"smsAlert"` + // CallAlert bool `yaml:"callAlert"` + // DmrTalkPermit bool `yaml:"dmrTalkPermit"` + // DmrReset bool `yaml:"dmrReset"` + // FmTalkPermit bool `yaml:"fmTalkPermit"` + // DmrIdle bool `yaml:"dmrIdle"` + // FmIdle bool `yaml:"fmIdle"` + // Startup bool `yaml:"startup"` + // Tot bool `yaml:"tot"` + // CallMelody struct { + // Bpm int `yaml:"bpm"` + // Melody string `yaml:"melody"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"callMelody"` + // IdleMelody struct { + // Bpm int `yaml:"bpm"` + // Melody string `yaml:"melody"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"idleMelody"` + // ResetMelody struct { + // Bpm int `yaml:"bpm"` + // Melody string `yaml:"melody"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"resetMelody"` + // CallEndMelody struct { + // Bpm int `yaml:"bpm"` + // Melody string `yaml:"melody"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"callEndMelody"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"toneSettings"` + // DisplaySettings struct { + // DisplayFrequency bool `yaml:"displayFrequency"` + // Brightness int `yaml:"brightness"` + // BacklightDuration int `yaml:"backlightDuration"` + // BacklightDurationTX int `yaml:"backlightDurationTX"` + // BacklightDurationRX int `yaml:"backlightDurationRX"` + // CustomChannelBackground bool `yaml:"customChannelBackground"` + // VolumeChangePrompt bool `yaml:"volumeChangePrompt"` + // CallEndPrompt bool `yaml:"callEndPrompt"` + // ShowClock bool `yaml:"showClock"` + // ShowCall bool `yaml:"showCall"` + // ShowContact bool `yaml:"showContact"` + // ShowChannelNumber bool `yaml:"showChannelNumber"` + // ShowColorCode bool `yaml:"showColorCode"` + // ShowTimeSlot bool `yaml:"showTimeSlot"` + // ShowChannelType bool `yaml:"showChannelType"` + // ShowLastHeard bool `yaml:"showLastHeard"` + // LastCallerDisplay string `yaml:"lastCallerDisplay"` + // CallColor string `yaml:"callColor"` + // StandbyTextColor string `yaml:"standbyTextColor"` + // StandbyBackgroundColor string `yaml:"standbyBackgroundColor"` + // ChannelNameColor string `yaml:"channelNameColor"` + // ChannelBNameColor string `yaml:"channelBNameColor"` + // ZoneNameColor string `yaml:"zoneNameColor"` + // ZoneBNameColor string `yaml:"zoneBNameColor"` + // Language string `yaml:"language"` + // DateFormat string `yaml:"dateFormat"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"displaySettings"` + // AudioSettings struct { + // VoxDelay string `yaml:"voxDelay"` + // VoxSource string `yaml:"voxSource"` + // Recording bool `yaml:"recording"` + // Enhance bool `yaml:"enhance"` + // MuteDelay string `yaml:"muteDelay"` + // MaxVolume int `yaml:"maxVolume"` + // MaxHeadPhoneVolume int `yaml:"maxHeadPhoneVolume"` + // EnableFMMicGain bool `yaml:"enableFMMicGain"` + // FmMicGain int `yaml:"fmMicGain"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"audioSettings"` + // MenuSettings struct { + // Duration string `yaml:"duration"` + // Separator bool `yaml:"separator"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"menuSettings"` + // AutoRepeaterSettings struct { + // DirectionA string `yaml:"directionA"` + // DirectionB string `yaml:"directionB"` + // VhfMin string `yaml:"vhfMin"` + // VhfMax string `yaml:"vhfMax"` + // UhfMin string `yaml:"uhfMin"` + // UhfMax string `yaml:"uhfMax"` + // Vhf2Min string `yaml:"vhf2Min"` + // Vhf2Max string `yaml:"vhf2Max"` + // Uhf2Min string `yaml:"uhf2Min"` + // Uhf2Max string `yaml:"uhf2Max"` + // Offsets []interface{} `yaml:"offsets"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"autoRepeaterSettings"` + // DmrSettings struct { + // GroupCallHangTime string `yaml:"groupCallHangTime"` + // ManualGroupCallHangTime string `yaml:"manualGroupCallHangTime"` + // PrivateCallHangTime string `yaml:"privateCallHangTime"` + // ManualPrivateCallHangTime string `yaml:"manualPrivateCallHangTime"` + // PreWaveDelay int `yaml:"preWaveDelay"` + // WakeHeadPeriod int `yaml:"wakeHeadPeriod"` + // FilterOwnID bool `yaml:"filterOwnID"` + // MonitorSlotMatch string `yaml:"monitorSlotMatch"` + // MonitorColorCodeMatch bool `yaml:"monitorColorCodeMatch"` + // MonitorIDMatch bool `yaml:"monitorIDMatch"` + // MonitorTimeSlotHold bool `yaml:"monitorTimeSlotHold"` + // SmsFormat string `yaml:"smsFormat"` + // SendTalkerAlias bool `yaml:"sendTalkerAlias"` + // TalkerAliasSource string `yaml:"talkerAliasSource"` + // TalkerAliasEncoding string `yaml:"talkerAliasEncoding"` + // Encryption string `yaml:"encryption"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"dmrSettings"` + // GpsSettings struct { + // Units string `yaml:"units"` + // TimeZone string `yaml:"timeZone"` + // ReportPosition bool `yaml:"reportPosition"` + // UpdatePeriod string `yaml:"updatePeriod"` + // Mode string `yaml:"mode"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"gpsSettings"` + // RoamingSettings struct { + // AutoRoam bool `yaml:"autoRoam"` + // AutoRoamPeriod string `yaml:"autoRoamPeriod"` + // AutoRoamDelay int `yaml:"autoRoamDelay"` + // RoamStart string `yaml:"roamStart"` + // RoamReturn string `yaml:"roamReturn"` + // RangeCheck bool `yaml:"rangeCheck"` + // CheckInterval string `yaml:"checkInterval"` + // RetryCount int `yaml:"retryCount"` + // OutOfRangeAlert string `yaml:"outOfRangeAlert"` + // Notification bool `yaml:"notification"` + // NotificationCount int `yaml:"notificationCount"` + // GpsRoaming bool `yaml:"gpsRoaming"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"roamingSettings"` + // BluetoothSettings struct { + // PttLatch bool `yaml:"pttLatch"` + // PttSleepTimer int `yaml:"pttSleepTimer"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"bluetoothSettings"` + // SimplexRepeaterSettings struct { + // Enabled bool `yaml:"enabled"` + // Monitor bool `yaml:"monitor"` + // TimeSlot string `yaml:"timeSlot"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"simplexRepeaterSettings"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"anytone,omitempty"` + // DefaultID string `yaml:"defaultID,omitempty"` Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped } `yaml:"settings"` RadioIDs []struct { @@ -247,38 +247,38 @@ type Codeplug struct { Channels []*Channel `yaml:"channels"` Zones []*Zone `yaml:"zones"` Positioning []struct { - Aprs struct { - ID string `yaml:"id"` - Name string `yaml:"name"` - Period int `yaml:"period"` - Icon string `yaml:"icon"` - Message string `yaml:"message"` - Anytone struct { - TxDelay string `yaml:"txDelay"` - PreWaveDelay string `yaml:"preWaveDelay"` - PassAll bool `yaml:"passAll"` - ReportPosition bool `yaml:"reportPosition"` - ReportMicE bool `yaml:"reportMicE"` - ReportObject bool `yaml:"reportObject"` - ReportItem bool `yaml:"reportItem"` - ReportMessage bool `yaml:"reportMessage"` - ReportWeather bool `yaml:"reportWeather"` - ReportNMEA bool `yaml:"reportNMEA"` - ReportStatus bool `yaml:"reportStatus"` - ReportOther bool `yaml:"reportOther"` - Frequencies []struct { - ID string `yaml:"id"` - Name string `yaml:"name"` - Frequency string `yaml:"frequency"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"frequencies"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"anytone"` - Destination string `yaml:"destination"` - Source string `yaml:"source"` - Path []string `yaml:"path,flow"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped - } `yaml:"aprs"` + // Aprs struct { + // ID string `yaml:"id"` + // Name string `yaml:"name"` + // Period int `yaml:"period"` + // Icon string `yaml:"icon"` + // Message string `yaml:"message"` + // Anytone struct { + // TxDelay string `yaml:"txDelay"` + // PreWaveDelay string `yaml:"preWaveDelay"` + // PassAll bool `yaml:"passAll"` + // ReportPosition bool `yaml:"reportPosition"` + // ReportMicE bool `yaml:"reportMicE"` + // ReportObject bool `yaml:"reportObject"` + // ReportItem bool `yaml:"reportItem"` + // ReportMessage bool `yaml:"reportMessage"` + // ReportWeather bool `yaml:"reportWeather"` + // ReportNMEA bool `yaml:"reportNMEA"` + // ReportStatus bool `yaml:"reportStatus"` + // ReportOther bool `yaml:"reportOther"` + // Frequencies []struct { + // ID string `yaml:"id"` + // Name string `yaml:"name"` + // Frequency string `yaml:"frequency"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"frequencies"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"anytone"` + // Destination string `yaml:"destination"` + // Source string `yaml:"source"` + // Path []string `yaml:"path,flow"` + // Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // } `yaml:"aprs"` Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped } `yaml:"positioning,omitempty"` RoamingChannels []struct { @@ -327,18 +327,18 @@ type Digital struct { GroupList string `yaml:"groupList"` Contact string `yaml:"contact"` Anytone struct { - Talkaround bool `yaml:"talkaround"` - FrequencyCorrection int `yaml:"frequencyCorrection"` - HandsFree bool `yaml:"handsFree"` - CallConfirm bool `yaml:"callConfirm"` - Sms bool `yaml:"sms"` - SmsConfirm bool `yaml:"smsConfirm"` - DataACK bool `yaml:"dataACK"` - SimplexTDMA bool `yaml:"simplexTDMA"` - AdaptiveTDMA bool `yaml:"adaptiveTDMA"` - LoneWorker bool `yaml:"loneWorker"` - ThroughMode bool `yaml:"throughMode"` - Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped + // Talkaround bool `yaml:"talkaround"` + // FrequencyCorrection int `yaml:"frequencyCorrection"` + // HandsFree bool `yaml:"handsFree"` + // CallConfirm bool `yaml:"callConfirm"` + // Sms bool `yaml:"sms"` + // SmsConfirm bool `yaml:"smsConfirm"` + // DataACK bool `yaml:"dataACK"` + // SimplexTDMA bool `yaml:"simplexTDMA"` + // AdaptiveTDMA bool `yaml:"adaptiveTDMA"` + // LoneWorker bool `yaml:"loneWorker"` + // ThroughMode bool `yaml:"throughMode"` + Additional map[string]interface{} `yaml:",inline"` // Any new keys will show up here to be roundtripped } `yaml:"anytone"` Power DefaultableString `yaml:"power"` Timeout DefaultableInt `yaml:"timeout"` diff --git a/dmrfill.go b/dmrfill.go index 864649b..31721f7 100644 --- a/dmrfill.go +++ b/dmrfill.go @@ -88,7 +88,6 @@ var ( nameLength int open bool onAir bool - tgSource string location string radius float64 radiusUnits string @@ -110,11 +109,6 @@ func init() { flag.IntVar(&nameLength, "name_lim", 16, "Length limit for generated names") flag.BoolVar(&open, "open", true, "Only include open repeaters") flag.BoolVar(&onAir, "on_air", true, "Only include on-air repeaters") - flag.StringVar(&tgSource, "tg_source", "most", - `One of ('most' 'rfinder' 'details'). -RadioID has two fields that may contain talkgroup info, 'details' and 'rfinder'. -By default dmrfill uses the data from whichever field has the most talkgroups defined. -Selecting 'rfinder' or 'details' uses the named field.`) flag.StringVar(&location, "loc", "", "Center location for proximity search, e.g. 'Bangor, ME', 'München'") flag.Float64Var(&radius, "radius", 25, "Radius for proximity search") flag.StringVar(&radiusUnits, "units", "miles", "Distance units for proximity search, one of ('miles' 'km')") @@ -457,13 +451,6 @@ func parseArguments() (io.ReadCloser, io.WriteCloser) { fatal("power must be one of (Min Low Mid High Max)") } - switch tgSource { - case "most", "rfinder", "details": - // good - default: - fatal("tg_source must be one of (most rfinder details)") - } - if radius <= 0.0 { fatal("radius must be greater than zero") } diff --git a/radioID.go b/radioID.go index 72f6cd2..7a1014e 100644 --- a/radioID.go +++ b/radioID.go @@ -116,40 +116,15 @@ func QueryRadioID(filters filterFlags) (*RadioIDResults, error) { } if matchesAll { // Parse LastUpdated - m := lastUpdatedRegex.FindAllStringSubmatch(r.Rfinder, -1) + m := lastUpdatedRegex.FindAllStringSubmatch(r.Details, -1) if len(m) > 0 { r.LastUpdated, err = time.Parse("2006-01-02 15:04:05", m[0][1]) if err != nil { return nil, fmt.Errorf("error parsing LastUpdated %s: %v", m[0][1], err) } } - // Parse talk groups from rfinder field - var rfinderTGs, detailsTGs []TalkGroup - m = talkGroupRegex.FindAllStringSubmatch(r.Rfinder, -1) - for _, s := range m { - id, err := strconv.Atoi(s[2]) - if err != nil { - return nil, fmt.Errorf("error parsing TalkGroup ID %s: %v", s[2], err) - } - ts, err := strconv.Atoi(s[1]) - if err != nil { - return nil, fmt.Errorf("error parsing TalkGroup TimeSlot %s: %v", s[1], err) - } - name := s[4] - if len(name) > nameLength { - name = name[:nameLength] - } - if ts == 1 || ts == 2 { - rfinderTGs = append(rfinderTGs, TalkGroup{ - Number: id, - TimeSlot: ts, - Name: name, - }) - } else { - logVerbose("Skipping rfinder talkgroup #%d: %s, bad timeslot %d", id, name, ts) - } - } // Parse talk groups from details field + var detailsTGs []TalkGroup m = talkGroupRegex.FindAllStringSubmatch(r.Details, -1) for _, s := range m { id, err := strconv.Atoi(s[2]) @@ -174,22 +149,9 @@ func QueryRadioID(filters filterFlags) (*RadioIDResults, error) { logVerbose("Skipping details talkgroup #%d: %s, bad timeslot %d", id, name, ts) } } - logVerbose("Count - rfinderTGs: %d,\tdetailsTGs: %d", len(rfinderTGs), len(detailsTGs)) - // logVerbose("rfinderTGs: %#v", rfinderTGs) + logVerbose("Count - detailsTGs: %d", len(detailsTGs)) // logVerbose("detailsTGs: %#v", detailsTGs) - - switch tgSource { - case "most": - if len(rfinderTGs) >= len(detailsTGs) { - r.TalkGroups = rfinderTGs - } else { - r.TalkGroups = detailsTGs - } - case "rfinder": - r.TalkGroups = rfinderTGs - case "details": - r.TalkGroups = detailsTGs - } + r.TalkGroups = detailsTGs if !talkgroupsRequired || len(r.TalkGroups) > 0 { newResults = append(newResults, r) } else { @@ -220,22 +182,22 @@ type RadioIDResults struct { } type RadioIDResult struct { - Callsign string `json:"callsign"` // "KC1FRJ" - City string `json:"city"` // "Presque Isle" - ColorCode int `json:"color_code"` // 12 - Country string `json:"country"` // "United States" - Details string `json:"details"` // "Time Slot #1 - Group Call 759 = SKYWARN
Time Slot #1 - Group Call 9998 = Parrot*
Time Slot #1 - Group Call 1 = World Wide*
Time Slot #1 - Group Call 13 = WW English*
Time Slot #1 - Group Call 3 = North America
Time Slot #1 - Group Call 3172 = Northeast
Time Slot #1 - Group Call 1 = World Wide*
Time Slot #1 - Group Call 13 = WW English*
Time Slot #1 - Group Call 3 = North America
Time Slot #1 - Group Call 3172 = Northeast
Time Slot #1 - Group Call 310 = TAC310*
Time Slot #1 - Group Call 311 = TAC311*
Time Slot #1 - Group Call 113 = UA English 1*
Time Slot #1 - Group Call 123 = UA English 2*
Time Slot #1 - Group Call 8801 = NETAC 1*
------------------------------------
Time Slot #2 - Group Call 8802 = NETAC 2*
Time Slot #2 - Group Call 3181 = New England Wide
Time Slot #2 - Group Call 8 = Region North
Time Slot #2 - Group Call 3133 = New Hampshire*
Time Slot #2 - Group Call 3123 = ME Statewide
Time Slot #1 - Group Call 3029 = New Brunswick
Time Slot #2 - Group Call 9 = Local Site

* PTT Activated

You Must Have [ARS] Disabled Within Your Radio

Contact: Dave, KQ1L
Email: dhawke@gwi.net
Website: http://nedecn.org
" - Frequency string `json:"frequency"` // "145.18000" - ID int `json:"id"` // 310198 - IPSCNetwork string `json:"ipsc_network"` // "NEDECN" - Offset string `json:"offset"` // "-0.600" - Rfinder string `json:"rfinder"` // "IPSC Network:NEDECN - Color Code:12 - Assigned:Peer - TS Linked:TS1 TS2 - Operator:KC1FRJ
Time Slot # 1 - Group Call 1 = World Wide*
Time Slot # 1 - Group Call 3 = North America
Time Slot # 1 - Group Call 13 = WW English*
Time Slot # 1 - Group Call 113 = UA English 1*
Time Slot # 1 - Group Call 123 = UA English 2*
Time Slot # 1 - Group Call 310 = TAC310*
Time Slot # 1 - Group Call 311 = TAC311*
Time Slot # 1 - Group Call 759 = SKYWARN
Time Slot # 1 - Group Call 3029 = New Brunswick
Time Slot # 1 - Group Call 3172 = Northeast
Time Slot # 1 - Group Call 8801 = NETAC 1*
Time Slot # 1 - Group Call 9998 = Parrot*
Time Slot # 2 - Group Call 8 = Region North
Time Slot # 2 - Group Call 9 = Local Site
Time Slot # 2 - Group Call 3123 = ME Statewide
Time Slot # 2 - Group Call 3133 = New Hampshire*
Time Slot # 2 - Group Call 3181 = New England Wide
Time Slot # 2 - Group Call 8802 = NETAC 2*

Last Update: 2024-06-24 21:06:51" - State string `json:"state"` // "Maine" - Trustee string `json:"trustee"` // "KC1FRJ" - TSLinked string `json:"ts_linked"` // "TS1 TS2" - LastUpdated time.Time - Band string - TalkGroups []TalkGroup + Callsign string `json:"callsign"` // "KC1FRJ" + City string `json:"city"` // "Presque Isle" + ColorCode int `json:"color_code"` // 12 + Country string `json:"country"` // "United States" + Details string `json:"details"` // "Time Slot #1 - Group Call 759 = SKYWARN\u003Cbr\u003ETime Slot #1 - Group Call 9998 = Parrot*\u003Cbr\u003ETime Slot #1 - Group Call 1 = World Wide*\u003Cbr\u003ETime Slot #1 - Group Call 13 = WW English*\u003Cbr\u003ETime Slot #1 - Group Call 3 = North America\u003Cbr\u003ETime Slot #1 - Group Call 3172 = Northeast\u003Cbr\u003ETime Slot #1 - Group Call 310 = TAC310*\u003Cbr\u003ETime Slot #1 - Group Call 311 = TAC311*\u003Cbr\u003ETime Slot #1 - Group Call 113 = UA English 1*\u003Cbr\u003ETime Slot #1 - Group Call 123 = UA English 2*\u003Cbr\u003ETime Slot #1 - Group Call 8801 = NETAC 1*\u003Cbr\u003E------------------------------------\u003Cbr\u003ETime Slot #2 - Group Call 8802 = NETAC 2*\u003Cbr\u003ETime Slot #2 - Group Call 3181 = New England Wide\u003Cbr\u003ETime Slot #2 - Group Call 8 = Region North\u003Cbr\u003ETime Slot #2 - Group Call 3133 = NH Statewide\u003Cbr\u003ETime Slot #2 - Group Call 3123 = ME Statewide\u003Cbr\u003ETime Slot #1 - Group Call 3029 = New Brunswick\u003Cbr\u003ETime Slot #2 - Group Call 9 = Local Site\u003Cbr\u003E\u003Cbr\u003E* PTT Activated\u003Cbr\u003E\u003Cbr\u003EYou Must Have [ARS] Disabled Within Your Radio\u003Cbr\u003EContact: Dave, KQ1L\u003Cbr\u003EEmail: dhawke@gwi.net\u003Cbr\u003EWebsite: http://nedecn.org" + Frequency string `json:"frequency"` // "145.18000" + ID int `json:"id"` // 310198 + IPSCNetwork string `json:"ipsc_network"` // "NEDECN" + Offset string `json:"offset"` // "-0.600" + RfinderDetails int `json:"rfinder_details"` // 0 + State string `json:"state"` // "Maine" + Trustee string `json:"trustee"` // "KC1FRJ" + TSLinked string `json:"ts_linked"` // "TS1 TS2" + LastUpdated time.Time + Band string + TalkGroups []TalkGroup } func (r RadioIDResult) GetCallsign() string {