Merge pull request #82 from se-apc/devel/object_event_state (#853)

Replacing hardcoded NORMAL event state with the factual objects event…

Co-authored-by: Tomasz Kazimierz Motyl <tomasz.motyl@se.com>
This commit is contained in:
Tomasz Kazimierz Motyl
2024-11-21 11:20:30 +00:00
committed by GitHub
parent 5bb2546efb
commit c71b2e3a66
2 changed files with 10 additions and 6 deletions
+5 -3
View File
@@ -908,7 +908,9 @@ int Binary_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
case PROP_STATUS_FLAGS:
/* note: see the details in the standard on how to use these */
bitstring_init(&bit_string);
bitstring_set_bit(&bit_string, STATUS_FLAG_IN_ALARM, false);
bitstring_set_bit(
&bit_string, STATUS_FLAG_IN_ALARM,
pObject->Event_State != EVENT_STATE_NORMAL);
state = Binary_Input_Fault(rpdata->object_instance);
bitstring_set_bit(&bit_string, STATUS_FLAG_FAULT, state);
bitstring_set_bit(&bit_string, STATUS_FLAG_OVERRIDDEN, false);
@@ -917,8 +919,8 @@ int Binary_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
break;
case PROP_EVENT_STATE:
apdu_len =
encode_application_enumerated(&apdu[0], EVENT_STATE_NORMAL);
apdu_len = encode_application_enumerated(
&apdu[0], Binary_Input_Event_State(rpdata->object_instance));
break;
case PROP_OUT_OF_SERVICE:
state = Binary_Input_Out_Of_Service(rpdata->object_instance);
+5 -3
View File
@@ -915,7 +915,9 @@ int Binary_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
case PROP_STATUS_FLAGS:
/* note: see the details in the standard on how to use these */
bitstring_init(&bit_string);
bitstring_set_bit(&bit_string, STATUS_FLAG_IN_ALARM, false);
bitstring_set_bit(
&bit_string, STATUS_FLAG_IN_ALARM,
pObject->Event_State != EVENT_STATE_NORMAL);
state = Binary_Value_Fault(rpdata->object_instance);
bitstring_set_bit(&bit_string, STATUS_FLAG_FAULT, state);
bitstring_set_bit(&bit_string, STATUS_FLAG_OVERRIDDEN, false);
@@ -924,8 +926,8 @@ int Binary_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
break;
case PROP_EVENT_STATE:
apdu_len =
encode_application_enumerated(&apdu[0], EVENT_STATE_NORMAL);
apdu_len = encode_application_enumerated(
&apdu[0], Binary_Value_Event_State(rpdata->object_instance));
break;
case PROP_OUT_OF_SERVICE:
state = Binary_Value_Out_Of_Service(rpdata->object_instance);