Represents a MicroStrain Base Station object
BASE_COMMANDS_DEFAULT_TIMEOUT | 50 ms - The default timeout for a base station command (in milliseconds) |
BROADCAST_NODE_ADDRESS | 65535 - The address to use for performing Broadcast commands that will be heard by all WirelessNodes on the frequency. |
explicit BaseStation( |
| ) |
Creates a BaseStation object.
connection | The Connection object used for communication |
baseTimeout uint64 | The timeout to use for base station commands (optional, default of BASE_COMMANDS_DEFAULT_TIMEOUT (2 seconds)) |
Error_Connection: A problem occured with the Connection.
static std::string deviceName( |
| ) |
Static function for creating the universal basestation name that should be used for SensorCloud.
serial const std::string& | The serial of the basestation. This should be identical to calling the serial function on a BaseStation object. |
The universal basestationName.
Gets the Connection object that this BaseStation is using.
The Connection object that this BaseStation is using.
Gets a reference to the BaseStationFeatures for this BaseStation. Note: This will be invalid when the BaseStation is destroyed.
BaseStationFeatures containing the features for this BaseStation.
Error_NotSupported: The BaseStation model is not supported by MSCL.
Error_Communication: Failed to communicate with the BaseStation.
Error_Connection: A connection error has occurred with the parent BaseStation.
Gets the Timestamp for the last time MSCL communicated with the BaseStation. Note: EEPROM reads using the cache, and data collection, will not update this timestamp.
A Timestamp representing the last time MSCL communicated with the BaseStation. This will be a Timestamp of 0 if never communicated with.
void readWriteRetries( |
| ) |
Sets the number of retry attempts for reading and writing with the BaseStation. By default, the number of retries is 0. Note: The timeout that is set per command will be per read and write attempt, meaning this retry number is multiplied by the timeout for your overall timeout.
numRetries uint8 | The number of retries to set for all reading and writing with the BaseStation. |
void useEepromCache( |
| ) |
Sets whether or not to utilize the eeprom cache when configuring this BaseStation (enabled by default). This can be enabled/disabled at any time. It is highly recommended to have eeprom caching be enabled. Note: The eeprom cache stores the last known value that was written to / read from the BaseStation for each eeprom location. If this is enabled, any reads will get the last known value from the cache if it exists, and any writes will not write to the BaseStation if the value attempting to be written is the same as that stored in the cache. Caching of these values will still be performed if this is disabled, however, read and write operations will then always reach out to the actual device.
useCache bool | whether the eeprom cache should be used (true) or not (false). |
Clears the eeprom cache for this BaseStation.
Gets the WirelessTypes::Frequency representing the radio frequency of this BaseStation. If the frequency is unknown, it will be read from the BaseStation.
The WirelessTypes::Frequency that this BaseStation is on.
Error_NotSupported: Attempted to read an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Communication: Failed to read the value from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
Gets the firmware version of the BaseStation.
A Version representing the firmware version of the BaseStation.
Error_NotSupported: Attempted to read an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Communication: Failed to read the value from the BaseStation.
Error_Connection: A connection error has occurred with the parent BaseStation.
Gets the model of the BaseStation.
A WirelessModels::BaseModel representing the model of the BaseStation.
Error_NotSupported: Attempted to read an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Communication: Failed to read the value from the BaseStation.
Error_Connection: A connection error has occurred with the parent BaseStation.
Gets the serial number of the BaseStation.
A string representing the serial number of the BaseStation.
Error_NotSupported: Attempted to read an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Communication: Failed to read the value from the BaseStation.
Error_Connection: A connection error has occurred with the parent BaseStation.
Gets the name of the BaseStation. This is the universal basestation name that should be used for SensorCloud. This is the same as calling BaseStation::deviceName.
The universal basestation name.
Error_NotSupported: Attempted to read an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Communication: Failed to read the value from the BaseStation.
Error_Connection: A connection error has occurred with the parent BaseStation.
Gets the microcontroller of the BaseStation.
A WirelessTypes::MicroControllerType representing the microcontroller of the BaseStation.
Error_NotSupported: Attempted to read an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Communication: Failed to read the value from the BaseStation.
Error_Connection: A connection error has occurred with the parent BaseStation.
DataSweeps getData( |
| ) |
Gets up to the requested amount of DataSweeps of sampled data that was collected by this BaseStation.
timeout uint32 | The timeout, in milliseconds, to wait for data if necessary (default of 0). |
maxSweeps uint32 | The maximum number of sweeps to return. If this is 0 (default), all sweeps will be returned. |
A DataSweeps object containing all the data sweeps that are available up to the requested number of max sweeps.
Error_Connection: A connection error has occurred with the BaseStation
Gets the group of Node Discoveries that were collected by this base station. Calling this function clears out the Node Discovery buffer, so successively calling this will give you new Node Discoveries.
A NodeDiscoveries container, holding all the Node Discoveries that were collected by this base station.
Error_Connection: A connection error has occurred with the BaseStation
void timeout( |
| ) |
Sets the timeout to use when waiting for responses from commands. This timeout is used directly for BaseStation commands, while some additional time is added for Node commands. Note: Some commands have a minimum timeout that will override this if set lower than the minimum.
timeout uint64 | The timeout (in milliseconds) to set for commands. |
Gets the current timeout to use when waiting for responses from base station commands. This timeout is used directly for BaseStation commands, while some additional time is added for Node commands. Note: Some commands have a minimum timeout that will override this if set lower than the minimum.
The timeout (in milliseconds) set for base station commands.
Pings the base station
true if successfully pinged the base station, false otherwise
Error_Connection: A connection error has occurred with the BaseStation
BaseStation baseStation(&connection);
baseStation.ping();
uint16 readEeprom( |
| ) const |
Reads a specific EEPROM address on the Base Station. If the value stored in the eeprom cache is still valid, this will be returned instead.
eepromAddress uint16 | The EEPROM address to be read. |
The uint16 value read from the specified EEPROM location.
Error_NotSupported: Unsupported eeprom location.
Error_Communication: Failed to read the value from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
void writeEeprom( |
| ) |
Writes the specified value to a specific EEPROM address on the Base Station. If successful, the cache will be updated with the changed value as well.
eepromAddress uint16 | The EEPROM address to write to. |
value uint16 | The value to write to the EEPROM address. |
Error_NotSupported: Unsupported eeprom location or value.
Error_Communication: Failed to write the value to the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
Enables the beacon on the base station using the system time (UTC) as its starting timestamp.
A Timestamp representing the initial time that was sent to start the beacon
Error_Connection: A connection error has occurred with the BaseStation
Error_Communication: The enable beacon command has failed.
BaseStation baseStation(connection);
baseStation.enableBeacon();
Timestamp enableBeacon( |
| ) |
Enables the beacon on the base station using the given UTC timestamp.
utcTime uint32 | The start time for the beacon in UTC seconds from the Unix Epoch (01/01/1970) |
A Timestamp representing the initial time that was sent to start the beacon
Error_Connection: A connection error has occurred with the BaseStation
Error_Communication: The enable beacon command has failed.
BaseStation baseStation(connection);
baseStation.enableBeacon(1357846020);
Disables the beacon on the base station.
Error_Connection: A connection error has occurred with the BaseStation
Error_Communication: The disable beacon command has failed.
BaseStation baseStation(connection);
baseStation.disableBeacon();
Gets the BeaconStatus of the beacon on the base station.
A BeaconStatus object containing status information of the beacon.
Error_NotSupported: Beacon Status is not supported by this BaseStation.
Error_Communication: Failed to get the beacon status.
Error_Connection: A connection error has occurred with the BaseStation.
void startRfSweepMode( |
| ) |
Starts the BaseStation in RF Sweep Mode. Note: To exit this Mode, send any command to the BaseStation (such as ping).
minFreq uint32 | The minimum frequency to use in the scan in kHz (2400000 = 2.4GHz). |
maxFreq uint32 | The maximum frequency to use in the scan in kHz (2400000 = 2.4GHz). |
interval uint32 | The interval between frequencies. |
options uint16 | This is currently an Advanced setting, used internally. |
Error_NotSupported: RF Sweep Mode is not supported by this BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
Error_Communication: The beacon status command has failed.
Cycles the power on the base station.
Error_NotSupported: Attempted to write an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Connection: A connection error has occurred with the BaseStation.
Error_Communication: Failed to cycle the power.
Resets the radio on the base station.
Error_NotSupported: Attempted to write an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Connection: A connection error has occurred with the BaseStation.
Error_Communication: Failed to cycle the power.
void changeFrequency( |
| ) |
Changes the radio frequency of the base station.
frequency | The WirelessTypes::Frequency to change the base station to. |
Error_NotSupported: Attempted to write an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Connection: A connection error has occurred with the BaseStation
Error_Communication: Failed to change the frequency.
bool verifyConfig( |
| ) const |
Checks whether the settings in the given BaseStationConfig are ok to be written to the BaseStation. Options that are set will also be validated against each other. If an option that needs to be validated isn't currently set, it will be read from the BaseStation.
config const BaseStationConfig& | The BaseStationConfig to verify. |
outIssues ConfigIssues& | The ConfigIssues that will hold any resulting issues that are found with the configuration. |
true if the configuration is valid. false if the configuration is invalid and outIssues should be checked for more information.
Error_NotSupported: The BaseStation model, or firmware version, is not supported by MSCL.
Error_Communication: Failed to communicate with the BaseStation.
Error_Connection: A connection error has occurred.
void applyConfig( |
| ) |
Applies a BaseStationConfig to the Node. Note: This applies all options that have been set in the BaseStationConfig. Before applying, the options will be validated. It is recommended that you perform this validation yourself first by using verifyConfig.
config const BaseStationConfig& | The BaseStationConfig to apply to the Node. |
Error_NotSupported: The BaseStation model, or firmware version, is not supported by MSCL.
Error_InvalidConfig: Invalid Configuration. Check the exception for specific details.
Error_Communication: Failed to write to the BaseStation.
Error_Connection: A connection error has occurred with the parent BaseStation.
Reads the WirelessTypes::TransmitPower that is currently set on the BaseStation.
The WirelessTypes::TransmitPower that is currently set on the BaseStation.
Error_NotSupported: Attempted to read an unsupported option. The device firmware is not compatible with this version of MSCL.
Error_Communication: Failed to read from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
BaseStationButton getButtonLongPress( |
| ) const |
Reads the button settings for a long press action that are currently set on the BaseStation.
buttonNumber uint8 | The button number (1 = button 1) to get the value for. |
A BaseStationButton object holding the current long press settings for the requested button number.
Error_NotSupported: The BaseStation does not support the requested button.
Error_Communication: Failed to read from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
BaseStationButton getButtonShortPress( |
| ) const |
Reads the button settings for a short press action that are currently set on the BaseStation.
buttonNumber uint8 | The button number (1 = button 1) to get the value for. |
A BaseStationButton object holding the current short press settings for the requested button number.
Error_NotSupported: The BaseStation does not support the requested button.
Error_Communication: Failed to read from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
Reads the Analog Pairing enabled/disabled setting that is currently set on the BaseStation. If this is disabled, all other analog pairing settings will be disabled.
true if Analog Pairing is enabled, false otherwise.
Error_NotSupported: The BaseStation does not support Analog Pairing.
Error_Communication: Failed to read from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
Reads the Analog Timeout Time in seconds that is currently set on the BaseStation.
The analog timeout time in seconds.
Error_NotSupported: The BaseStation does not support Analog Pairing.
Error_Communication: Failed to read from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
Reads the Analog Timeout Voltage that is currently set on the BaseStation.
The analog timeout voltage.
Error_NotSupported: The BaseStation does not support Analog Pairing.
Error_Communication: Failed to read from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
Reads the Analog Exceedance enabled/disabled setting that is currently set on the BaseStation.
true if Analog Exceedance is enabled, false otherwise.
Error_NotSupported: The BaseStation does not support Analog Pairing.
Error_Communication: Failed to read from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.
BaseStationAnalogPair getAnalogPair( |
| ) const |
Reads the BaseStationAnalogPair for the specified port number that is currently set on the BaseStation.
portNumber uint8 | The port number (1 = port 1) to get the value for. |
The BaseStationAnalogPair for the specified port number that is currently set on the BaseStation.
Error_NotSupported: The BaseStation does not support Analog Pairing.
Error_Communication: Failed to read from the BaseStation.
Error_Connection: A connection error has occurred with the BaseStation.