|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Parsed PROFINET device information from a DCP response. More...
#include <dcp.h>
Collaboration diagram for profinet::dcp::DCPDeviceDescription:Public Member Functions | |
| DCPDeviceDescription (const MacAddress &mac, const std::map< BlockKey, std::vector< std::uint8_t > > &blocks) | |
| Build a description from a device's MAC and its parsed DCP blocks. | |
| std::uint16_t | VendorId () const |
| Combine VendorHigh/VendorLow into a 16-bit vendor ID. | |
| std::uint16_t | DeviceId () const |
| Combine DeviceHigh/DeviceLow into a 16-bit device ID. | |
| std::string | VendorName () const |
| Look up the vendor name for this device's vendor ID. | |
| std::string | ToString () const |
| Multi-line human-readable summary of this device. | |
Public Attributes | |
| std::string | mac |
| Device's MAC address, formatted as a string. | |
| std::string | deviceType |
| Device type string (e.g. model name). | |
| std::string | name |
| Station name. | |
| std::string | ip = "0.0.0.0" |
| IPv4 address, or "0.0.0.0" if unset. | |
| std::string | netmask = "0.0.0.0" |
| IPv4 subnet mask, or "0.0.0.0" if unset. | |
| std::string | gateway = "0.0.0.0" |
| IPv4 default gateway, or "0.0.0.0" if unset. | |
| DcpIpBlockInfo | ipBlockInfo = DcpIpBlockInfo::NotSet |
| IP block info flags (see IPBlockInfo). | |
| bool | ipConflict = false |
| Whether an IP address conflict was detected. | |
| bool | ipSetByDhcp = false |
| Whether the IP address was assigned via DHCP. | |
| std::uint16_t | vendorId = 0 |
| The PROFINET vendor ID. | |
| std::uint8_t | vendorHigh = 0 |
| High byte of the PROFINET vendor ID. | |
| std::uint8_t | vendorLow = 0 |
| Low byte of the PROFINET vendor ID. | |
| std::uint16_t | deviceId = 0 |
| The PROFINET device ID. | |
| std::uint8_t | deviceHigh = 0 |
| High byte of the PROFINET device ID. | |
| std::uint8_t | deviceLow = 0 |
| Low byte of the PROFINET device ID. | |
| std::uint8_t | deviceRole = 0 |
| Raw device role bitmask. | |
| std::vector< std::string > | deviceRoles |
| Decoded device role names (see DecodeDeviceRole()). | |
| std::pair< std::uint8_t, std::uint8_t > | deviceInstance {0, 0} |
| Device instance (high, low) pair. | |
| std::string | aliasName |
| Device alias name, if set. | |
| std::vector< BlockKey > | supportedOptions |
| List of (option, suboption) blocks the device supports. | |
| std::vector< DCPDHCPBlock > | dhcpBlocks |
| Parsed DHCP blocks from the response, if any. | |
| DcpDeviceInitiative | deviceInitiative = DcpDeviceInitiative::NoHello |
| Raw device-initiative value (see DeviceInitiative). | |
| bool | issuesHello = false |
| Whether the device issues a DCP-Hello after power-on. | |
| std::map< BlockKey, std::vector< std::uint8_t > > | rawBlocks |
| Any parsed blocks not covered by the named fields above. | |
| profinet::dcp::DCPDeviceDescription::DCPDeviceDescription | ( | const MacAddress & | mac, |
| const std::map< BlockKey, std::vector< std::uint8_t > > & | blocks | ||
| ) |
Build a description from a device's MAC and its parsed DCP blocks.
| mac | Source MAC address the response came from. |
| blocks | Parsed (option,suboption) -> payload blocks from the response. |
Definition at line 603 of file dcp.cpp.
References profinet::ByteAt(), profinet::DecodeBytes(), profinet::dcp::DecodeDeviceRole(), profinet::wire::Reader::Fixed(), profinet::dcp::HasConflict(), profinet::dcp::IsDhcp(), profinet::Mac2String(), profinet::dcp::MakeBlockKey(), option, profinet::wire::Reader::Skip(), profinet::String2Ip(), suboption, profinet::wire::Reader::U16(), and profinet::wire::Reader::U8().
Here is the call graph for this function:
|
inline |
Combine DeviceHigh/DeviceLow into a 16-bit device ID.
Definition at line 357 of file dcp.h.
References deviceId.
Referenced by profinet::device::ProfinetDevice::GetInfo(), profinet::dcp::TEST(), and profinet::dcp::TEST().
Here is the caller graph for this function:| std::string profinet::dcp::DCPDeviceDescription::ToString | ( | ) | const |
Multi-line human-readable summary of this device.
Definition at line 751 of file dcp.cpp.
References profinet::DeviceId, profinet::dcp::GetBlockName(), profinet::dcp::GetDeviceInitiativeName(), profinet::dcp::GetIPBlockInfoName(), profinet::Hex4(), option, suboption, and profinet::ToHex().
Referenced by profinet::device::ProfinetDevice::Discover().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Combine VendorHigh/VendorLow into a 16-bit vendor ID.
Definition at line 350 of file dcp.h.
References vendorId.
Referenced by profinet::device::ProfinetDevice::GetInfo(), profinet::dcp::TEST(), and profinet::dcp::TEST().
Here is the caller graph for this function:| std::string profinet::dcp::DCPDeviceDescription::VendorName | ( | ) | const |
Look up the vendor name for this device's vendor ID.
Definition at line 746 of file dcp.cpp.
References profinet::GetVendorName().
Referenced by profinet::device::ProfinetDevice::GetInfo().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string profinet::dcp::DCPDeviceDescription::aliasName |
Device alias name, if set.
Definition at line 330 of file dcp.h.
Referenced by profinet::dcp::TEST().
| std::uint8_t profinet::dcp::DCPDeviceDescription::deviceHigh = 0 |
High byte of the PROFINET device ID.
Definition at line 315 of file dcp.h.
Referenced by profinet::rpc::RPCCon::RPCCon().
| std::uint16_t profinet::dcp::DCPDeviceDescription::deviceId = 0 |
| DcpDeviceInitiative profinet::dcp::DCPDeviceDescription::deviceInitiative = DcpDeviceInitiative::NoHello |
Raw device-initiative value (see DeviceInitiative).
Definition at line 340 of file dcp.h.
Referenced by profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::pair<std::uint8_t, std::uint8_t> profinet::dcp::DCPDeviceDescription::deviceInstance {0, 0} |
Device instance (high, low) pair.
Definition at line 327 of file dcp.h.
Referenced by profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::uint8_t profinet::dcp::DCPDeviceDescription::deviceLow = 0 |
Low byte of the PROFINET device ID.
Definition at line 318 of file dcp.h.
Referenced by profinet::rpc::RPCCon::RPCCon().
| std::uint8_t profinet::dcp::DCPDeviceDescription::deviceRole = 0 |
| std::vector<std::string> profinet::dcp::DCPDeviceDescription::deviceRoles |
Decoded device role names (see DecodeDeviceRole()).
Definition at line 324 of file dcp.h.
Referenced by profinet::device::ProfinetDevice::GetInfo(), profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::string profinet::dcp::DCPDeviceDescription::deviceType |
Device type string (e.g. model name).
Definition at line 279 of file dcp.h.
Referenced by profinet::device::ProfinetDevice::GetInfo(), profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::vector<DCPDHCPBlock> profinet::dcp::DCPDeviceDescription::dhcpBlocks |
Parsed DHCP blocks from the response, if any.
Definition at line 336 of file dcp.h.
Referenced by profinet::dcp::TEST().
| std::string profinet::dcp::DCPDeviceDescription::gateway = "0.0.0.0" |
IPv4 default gateway, or "0.0.0.0" if unset.
Definition at line 291 of file dcp.h.
Referenced by profinet::device::ProfinetDevice::GetInfo(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::string profinet::dcp::DCPDeviceDescription::ip = "0.0.0.0" |
IPv4 address, or "0.0.0.0" if unset.
Definition at line 285 of file dcp.h.
Referenced by profinet::rpc::RPCCon::RPCCon(), profinet::device::ProfinetDevice::FromIp(), profinet::device::ProfinetDevice::GetInfo(), profinet::device::ProfinetDevice::Ip(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), and profinet::device::ProfinetDevice::ToString().
| DcpIpBlockInfo profinet::dcp::DCPDeviceDescription::ipBlockInfo = DcpIpBlockInfo::NotSet |
IP block info flags (see IPBlockInfo).
Definition at line 294 of file dcp.h.
Referenced by profinet::dcp::TEST(), profinet::dcp::TEST(), and profinet::dcp::TEST().
| bool profinet::dcp::DCPDeviceDescription::ipConflict = false |
Whether an IP address conflict was detected.
Definition at line 297 of file dcp.h.
Referenced by profinet::dcp::TEST(), and profinet::dcp::TEST().
| bool profinet::dcp::DCPDeviceDescription::ipSetByDhcp = false |
Whether the IP address was assigned via DHCP.
Definition at line 300 of file dcp.h.
Referenced by profinet::dcp::TEST(), and profinet::dcp::TEST().
| bool profinet::dcp::DCPDeviceDescription::issuesHello = false |
Whether the device issues a DCP-Hello after power-on.
Definition at line 343 of file dcp.h.
Referenced by profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::string profinet::dcp::DCPDeviceDescription::mac |
Device's MAC address, formatted as a string.
Definition at line 276 of file dcp.h.
Referenced by profinet::device::ProfinetDevice::GetInfo(), profinet::device::ProfinetDevice::Mac(), profinet::device::ProfinetDevice::StartAlarmListener(), profinet::device::ProfinetDevice::StartCyclic(), profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::string profinet::dcp::DCPDeviceDescription::name |
Station name.
Definition at line 282 of file dcp.h.
Referenced by profinet::device::ProfinetDevice::Connect(), profinet::device::ProfinetDevice::GetInfo(), profinet::rpc::GetStationInfo(), profinet::rpc::RpcTests::MakeRpcTestDeviceInfo(), MakeTestDeviceDescription(), profinet::device::ProfinetDevice::Name(), profinet::rpc::RPCCon::SendReceive(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::device::TEST(), profinet::device::TEST(), profinet::device::TEST(), profinet::device::TEST_F(), TEST_F(), and profinet::device::ProfinetDevice::ToString().
| std::string profinet::dcp::DCPDeviceDescription::netmask = "0.0.0.0" |
IPv4 subnet mask, or "0.0.0.0" if unset.
Definition at line 288 of file dcp.h.
Referenced by profinet::device::ProfinetDevice::GetInfo(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::map<BlockKey, std::vector<std::uint8_t> > profinet::dcp::DCPDeviceDescription::rawBlocks |
Any parsed blocks not covered by the named fields above.
Definition at line 346 of file dcp.h.
Referenced by profinet::dcp::TEST().
| std::vector<BlockKey> profinet::dcp::DCPDeviceDescription::supportedOptions |
List of (option, suboption) blocks the device supports.
Definition at line 333 of file dcp.h.
Referenced by profinet::dcp::TEST(), and profinet::dcp::TEST().
| std::uint8_t profinet::dcp::DCPDeviceDescription::vendorHigh = 0 |
High byte of the PROFINET vendor ID.
Definition at line 306 of file dcp.h.
Referenced by profinet::rpc::RPCCon::RPCCon().
| std::uint16_t profinet::dcp::DCPDeviceDescription::vendorId = 0 |
| std::uint8_t profinet::dcp::DCPDeviceDescription::vendorLow = 0 |
Low byte of the PROFINET vendor ID.
Definition at line 309 of file dcp.h.
Referenced by profinet::rpc::RPCCon::RPCCon().