libdoip  0.1.0
DoIP (Diagnostics over Internet Protocol) ISO 13400 C++17 Library
doip::DoIPServerModel Struct Reference

DoIP Server Model - Configuration and callbacks for a DoIP server connection. More...

#include <DoIPServerModel.h>

Inheritance diagram for doip::DoIPServerModel:

Public Member Functions

bool hasDownstreamHandler () const
 Check if downstream forwarding is enabled. More...
 

Public Attributes

ServerModelOpenHandler onOpenConnection
 Called when the connection is being opened. More...
 
ServerModelCloseHandler onCloseConnection
 Called when the connection is being closed. More...
 
ServerModelDiagnosticHandler onDiagnosticMessage
 Called when a diagnostic message is received (for local handling) More...
 
ServerModelDiagnosticNotificationHandler onDiagnosticNotification
 Called after a diagnostic ACK/NACK was sent to the client. More...
 
ServerModelDownstreamHandler onDownstreamRequest
 Called when a diagnostic message should be forwarded downstream. More...
 
DoIPAddress serverAddress = DoIPAddress(0x0E00)
 The logical address of this DoIP server. More...
 

Detailed Description

DoIP Server Model - Configuration and callbacks for a DoIP server connection.

This struct holds all application-specific configuration and callbacks that customize the behavior of a DoIP server connection. It separates the protocol logic (in DoIPServerStateMachine) from the application logic.

Definition at line 65 of file DoIPServerModel.h.

Member Function Documentation

◆ hasDownstreamHandler()

bool doip::DoIPServerModel::hasDownstreamHandler ( ) const
inline

Check if downstream forwarding is enabled.

Returns
true if onDownstreamRequest callback is set

Definition at line 100 of file DoIPServerModel.h.

References onDownstreamRequest.

Member Data Documentation

◆ onCloseConnection

ServerModelCloseHandler doip::DoIPServerModel::onCloseConnection

Called when the connection is being closed.

Definition at line 70 of file DoIPServerModel.h.

Referenced by doip::DefaultDoIPServerModel::DefaultDoIPServerModel().

◆ onDiagnosticMessage

ServerModelDiagnosticHandler doip::DoIPServerModel::onDiagnosticMessage

Called when a diagnostic message is received (for local handling)

Definition at line 73 of file DoIPServerModel.h.

Referenced by doip::DefaultDoIPServerModel::DefaultDoIPServerModel().

◆ onDiagnosticNotification

ServerModelDiagnosticNotificationHandler doip::DoIPServerModel::onDiagnosticNotification

Called after a diagnostic ACK/NACK was sent to the client.

Definition at line 76 of file DoIPServerModel.h.

Referenced by doip::DefaultDoIPServerModel::DefaultDoIPServerModel().

◆ onDownstreamRequest

ServerModelDownstreamHandler doip::DoIPServerModel::onDownstreamRequest

Called when a diagnostic message should be forwarded downstream.

If this callback is set (not nullptr), the state machine will use it to forward diagnostic messages to downstream devices. If not set, messages are handled locally via onDiagnosticMessage.

Typical usage:

  • Set this for gateway ECUs that forward to CAN/LIN subnets
  • Leave unset for end-node ECUs that handle messages locally

Definition at line 91 of file DoIPServerModel.h.

Referenced by doip::DefaultDoIPServerModel::DefaultDoIPServerModel(), and hasDownstreamHandler().

◆ onOpenConnection

ServerModelOpenHandler doip::DoIPServerModel::onOpenConnection

Called when the connection is being opened.

Definition at line 67 of file DoIPServerModel.h.

Referenced by doip::DefaultDoIPServerModel::DefaultDoIPServerModel().

◆ serverAddress

DoIPAddress doip::DoIPServerModel::serverAddress = DoIPAddress(0x0E00)

The logical address of this DoIP server.

Definition at line 94 of file DoIPServerModel.h.


The documentation for this struct was generated from the following file: