aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-11-02 17:50:35 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-11-02 17:50:35 +0200
commitf0905c07b9b5bc33aa9bad914ca799cf1e8a920c (patch)
tree707079eae0630224126e228363a65b67192bc59b /Software/Embedded_SW/Embedded
parentfd4bdbad20a83025adbd8ec7992b4756e9d29c4d (diff)
downloadTango-f0905c07b9b5bc33aa9bad914ca799cf1e8a920c.tar.gz
Tango-f0905c07b9b5bc33aa9bad914ca799cf1e8a920c.zip
persistent alarms + config params description
Diffstat (limited to 'Software/Embedded_SW/Embedded')
-rw-r--r--Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c19
-rw-r--r--Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c6
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c3
4 files changed, 26 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c
index 6c8a5aeb9..2ed0ef818 100644
--- a/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c
+++ b/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c
@@ -52,7 +52,7 @@ void alarm_handling_item__free_unpacked
assert(message->base.descriptor == &alarm_handling_item__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[11] =
+static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] =
{
{
"",
@@ -186,6 +186,18 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[11]
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "",
+ 12,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BOOL,
+ offsetof(AlarmHandlingItem, has_ispersistent),
+ offsetof(AlarmHandlingItem, ispersistent),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned alarm_handling_item__field_indices_by_name[] = {
5, /* field[5] = AlarmDirection */
@@ -196,6 +208,7 @@ static const unsigned alarm_handling_item__field_indices_by_name[] = {
10, /* field[10] = EventName */
9, /* field[9] = EventType */
1, /* field[1] = Frequency */
+ 11, /* field[11] = IsPersistent */
3, /* field[3] = ModuleDeviceId */
7, /* field[7] = Predecessor */
6, /* field[6] = Severity */
@@ -203,7 +216,7 @@ static const unsigned alarm_handling_item__field_indices_by_name[] = {
static const ProtobufCIntRange alarm_handling_item__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 11 }
+ { 0, 12 }
};
const ProtobufCMessageDescriptor alarm_handling_item__descriptor =
{
@@ -213,7 +226,7 @@ const ProtobufCMessageDescriptor alarm_handling_item__descriptor =
"",
"",
sizeof(AlarmHandlingItem),
- 11,
+ 12,
alarm_handling_item__field_descriptors,
alarm_handling_item__field_indices_by_name,
1, alarm_handling_item__number_ranges,
diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h
index 467dc0c7d..f69c7b96d 100644
--- a/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h
+++ b/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h
@@ -50,10 +50,12 @@ struct _AlarmHandlingItem
protobuf_c_boolean has_eventtype;
EventType eventtype;
char *eventname;
+ protobuf_c_boolean has_ispersistent;
+ protobuf_c_boolean ispersistent;
};
#define ALARM_HANDLING_ITEM__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&alarm_handling_item__descriptor) \
- , 0, ALARM_SOURCE_TYPE__TemperatureAlarm, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, DEBUG_LOG_CATEGORY__Info, 0, 0, 0, 0, 0, EVENT_TYPE__None, NULL }
+ , 0, ALARM_SOURCE_TYPE__TemperatureAlarm, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, DEBUG_LOG_CATEGORY__Info, 0, 0, 0, 0, 0, EVENT_TYPE__None, NULL, 0, 0 }
/* AlarmHandlingItem methods */
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
index 88ef35236..127ccbabf 100644
--- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
@@ -163,6 +163,7 @@ typedef struct
uint16_t Predecessor;
uint8_t DebounceValue;
EventType EventType;
+ bool isPersistent;
}AlarmHandlingItemStruc;
typedef struct
{
@@ -500,6 +501,7 @@ uint32_t AlarmHandlingLoadFile(void)
FileAlarmItem[F_count].Predecessor = AlarmParametersTable->alarmitem[i]->predecessor;
FileAlarmItem[F_count].DebounceValue = AlarmParametersTable->alarmitem[i]->debouncevalue;
FileAlarmItem[F_count].EventType = AlarmParametersTable->alarmitem[i]->eventtype;
+ FileAlarmItem[F_count].isPersistent = AlarmParametersTable->alarmitem[i]->ispersistent;
p_size+= sizeof(AlarmHandlingItemStruc);
F_count++;
@@ -1077,8 +1079,8 @@ void AlarmHandlingInternalSetAlarm(uint32_t AlarmId, bool value)
{
if (AlarmItem[Alarm_i].EventType == AlarmId)
{
- if (0) // PERSISTENT ALARM
- //if ((AlarmItem[Alarm_i].EventType == EVENT_TYPE__UNINTENDED_RESET)) // PERSISTENT ALARM simulate
+ //if (0) // PERSISTENT ALARM
+ if ((AlarmItem[Alarm_i].isPersistent == true)) // PERSISTENT ALARM simulate
{
if (PersistentEventsResponse.events == NULL)
PersistentEventsResponse.events = (Event **)my_malloc(sizeof(Event*)*(PersistentEventsResponse.n_events+1));
diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
index b03494496..193a35e12 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
@@ -304,6 +304,9 @@ void LoadConfigurationParameters(ConfigurationParameters *Params)
else
{
EmbeddedParameters = Params;
+ if (EmbeddedParameters->description)
+ Report(EmbeddedParameters->description, __FILE__,__LINE__,112233, RpMessage, 445566, 0);
+
}
}
uint32_t EmbeddedParametersInit(void)