UDPLogger loggs and plots data of incoming UDP messages. The signals in a UDP dataframe are defined in an Excel(.xlsx) or .xml file and are imported into the logger.
To use the UDPLogger efficiently the following workflow can be considered
The variables in the UDP packet can be defined wheter in a XML file or in an Excel file
The following datatypes for the signals are supported:
<Signals>
<Signal name="time" unit="ms" datatype="int32_t">
<Signal name="temp" unit="°C" datatype="float">
<Signal name="gyx" unit="°/s" datatype="float">
<Signal name="gyy" unit="°/s" datatype="float">
<Signal name="gyz" unit="°/s" datatype="float">
</Signals>
Required fields:
name
datatype
Optional:
unit: used in the plots and exported to the netcdf file
structname: used to generate the udp packet file. It is usefull if many variables shall be packet. So in the c function only the pointer of the struct and not all variables have to be imported
The excel sheet shall have a header row with the following column titles:
Required columns:
Signalname
Datatype
Optional:
Unit: used in the plots and exported to the netcdf file
Structname: used to generate the udp packet file. It is usefull if many variables shall be packet. So in the c function only the pointer of the struct and not all variables have to be imported
Creating header and source file from the data definition. This files can be used directly in the source code of the application to correctly create the udp packet.
packing.h
#ifndef CREATEUDPPACKAGE_H
#define CREATEUDPPACKAGE_H
#include <stdint.h>
int createUDPPackage(char* udp_buffer, const int buffer_length,
const int32_t time, const float temp, const float gyx,
const float gyy, const float gyz);
#endif // CREATEUDPPACKAGE_H
packing.cpp
// Automatically generated by UDPLogger.
#include <string.h>
#include "udpPacket.h"
int createUDPPackage(char* udp_buffer, const int buffer_length,
const int32_t time, const float temp, const float gyx,
const float gyy, const float gyz) {
if (20 > buffer_length) {
return -1;
}
char* pointer = udp_buffer;
pointer = udp_buffer + 0;
memcpy(pointer, &time, sizeof(time));
pointer = udp_buffer + 4;
memcpy(pointer, &temp, sizeof(temp));
pointer = udp_buffer + 8;
memcpy(pointer, &gyx, sizeof(gyx));
pointer = udp_buffer + 12;
memcpy(pointer, &gyy, sizeof(gyy));
pointer = udp_buffer + 16;
memcpy(pointer, &gyz, sizeof(gyz));
return 0;
}
The latest stable can be downloaded from Flathub. The latest version can be found on Gitlab
For build instructions see Build Instructions