|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
PNIO application error with error codes. More...
#include <exceptions.h>
Inheritance diagram for profinet::PNIOError:
Collaboration diagram for profinet::PNIOError:Public Member Functions | |
| PNIOError (const std::string &message, std::uint8_t errorCode, std::uint8_t errorDecode, std::uint8_t errorCode1, std::uint8_t errorCode2) | |
| Construct directly from the four raw error-status bytes. | |
| bool | IsCmError () const |
| Whether this error came from the PNIO-CM (connection management) table. | |
| std::string | BlockName () const |
| Human-readable name of the PNIO-CM block referenced by ErrorCode1. | |
Public Member Functions inherited from profinet::RPCError | |
| RPCError (const std::string &message) | |
| Construct with a human-readable message. | |
Public Member Functions inherited from profinet::ProfinetError | |
| ProfinetError (const std::string &message) | |
| Construct with a human-readable message. | |
Static Public Member Functions | |
| static PNIOError | FromBytes (std::span< const std::uint8_t, 4 > data) |
| Create a PNIOError from a raw 4-byte error status. | |
| static PNIOError | FromArgsStatus (std::uint32_t argsStatus) |
| Create a PNIOError from the little-endian ArgsStatus field carried in a DCE/RPC PDU. | |
Public Attributes | |
| std::uint8_t | errorCode = 0 |
| Raw ErrorCode byte (see class-level. | |
| std::uint8_t | errorDecode = 0 |
| Raw ErrorDecode byte; selects which ErrorCode1/ErrorCode2 table applies. | |
| std::uint8_t | errorCode1 = 0 |
| Raw ErrorCode1 byte (category / block type). | |
| std::uint8_t | errorCode2 = 0 |
| Raw ErrorCode2 byte (specific error within the category). | |
Static Private Member Functions | |
| static void | extracted (const std::uint8_t &errorCode1, const std::uint8_t &errorCode2, std::string &message) |
| Shared implementation for FromBytes()/FromArgsStatus(): look up the error message and construct the PNIOError. | |
| static PNIOError | CreateFromCodes (std::uint8_t errorCode, std::uint8_t errorDecode, std::uint8_t errorCode1, std::uint8_t errorCode2) |
PNIO application error with error codes.
Error code structure (4 bytes):
Definition at line 691 of file exceptions.h.
|
inline |
Construct directly from the four raw error-status bytes.
| message | Human-readable message describing the error. |
| errorCode | Raw ErrorCode byte. |
| errorDecode | Raw ErrorDecode byte. |
| errorCode1 | Raw ErrorCode1 byte. |
| errorCode2 | Raw ErrorCode2 byte. |
Definition at line 712 of file exceptions.h.
| std::string profinet::PNIOError::BlockName | ( | ) | const |
Human-readable name of the PNIO-CM block referenced by ErrorCode1.
Definition at line 647 of file exceptions.cpp.
References errorCode1, profinet::GetPnioCmErrorCode1Name(), and IsCmError().
Here is the call graph for this function:
|
staticprivate |
Definition at line 617 of file exceptions.cpp.
References profinet::DecodePnioCmError(), profinet::DecodePnioError(), profinet::DecodePnioRWError(), errorCode, errorCode1, errorCode2, errorDecode, profinet::Hex2(), profinet::Pnio, profinet::PnioCm, and profinet::PnioRw.
Referenced by FromArgsStatus(), and FromBytes().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Shared implementation for FromBytes()/FromArgsStatus(): look up the error message and construct the PNIOError.
| errorCode | Raw ErrorCode byte. |
| errorDecode | Raw ErrorDecode byte. |
| errorCode1 | Raw ErrorCode1 byte. |
| errorCode2 | Raw ErrorCode2 byte. |
|
static |
Create a PNIOError from the little-endian ArgsStatus field carried in a DCE/RPC PDU.
| argsStatus | Raw args status field as read from the wire (little-endian). |
See Python's PNIOError.from_args_status for the byte swap rationale.
Definition at line 522 of file exceptions.cpp.
References CreateFromCodes(), errorCode, errorCode1, errorCode2, errorDecode, profinet::LowByteMask, profinet::OneOctetShift, profinet::ThreeOctetsShift, and profinet::TwoOctetsShift.
Referenced by profinet::rpc::RPCCon::Connect(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::RPCCon::SendControl(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Create a PNIOError from a raw 4-byte error status.
| data | Span view containing exactly 4 bytes: ErrorCode, ErrorDecode, ErrorCode1, ErrorCode2. |
Definition at line 506 of file exceptions.cpp.
References CreateFromCodes().
Here is the call graph for this function:
|
inline |
Whether this error came from the PNIO-CM (connection management) table.
Definition at line 738 of file exceptions.h.
References errorDecode, and profinet::PnioCm.
Referenced by BlockName().
Here is the caller graph for this function:| std::uint8_t profinet::PNIOError::errorCode = 0 |
Raw ErrorCode byte (see class-level.
).
Definition at line 695 of file exceptions.h.
Referenced by CreateFromCodes(), and FromArgsStatus().
| std::uint8_t profinet::PNIOError::errorCode1 = 0 |
Raw ErrorCode1 byte (category / block type).
Definition at line 701 of file exceptions.h.
Referenced by BlockName(), CreateFromCodes(), profinet::rpc::RPCCon::EnumerateIndices(), and FromArgsStatus().
| std::uint8_t profinet::PNIOError::errorCode2 = 0 |
Raw ErrorCode2 byte (specific error within the category).
Definition at line 704 of file exceptions.h.
Referenced by CreateFromCodes(), profinet::rpc::RPCCon::EnumerateIndices(), and FromArgsStatus().
| std::uint8_t profinet::PNIOError::errorDecode = 0 |
Raw ErrorDecode byte; selects which ErrorCode1/ErrorCode2 table applies.
Definition at line 698 of file exceptions.h.
Referenced by CreateFromCodes(), FromArgsStatus(), and IsCmError().