In order to focus on problem-solving, I’ve decided to use Cobra+Viper to replace existing thereceipe/qt GUI.
Cobra: https://github.com/spf13/cobra
Viper: https://github.com/spf13/viper
For example:
- Use cmd ‘ngapp nrrg conf freqband -h’ to get help
D:\dev\go\src\github.com\zhenggao2\ngapp>ngapp nrrg conf freqband -h
nrrg conf freqband can be used to get/set frequency-band related network configurations.
Usage:
ngapp nrrg conf freqband [flags]
Flags:
--opBand string Operating band (default "n41")
-h, --help help for freqband
Global Flags:
-c, --config string config file (default is $HOME/.ngapp.yaml)
- Use cmd ‘ngapp nrrg conf freqband’ to get current settings:
D:\dev\go\src\github.com\zhenggao2\ngapp>ngapp nrrg conf freqband
Flag Type Current Value Modifiable
opBand string n41 true
_duplexMode string TDD false
_maxDlFreq int 2690 false
_freqRange string FR1 false
- Use cmd ‘ngapp nrrg conf freqband --opBand=n78’ to configure modifiable flag opBand:
D:\dev\go\src\github.com\zhenggao2\ngapp>ngapp nrrg conf freqband --opBand=n78
nrgrid.FreqBandInfo: {
3300 MHz-3800 MHz 3300 MHz-3800 MHz TDD 3800}
Available SSB scs: 30KHz
RMSI scs(subcarrierSpacingCommon of MIB) range: 15KHz,30KHz
carrier scs(subcarrierSpacing of SCS-SpecificCarrier) range: 15KHz,30KHz,60KHz
nrgrid.RachInfo: {
B4 2 [1] [9] 0 1 1 12}
PRACH scs(msg1-SubcarrierSpacing of RACH-ConfigCommon) range: 15KHz,30KHz
Flag Type Current Value Modifiable
opBand string n78 true
_duplexMode string TDD false
_maxDlFreq int 3800 false
_freqRange string FR1 false
Now I will introduce the framework:
- Former GUI settings are orgnized into separate sub-command:
// nrrgCmd.init
func init() {
nrrgConfCmd.AddCommand(confFreqBandCmd)
nrrgConfCmd.AddCommand(confSsbGridCmd)
nrrgConfCmd.AddCommand(confSsbBurstCmd)
nrrgConfCmd.AddCommand(confMibCmd)
nrrgConfCmd.AddCommand(confCarrierGridCmd)
nrrgConfCmd.AddCommand(confCommonSettingCmd)
nrrgConfCmd.AddCommand(confCss0Cmd)
nrrgConfCmd.AddCommand(confCoreset1Cmd)
nrrgConfCmd.AddCommand(confUssCmd)
nrrgConfCmd.AddCommand(confDci10Cmd)
nrrgConfCmd.AddCommand(confDci11Cmd)
nrrgConfCmd.AddCommand(confMsg3Cmd)
nrrgConfCmd.AddCommand(confDci01Cmd)
nrrgConfCmd.AddCommand(confBwpCmd)
nrrgConfCmd.AddCommand(confRachCmd)
nrrgConfCmd.AddCommand(confDmrsCommonCmd)
nrrgConfCmd.AddCommand(confDmrsPdschCmd)
nrrgConfCmd.AddCommand(confPtrsPdschCmd)
nrrgConfCmd.AddCommand(confDmrsPuschCmd)
nrrgConfCmd.AddCommand(confPtrsPuschCmd)
nrrgConfCmd.AddCommand