Source code for dlt_hv/scanner.h

// SPDX-License-Identifier: MIT

#pragma once

#include <pthread.h>
#include <safu/ringbuffer_types.h>
#include <stddef.h>
#include <time.h>

#include "dlt_hv/types.h"
#include "elos/libelosdlt/dltmapper_types.h"

#define ELOS_DLT_MESSAGE_CODE 2042
#define ELOS_DLT_SCAN_FREQUENCY 2277
[docs][docs]/****************************** * The Scanner plugin instance * * Member: * shmemFd: The file descriptor for with the shared memory buffer * offsetAddress: The configured value from what offset the buffer should start * bufferSize: The configured size of the buffer * shmemFile: The file from where to get the shared memory buffer * shmemLogEntries: The number of log entries the shared memory buffer can hold * shmemData: The memory mapped dlt buffer * localBufferCopy: A local copy of the dlt shared memory buffer * idxRead: The read index for the dlt shared memory buffer * parserQueue: The ring buffer to queue log entries for parsing * shmemDataSize: The size of the shared memory buffer * publisher: The publisher to use for publishing events * scannerThread: The thread with the scanner that looks for new dlt entries * stopCmd: The evntfd to tell the plugin to stop * moreToRead: The eventfd for the scanner thread to tell that more events can be parsed and published * sleepInterval: The time to sleep between checks in the dlt memory buffer ******************************/ typedef struct elosDltScanner {
[docs][docs] int shmemFd;
[docs][docs] size_t offsetAddress;
[docs][docs] size_t bufferSize;
[docs][docs] char *shmemFile;
[docs][docs] size_t shmemLogEntries;
[docs][docs] void *shmemData;
[docs][docs] elosEbLogRingBuffer_t *localBufferCopy;
[docs][docs] uint16_t idxRead;
[docs][docs] safuRingBuffer_t parserQueue;
[docs][docs] size_t shmemDataSize;
[docs][docs] elosDltMapper_t mapper;
[docs][docs][docs][docs] struct elosPublisher *publisher;
[docs][docs] pthread_t scannerThread;
[docs][docs] int stopCmd;
[docs][docs] int moreToRead;
[docs][docs] struct timespec sleepInterval;
} elosDltScanner_t;