Event_Priorities in Get_Event_Information is read form associated notification-class object.

This commit is contained in:
k001a
2011-07-13 21:14:52 +00:00
parent 536438d23e
commit 2364561f19
4 changed files with 30 additions and 9 deletions
+2 -4
View File
@@ -895,10 +895,8 @@ int Analog_Input_Event_Information(unsigned index,
bitstring_set_bit(&getevent_data->eventEnable, TRANSITION_TO_NORMAL,
(AI_Descr[index].Event_Enable & EVENT_ENABLE_TO_NORMAL ) ? true : false );
/* Event Priorities */
/* FIXME: finish it */
getevent_data->eventPriorities[0] = 255;
getevent_data->eventPriorities[1] = 255;
getevent_data->eventPriorities[2] = 255;
Notification_Class_Get_Priorities(AI_Descr[index].Notification_Class,
getevent_data->eventPriorities);
return 1; /* active event */
}
+2 -4
View File
@@ -1006,10 +1006,8 @@ int Analog_Value_Event_Information(unsigned index,
bitstring_set_bit(&getevent_data->eventEnable, TRANSITION_TO_NORMAL,
(AV_Descr[index].Event_Enable & EVENT_ENABLE_TO_NORMAL ) ? true : false );
/* Event Priorities */
/* FIXME: finish it */
getevent_data->eventPriorities[0] = 255;
getevent_data->eventPriorities[1] = 255;
getevent_data->eventPriorities[2] = 255;
Notification_Class_Get_Priorities(AV_Descr[index].Notification_Class,
getevent_data->eventPriorities);
return 1; /* active event */
}
+22
View File
@@ -684,6 +684,28 @@ bool Notification_Class_Write_Property(
break;
}
return status;
}
void Notification_Class_Get_Priorities(
uint32_t Object_Instance, uint32_t *pPriorityArray)
{
NOTIFICATION_CLASS_INFO *CurrentNotify;
uint32_t object_index;
int i;
object_index = Notification_Class_Instance_To_Index(Object_Instance);
if (object_index < MAX_NOTIFICATION_CLASSES)
CurrentNotify = &NC_Info[object_index];
else {
for(i = 0; i < 3; i++)
pPriorityArray[i] = 255;
return; /* unknown object */
}
for(i = 0; i < 3; i++)
pPriorityArray[i] = CurrentNotify->Priority[i];
}
+4 -1
View File
@@ -102,7 +102,10 @@ typedef struct Notification_Class_info {
BACNET_READ_PROPERTY_DATA * rpdata);
bool Notification_Class_Write_Property(
BACNET_WRITE_PROPERTY_DATA * wp_data);
BACNET_WRITE_PROPERTY_DATA * wp_data);
void Notification_Class_Get_Priorities(
uint32_t Object_Instance, uint32_t *pPriorityArray);
void Notification_Class_common_reporting_function(
BACNET_EVENT_NOTIFICATION_DATA * event_data);