Documentation
¶
Index ¶
- Constants
- func FindBestChannel(ifname string, chain SelectionChain) (int, error)
- func Select(chain SelectionChain, usedChannels map[int]*Channel) map[int]int
- func UsedChannels(cells []wlist.Cell) map[int]*Channel
- type AccessPointNumber
- type Channel
- type Coverage
- type SelectionChain
- type SelectionMiddleware
- type Signal
- type UnoccupiedChannel
Constants ¶
View Source
const ( NumOfChannels = 13 // Number of channels in the 2.4GHz band NumOfChannelsCovered = 5 // Number of channels covered by a channel, including itself. For example, channel 1 covers channels 1, 2, 3, 4, 5. Infinite = 1000000000000 // A very large number. )
Variables ¶
This section is empty.
Functions ¶
func FindBestChannel ¶
func FindBestChannel(ifname string, chain SelectionChain) (int, error)
FindBestChannel returns the best channel to use for the given interface.
Types ¶
type AccessPointNumber ¶
type AccessPointNumber struct {
Weight int `json:"weight"` // Weight of the criteria
}
func (AccessPointNumber) Criteria ¶
func (c AccessPointNumber) Criteria() string
func (AccessPointNumber) Name ¶
func (c AccessPointNumber) Name() string
func (*AccessPointNumber) SetWeight ¶
func (c *AccessPointNumber) SetWeight(weight int)
type Channel ¶
type Channel struct { Number int // Channel number. SignalStrength int // Sum of quality of the channel, representing the overall signal usage of the channel. NbOfAccessPoints int // Number of access points on the channel. Cells []wlist.Cell // Cells on the channel. ChannelsCovered []int // Represents the channels that are covered by the channel. }
Channel represents a wifi channel.
type Coverage ¶
type Coverage struct {
Weight int `json:"weight"` // Weight of the criteria
}
Coverage is a criteria that select the channels with the least coverage.
type SelectionChain ¶
type SelectionChain []SelectionMiddleware // A chain of selection middlewares.
type SelectionMiddleware ¶
type SelectionMiddleware interface { // Select ranks the channels based on the criteria. Select(ScoredChannels map[int]int, UsedChannels map[int]*Channel) (map[int]int, error) // Criteria returns the criteria of the middleware. Criteria() string // Name returns the name of the criteria. Name() string // SetWeight sets the weight of the criteria. // The weight is an int between 0 and 100. SetWeight(int) }
SelectionMiddleware is a middleware that selects the best channel given a criteria.
type Signal ¶
type Signal struct {
Weight int `json:"weight"` // Weight of the criteria
}
type UnoccupiedChannel ¶
type UnoccupiedChannel struct {
Weight int `json:"weight"` // Weight of the criteria. This criteria shall be always 1000000000.
}
UnoccupiedChannel is a criteria that select the channel free of other channel coverage?
func (UnoccupiedChannel) Criteria ¶
func (e UnoccupiedChannel) Criteria() string
Criteria returns the description of the criteria
func (UnoccupiedChannel) Name ¶
func (e UnoccupiedChannel) Name() string
Name returns the name of the criteria
func (*UnoccupiedChannel) SetWeight ¶
func (e *UnoccupiedChannel) SetWeight(weight int)
SetWeight sets the weight of the criteria
Click to show internal directories.
Click to hide internal directories.