BaseStationConfig
BaseStationConfig

Class used for setting the configuration of BaseStations.  Set all the configuration values that you want to change, then verify and apply them to a BaseStation.

See also: BaseStation::applyConfig

Functions
BaseStationConfig
BaseStationConfig()

Creates a blank BaseStationConfig.

Variables
m_transmitPower
boost::optional<WirelessTypes::TransmitPower> m_transmitPower

The WirelessTypes::TransmitPower to set.

m_btnsLongPress
ButtonMap m_btnsLongPress

The <ButtonMap> for long press actions.

m_btnsShortPress
ButtonMap m_btnsShortPress

The <ButtonMap> for short press actions.

m_analogPairs
AnalogPairMap m_analogPairs

The <AnalogPairMap> holding all analog pairs to set

m_analogPairingEnable
boost::optional<bool> m_analogPairingEnable

The analog pairing enable master option to set.

m_analogTimeoutTime
boost::optional<uint16> m_analogTimeoutTime

The analog timeout time (in seconds) to set.

m_analogTimeoutVoltage
boost::optional<float> m_analogTimeoutVoltage

The analog timeout voltage to set.

m_analogExceedanceEnable
boost::optional<bool> m_analogExceedanceEnable

The analog exceedance enable option to set.

Functions
checkValue
template<typename T> void checkValue(
const boost::optional<T> &opt,
const std::string &valueName
) const

Throws an exception if an optional value isn't set.

Parameters
opt
const boost::optional<T>&

The boost::optional value to check if it is set.

valueName
const std::string&

The name of the value being checked. This will be included in the exception description if not set.

Exceptions
Error_NoData

The requested value has not been set.

isSet
template<typename T> bool isSet(
const boost::optional<T> &opt
) const

Checks whether the optional value is set.

Parameters
opt
const boost::optional<T>&

The boost::optional value to check if it is set.

Returns

true if the value is set, false if it is not set.

verify
bool verify(
const BaseStationFeatures &features,
const BaseStationEepromHelper &eeprom,
ConfigIssues &outIssues
) const

Checks whether the current settings are ok to be written to a given BaseStation.

Parameters
features

The BaseStationFeatures of the BaseStation to verify the configuration for.

eeprom

The BaseStationEepromHelper of the BaseStation to use for communication.

outIssues
ConfigIssues&

The ConfigIssues holding any resulting issues that are found with the configuration.

Returns

true if the configuration is valid. false if the configuration is invalid and outIssues should be checked for more information.

Exceptions
apply
void apply(
const BaseStationFeatures &features,
BaseStationEepromHelper &eeprom
) const

Writes all of the configuration values that are set to a WirelessNode.

Parameters
features

The BaseStationFeatures of the BaseStation to write the config to.

eeprom

The BaseStationEepromHelper of the BaseStation to write the config to.

Exceptions
transmitPower
WirelessTypes::TransmitPower transmitPower() const

Gets the WirelessTypes::TransmitPower value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

transmitPower
void transmitPower(
WirelessTypes::TransmitPower power
)

Sets the WirelessTypes::TransmitPower value in the Config.

buttonLongPress
BaseStationButton buttonLongPress(
uint8 buttonNumber
) const

Gets the BaseStationButton value in the Config for performing a long press on a specific button, if set.

Parameters
buttonNumber
uint8

The button number (1 = button 1) to get the value for.

Exceptions
Error_NoData

The requested button number for long press has not been set.

buttonLongPress
void buttonLongPress(
uint8 buttonNumber,
const BaseStationButton &button
)

Sets the BaseStationButton value in the Config for performing a short press on a specific button.

Parameters
buttonNumber
uint8

The button number (1 = button 1) to set.

button

The BaseStationButton to set.

buttonShortPress
BaseStationButton buttonShortPress(
uint8 buttonNumber
) const

Gets the BaseStationButton value in the Config for performing a short press on a specific button, if set.

Parameters
buttonNumber
uint8

The button number (1 = button 1) to get the value for.

Exceptions
Error_NoData

The requested button number for short press has not been set.

buttonShortPress
void buttonShortPress(
uint8 buttonNumber,
const BaseStationButton &button
)

Sets the BaseStationButton value in the Config for performing a long press on a specific button.

Parameters
buttonNumber
uint8

The button number (1 = button 1) to set.

button

The BaseStationButton to set.

analogPairingEnable
bool analogPairingEnable() const

Gets the Analog Pairing Enabled value in the Config, if set.

Exceptions
Error_NoData

The requested button number for short press has not been set.

analogPairingEnable
void analogPairingEnable(
bool enable
)

Sets the Analog Pairing Enabled value in the Config.  This controls whether all of the other analog pairing settings have any affect.

Parameters
enable
bool

Whether to enable or disable analog pairing in the Config.

analogTimeoutTime
uint16 analogTimeoutTime() const

Gets the Analog Timeout Time value (in seconds) in the Config, if set.  If this is 0, Analog Timeout is disabled.

Exceptions
Error_NoData

The requested button number for short press has not been set.

analogTimeoutTime
void analogTimeoutTime(
uint16 seconds
)

Sets the Analog Timeout Time value (in seconds) in the Config.  If this is 0, Analog Timeout is disabled.

Parameters
seconds
uint16

The analog timeout time in seconds to set.

analogTimeoutVoltage
float analogTimeoutVoltage() const

Gets the Analog Timeout Voltage in the Config, if set.

Exceptions
Error_NoData

The requested button number for short press has not been set.

analogTimeoutVoltage
void analogTimeoutVoltage(
float voltage
)

Sets the Analog Timeout Voltage in the Config.  If this is 0, Analog Timeout is disabled.

Parameters
voltage
float

The voltage to set.

analogExceedanceEnable
bool analogExceedanceEnable()

Gets the Analog Exceedance Enabled value in the Config, if set.

Exceptions
Error_NoData

The requested button number for short press has not been set.

analogExceedanceEnable
void analogExceedanceEnable(
bool enable
)

Sets the Analog Exceedance Enabled value in the Config.

Parameters
enable
bool

Whether to enable or disable analog exceedance in the Config.

analogPairing
BaseStationAnalogPair analogPairing(
uint8 portNumber
) const

Gets the BaseStationAnalogPair value in the Config for the specified port number, if set.

Parameters
portNumber
uint8

The port number (1 = port 1) to get the pairing for.

Exceptions
Error_NoData

The requested port number has not been set.

buttonLongPress

Sets the BaseStationAnalogPair value in the Config for the specified port number.

Parameters
portNumber

The port number (1 = port 1) to set.

pair

The BaseStationAnalogPair to set.