Represents a BAOS IP4 device with an underlying TCP connection (with BAOS secure)
More...
|
| | BaosSecureIp4Device (const std::string &ip4Address, const PasswordHash &passwordHash, std::uint16_t port=12004) |
| | Construct a new Baos Ip 4 Device object from an ip address and a port.
|
| |
|
| BaosSecureIp4Device (const std::string &ip4Address, const PasswordHash &passwordHash, const AuthenticationCode &authenticationCode, std::uint16_t port=12004) |
| |
| BaosConnection_UPtr | getConnection () override |
| | Get a BaosConnection to the device.
|
| |
| void | setConnectionData (const std::string &ip4Address, const PasswordHash &passwordHash, std::uint16_t port=12004) |
| | Explicitly sets the connection data for a secure Baos Ip 4 Device object.
|
| |
| void | setConnectionData (const std::string &ip4Address, const PasswordHash &passwordHash, const AuthenticationCode &authenticationCode, std::uint16_t port=12004) |
| | Explicitly sets the connection data for a secure Baos Ip 4 Device object.
|
| |
| | BaosIp4Device (const std::string &ip4Address, std::uint16_t port=12004) |
| | Construct a new Baos Ip 4 Device object from an ip address and a port.
|
| |
| void | setConnectionData (const std::string &ip4Address, std::uint16_t port=12004) |
| | Explicitly sets the connection data for a Baos Ip 4 Device object from an ip address and a port.
|
| |
| void | enableEnsureAutoConnect (bool enable) |
| | Enables the option for ensure auto connect in legacy mode (e.g. 774.1 with auto connect mode). The default value is true (enabled).
|
| |
|
void | enableVerifyProtocolVersion (bool enable) |
| | Enables the option for verify the BAOS binary protocol version. The default value is true (enabled).
|
| |
| virtual void | close () |
| |
| ServerItemReadStrategy | setServerItemReadStrategy (ServerItemReadStrategy strategy) |
| | Set the strategy to use for reading the serveritems.
|
| |
| bool | enableCaching (bool state) |
| | Enable or Disable the internal caching for datapoint and parameter bytes.
|
| |
| bool | isCachingEnabled () const |
| | Return the current caching state.
|
| |
|
void | clearCaches () |
| | Clear the internal caches for datapoints and parameter bytes.
|
| |
| bool | wasCacheHit () |
| | Returns if the last request could be statisfied by the cache or not.
|
| |
| std::optional< DeviceMeta > | getMetaInfo () |
| | Get the metadata set for this device if available.
|
| |
| void | setMetaInfo (DeviceMeta &&meta) |
| | Set the meta data for this device.
|
| |
|
void | registerServerItemCallback (ServerItemIndicationCb) |
| | Register one or more functions ascallbacks, invoked on serveritem changes.
|
| |
|
void | registerDPValueCallback (DatapointValueCb) |
| | Register one or more functions ascallbacks, invoked on datapoint value changes.
|
| |
|
void | registerConnectionEventCallback (ConnectionEventCb callback) |
| | Register one or more functions as callbacks, invoked on connection lifecycle events.
|
| |
| DeviceStaticInfo | getStaticInfo (bool reload=false) |
| | Get the information about a connected BAOS device that is never changed. Like serial number.
|
| |
| DeviceConfigInfo | getConfigInfo (bool reload=false) |
| | Get the information about a connected BAOS device that is typically only changed during configuration.
|
| |
| DeviceRuntimeInfo | getRuntimeInfo (bool reload=false) |
| | Get the information about a connected BAOS device that may change during runtime.
|
| |
| void | setBoolServerItem (protocol::ServerItemId id, bool value) |
| | Set the a bool value to a server item.
|
| |
| protocol::ParameterBytes | getParameterBytes (std::uint16_t byteIndex=1, std::uint16_t numberOfBytes=UINT16_MAX, bool reload=false) |
| | Get the parameter bytes If caching is enabled, the result of this call will be stored in cache.
|
| |
| protocol::ParameterBytes | getAllParameterBytes (bool reload=false) |
| | Load all the parameter bytes and cache them.
|
| |
| std::optional< DatapointConfig > | getDpConfiguration (std::uint16_t dpId=1, bool withDescStrings=true, bool reload=false) |
| | Get the datapoint configuration of a single datapoint If caching is enabled, the result of this call will be stored in cache.
|
| |
| DatapointConfigurations | getDpConfigurations (std::uint16_t startDpId=1, std::uint16_t endDpId=UINT16_MAX, bool withDescStrings=true, bool reload=false) |
| | Get the datapoint configurations If caching is enabled, the result of this call will be stored in cache.
|
| |
| DatapointConfigurations | getAllDpConfigurations (bool reload=false) |
| | Load all the datapoint configurations and cache them.
|
| |
| void | setDpValue (std::uint16_t dpId, Buffer dpData, protocol::DatapointSetCommand command=protocol::DatapointSetCommand::SetNewValueAndSendOnBus) |
| | Set the value of a single datapoint.
|
| |
| void | setDpValues (std::map< std::uint16_t, Buffer > &&values, protocol::DatapointSetCommand command=protocol::DatapointSetCommand::SetNewValueAndSendOnBus) |
| | Set the value of multiple datapoints.
|
| |
| void | readDpValueFromBus (std::uint16_t dpId) |
| | Triggers a read request for the datapoint on the bus.
|
| |
| void | readDpValuesFromBus (std::vector< std::uint16_t > &&dpIds) |
| | Triggers read requests for a set of datapoints on the bus.
|
| |
| void | readDpValuesFromBus (const std::vector< std::uint16_t > &dpIds) |
| | Triggers read requests for a set of datapoints on the bus.
|
| |
| std::optional< protocol::DatapointValue > | getDpValueRaw (std::uint16_t dpId, bool reload=false) |
| | Get the value of a single datapoint as raw bytes.
|
| |
| template<class T > |
| std::optional< T > | getDatapointValue (std::uint16_t dpId, bool reload=false) |
| | Get the value of a single datapoint as type T.
|
| |
| protocol::DatapointValues | getDpValuesRaw (std::vector< std::uint16_t > dpIds, bool reload=false) |
| | Get the values of multiple datapoints as raw bytes.
|
| |
| protocol::DatapointValues | getDpValuesRaw (std::uint16_t startDpId, std::uint16_t endDpId, bool reload=false, protocol::DatapointValueFilter filter=protocol::DatapointValueFilter::VALID) |
| | Get the values of multiple datapoints as raw bytes.
|
| |
| protocol::DatapointValues | getAllDpValuesRaw (bool reload=false, protocol::DatapointValueFilter filter=protocol::DatapointValueFilter::VALID) |
| | Load all the datapoint values and cache them.
|
| |
|
|
void | ensureConnection () |
| | Make sure that a connection to the underlying device exists and is open or throw an exception if this is not possible.
|
| |
| void | onServerItemsUpdate (const protocol::ServerItems &serverItems) |
| | An update may occur as a response to a getServerItem request or via an indication.
|
| |
| void | onDpValueUpdate (const protocol::DatapointValueStates &dpValueStates) |
| | An update may occur as a response to a getDatapointValue request or via an indication.
|
| |
|
void | onConnectionEvent (ConnectionEvent event) |
| | Forwarded callback from underlying connection for lifecycle events.
|
| |
|
void | clearDeviceConfigs () |
| | Reset the device information, retrieved from serveritems and meta data to their default values.
|
| |
| protocol::ServerItems | getAllServerItems () |
| | Get all the serveritem values from the device.
|
| |
| template<class TGetter > |
| auto | getElements (std::uint16_t start, std::uint16_t count, std::uint16_t maxLengthElement, TGetter cb) |
| | Helper function to retrieve the elements(datapoint descriptions, string and parameter bytes) from the device.
|
| |
|
std::string | ip4Address_ |
| |
|
std::uint16_t | port_ |
| |
| bool | ensureAutoConnect_ {true} |
| |
| bool | verifyProtocolVersion_ {true} |
| |
| DeviceClassConfig | config_ |
| | Configuration options for this class.
|
| |
|
std::optional< DeviceMeta > | metaInfo_ |
| | Meta information set by the user.
|
| |
|
bool | cacheHit_ {false} |
| | Flag to indicate that the last operation could be statisfied with the cache content.
|
| |
|
bool | deviceInfoLoaded_ {false} |
| | Flag set of the device information is loaded from the device via serveritems.
|
| |
|
DeviceStaticInfo | staticInfo_ |
| | Static information about the BAOS device.
|
| |
|
DeviceConfigInfo | configInfo_ |
| | Config information about the BAOS device.
|
| |
|
DeviceRuntimeInfo | runtimeInfo_ |
| | Runtime information about the BAOS device.
|
| |
|
std::map< std::uint16_t, Buffer > | dpCache_ |
| | Cache to hold the last valid values for the datapoints.
|
| |
|
bool | dpCacheFilled_ {false} |
| | Flag to indicate that the cache is valid.
|
| |
|
protocol::ParameterBytes | paramBytes_ |
| | Cache to hold the parameter bytes.
|
| |
|
DatapointConfigurations | dpConfig_ |
| | Configuration information about the BAOS datapoints.
|
| |
|
std::vector< ServerItemIndicationCb > | serverItemsCallbacks |
| | List of registered callback functions.
|
| |
|
std::vector< DatapointValueCb > | dpValueCallbacks |
| | List of registered callback functions.
|
| |
|
std::vector< ConnectionEventCb > | connectionEventCallbacks |
| | List of registered connection lifecycle callbacks.
|
| |
|
BaosConnection_UPtr | baosCon_ |
| | The internal connection used to coomunicate with the BAOS device.
|
| |
Represents a BAOS IP4 device with an underlying TCP connection (with BAOS secure)
The connection information like ip address and the port can either be set in the constructor or later with setConnectionData. This has to be done before opening a the connection to the device.
This connection type is supported by BAOS 774.1 when configured as auto-connect or unsecure BAOS 777.1 when configured as auto-connect or unsecure
- Examples
- 12_BaosSecureDeviceInformation.cpp.