498 views
in System Integration by

Hi,

in my project I am saving settings on the device.

One of those settings is an ordered list of enum entries. The enum consists of items

/* This enum defines the possible actions that may be applied to an animal. */
typedef XEnum DeviceAction;

#define DeviceActionUNDEFINED                               0
#define DeviceActionTempMeasurement                         1
#define DeviceActionRating                                  2
#define DeviceActionAlarm                                   4
#define DeviceActionWatch                                   8
[...]

The order of the items is saved in text representation:

"1, 256, 2, 2048, 4096, 8192, 4, 8, 16, 128, 64, 32, 1024, 16384"

When loading the settings I want to check if the items in the string are valid enum items. According to the documentation casting integers to enums is checked during prototyping. Is there a simple possibility to add the check on the platform as well?

1 Answer

0 votes
by
Hello Urbaner,

no, there is no mechanism to perform such check. You will need to implement the test in the routine responsible for loading the settings.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...