Read Handler

Setup the onReadRequest handler of the CommonBackend class to handle read events. Processing a read request for a non-remote system in direct read mode is the same as non-direct read mode.

This handler takes a protobuf message of type FrontendRequest. You can process multiple read requests in parallel threads where each read request has its own ID.

Example

commonBackend.onReadRequest([&](const FrontendRequest& request)
{
    logDebug("Backend processes onReadRequest request: \n" + request.DebugString());

    if (doExit || !request.has_query())
    {
        return;
    }

    // function to send a response to WinCC OA
    const auto sendReadResponseFunc = [&](const ReadResponse& response)
    {
        commonBackend.makeReadResponseSender().sendReadResponse(request, response);
    };

    ReadHandler::processReadRequest(sendReadResponseFunc, request);

});

All active backends accept read requests (even if they do not contain the requested DPEs).