Dissable warnings for byteoffset in DDE

Hello Community,

how do I get rid of the warnings for the byteoffset in the DDE?



Hello @stegmaf,

if you are using the rapidM2M Studio, you no longer needed the “byteosf” attribute. This is calculated automatically.

The error message means that the byte positions you specified and the automatically calculated byte positions do not match. You may have miscalculated somewhere in the offset.

To avoid such a calculation error, the rapidM2M Studio takes over this calculation for you and provides you a definition of an array with symbolic indices for your measurement data and configurations.

Here is an example:

Data Decriptor:

#config0 BasicCfg down title="Basic configuration"
RecordInterval        u32  title="Record Interval"                  units="sec"  min=10  default=60                                          // Record Interval
TransmissionInterval  u32  title="Transmission Interval"            units="min"  min=10  default=60   vscale=0.01666666667                   // Transmission Interval
TransmissionMode      u8   title="Transmission Mode"                                     default=0    editmask=0=Interval;1=Wakeup;2=Online  // Transmission Mode

#histdata0 Measurements up
VoltageBattery  s16  title="Battery Voltage"  decpl=2  units="V"    vscale=0.001  // Battery Voltage
VoltageInput    s16  title="Input Voltage"    decpl=2  units="V"    vscale=0.001  // Input Voltage
Temperature     s16  title="Temperature"      decpl=1  units="°C"   vscale=0.1    // Temperature
Humidity        s16  title="Humidity"         decpl=1  units="%"                  // Humidity
GSM_Level       s16  title="GSM Level"                 units="dBm"                // GSM Level

Automatically generated definition of the arrays (to be found in ~auto-dde.inc);

#define DDE_BasicCfg [
	.RecordInterval,                         // u32
	.TransmissionInterval,                   // u32
	.TransmissionMode,                       // u8

#define DDE_Measurements [
	.VoltageBattery,                         // s16
	.VoltageInput,                           // s16
	.Temperature,                            // s16
	.Humidity,                               // s16
	.GSM_Level,                              // s16

Using the definition of the measurement data array

new aRecData[DDE_Measurements];         // Temporary memory for the data record to be saved

aRecData.VoltageInput   = aSysValues.VIn; // Copies the last valid values for Vin into the temporary memory for the data record to be saved
aRecData.VoltageBattery = aSysValues.VAux;// Copies the last valid values for Vaux into the temporary memory for the data record to be saved
// Init with "open loop" value to identify missing measurements (temp/rH simply stay unchanged in case of an error)
aRecData.Temperature = S16_OL;
aRecData.Humidity    = S16_OL;
aRecData.GSM_Level = getRSSI();         // Reads out the current GSM-level

DDE_Measurements_write(0, aRecData);    // Transfers data record to the system to be recorded

For more information you can see the “Wireless Thermometer” example in the “Samples” collection of the rapidM2M studio

Kind regards