+
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions calnex/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ func (c *config) measureConfig(target string, s *ini.Section, mc map[api.Channel
channelEnabled := make(map[api.Channel]bool)

for ch, m := range mc {
// Check that physical channel (not virtual) is installed before trying to change any settings
if c.chGet(s, ch, "installed") != "1" {
log.Debugf("%s: no change to channel %s it is not installed", target, ch)
continue
}
channelEnabled[ch] = true
probe := ""

Expand Down Expand Up @@ -148,7 +153,7 @@ func (c *config) measureConfig(target string, s *ini.Section, mc map[api.Channel

// Disable unused channels
for ch, datatype := range api.MeasureChannelDatatypeMap {
if !channelEnabled[ch] {
if !channelEnabled[ch] && c.chGet(s, ch, "installed") == "1" {
c.set(target, s, fmt.Sprintf("%s\\used", ch.CalnexAPI()), api.NO)
if datatype == api.TWOWAYTE {
c.set(target, s, fmt.Sprintf("%s\\protocol_enabled", ch.CalnexAPI()), api.OFF)
Expand Down Expand Up @@ -203,8 +208,10 @@ func (c *config) baseConfig(target string, measure *ini.Section, gnss *ini.Secti

// Enable 1st Physical channel
c.set(target, measure, fmt.Sprintf("%s\\used", api.ChannelONE.CalnexAPI()), api.YES)
// Disable 2nd Physical channel
c.set(target, measure, fmt.Sprintf("%s\\used", api.ChannelTWO.CalnexAPI()), api.NO)
// Disable 2nd Physical channel only if it is installed
if maxChannel == api.ChannelTWO {
c.set(target, measure, fmt.Sprintf("%s\\used", api.ChannelTWO.CalnexAPI()), api.NO)
}

// Disable packet measurement on the two physical channel measurements
c.chSet(target, measure, api.ChannelONE, maxChannel, "%s\\protocol_enabled", api.OFF)
Expand Down
Loading
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载