Represents the channel mask (active and inactive channels) for a WirelessNode.
The maximum number of channels currently available on any node
explicit ChannelMask( |
| ) |
Creates an ChannelMask object given a channel mask that was stored on a WirelessNode
channelMask uint16 | A channel mask value from a WirelessNode representing the active and inactive channels |
The default constructor for creating an ChannelMask object, which sets all the channels to inactive
Equal operator for comparing ChannelMasks.
Not Equal operator for comparing ChannelMasks.
Less Than operator for comparing ChannelMasks.
Greater Than operator for comparing ChannelMasks.
void fromMask( |
| ) |
Initializes the ChannelMask object from a channel mask
channelMask uint16 | A channel mask value from a WirelessNode representing the active and inactive channels |
Gets the channel mask value of the current ChannelMask object
The ChannelMask object represented as a channel mask
Gets the total number of active channels in the current ChannelMask object
The total number of active channels
bool enabled( |
| ) const |
Checks whether a certain channel is enabled or disabled
channel uint8 | The channel to check if enabled or disabled, based on index 1 (channel1 = 1, channel8 = 8) |
true if the channel is enabled, false if the channel is disabled
void enable( |
| ) |
Enables or disables a specified channel
channel uint8 | The channel to enable or disable, based on index 1 (channel1 = 1, channel8 = 8) |
enable bool | Set to true to enable the channel, false to disable the channel |
Finds the last channel (highest channel number) that is enabled in the mask. This is useful when looping over the ChannelMask object and performing an action on all enabled channels.
The channel number (ch1 = 1, ch16 = 16) of the last channel enabled. 0 if no channels are enabled.