IncomingMessage

class IncomingMessage : public Remote::Message::IMessageInterface, public std::enable_shared_from_this<IncomingMessage>

facade model to read incoming messages (ASDU packages)

Public Functions

~IncomingMessage()

free extracted information object

CS101_ASDU getAsdu() const

Getter for internal ASDU packet.

Returns:

ASDU packet

unsigned char *getRawBytes() const

Getter for raw bytes.

Returns:

bytes

std::string getRawMessageString() const

Getter for raw bytes text explanation.

Returns:

string

std::uint_fast8_t getNumberOfObject() const

Get the number of information objects inside this message.

Returns:

count

void first()

Extract the first information object contained in this message.

bool next()

Extract the next information object contained in this message.

Returns:

information on operation success: is a new information object extracted and available

bool isValidCauseOfTransmission() const

test if cause of transmission is compatible with information type

Throws:

std::invalid_argument – if feature is not yet implemented for that information type

Returns:

if cause is valid

bool requireConfirmation() const

test if message is a command and requires a confirmation (ACK)

bool isSelectCommand() const

test if message is a command with select flag set

CS101_QualifierOfCommand getCommandQualifier() const

get the command duration qualifier, only available for single, double or regulation step commands

Public Static Functions

static inline std::shared_ptr<IncomingMessage> create(CS101_ASDU packet, CS101_AppLayerParameters app_layer_parameters)

Create an IncomingMessage as facade pattern to access an incoming CS101_ASDU packet via object oriented methods.

Parameters:
  • packet – internal incoming message

  • app_layer_parameters – connection parameters

Throws:

std::invalid_argument – if information value is incompatible with information type