101 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

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...