Add func to enable all networks

This commit is contained in:
Matias Doyle 2017-11-09 20:52:26 +01:00
parent a0e5516dbc
commit 763b1685df
2 changed files with 7 additions and 0 deletions

View File

@ -277,6 +277,10 @@ func (uc *unixgramConn) EnableNetwork(networkID int) error {
return uc.runCommand(fmt.Sprintf("ENABLE_NETWORK %d", networkID)) return uc.runCommand(fmt.Sprintf("ENABLE_NETWORK %d", networkID))
} }
func (uc *unixgramConn) EnableAllNetworks() error {
return uc.runCommand("ENABLE_NETWORK all")
}
func (uc *unixgramConn) SelectNetwork(networkID int) error { func (uc *unixgramConn) SelectNetwork(networkID int) error {
return uc.runCommand(fmt.Sprintf("SELECT_NETWORK %d", networkID)) return uc.runCommand(fmt.Sprintf("SELECT_NETWORK %d", networkID))
} }

View File

@ -166,6 +166,9 @@ type Conn interface {
// EnableNetwork enables a network. Returns error if the command fails. // EnableNetwork enables a network. Returns error if the command fails.
EnableNetwork(int) error EnableNetwork(int) error
// EnableAllNetworks enables all configured networks. Returns error if the command fails.
EnableAllNetworks() error
// SelectNetwork selects a network (and disables the others). // SelectNetwork selects a network (and disables the others).
SelectNetwork(int) error SelectNetwork(int) error