From 309f03d22f9f01c4ee41f20f223a70e900b74582 Mon Sep 17 00:00:00 2001 From: Patrick Grimm Date: Thu, 12 Apr 2018 17:20:58 +0200 Subject: [PATCH] fix cov handling Changed --- demo/object/bi.c | 2 ++ demo/object/bo.c | 11 ++++++++++- demo/object/bv.c | 2 ++ demo/object/msi.c | 2 ++ demo/object/mso.c | 2 ++ demo/object/msv.c | 2 ++ 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/demo/object/bi.c b/demo/object/bi.c index 3b90783..28ffcf4 100644 --- a/demo/object/bi.c +++ b/demo/object/bi.c @@ -805,6 +805,7 @@ bool Binary_Input_Present_Value_Set( CurrentBI = &BI_Descr[index]; CurrentBI->Present_Value = (uint8_t) value; CurrentBI->Priority_Array[priority - 1] = (uint8_t) value; + CurrentBI->Changed = true; status = true; } return status; @@ -841,6 +842,7 @@ bool Binary_Input_Polarity_Set( index = Binary_Input_Instance_To_Index(object_instance); CurrentBI = &BI_Descr[index]; CurrentBI->Polarity=polarity; + CurrentBI->Changed = true; sprintf(idx_cc,"%d",index); idx_c = idx_cc; if(ctx) { diff --git a/demo/object/bo.c b/demo/object/bo.c index d226a75..635cda4 100644 --- a/demo/object/bo.c +++ b/demo/object/bo.c @@ -808,7 +808,7 @@ bool Binary_Output_Present_Value_Set( index = Binary_Output_Instance_To_Index(object_instance); CurrentBO = &BO_Descr[index]; if (priority && (priority <= BACNET_MAX_PRIORITY) && - (priority != 6 /* reserved */ ) && (value > 0)) { + (priority != 6 /* reserved */ )) { #if defined(INTRINSIC_REPORTING) CurrentBO->Feedback_Value = (uint8_t) value; #endif @@ -816,6 +816,7 @@ bool Binary_Output_Present_Value_Set( if (priority == 8) { CurrentBO->Priority_Array[15] = (uint8_t) value; } + CurrentBO->Changed = true; status = true; } } @@ -853,6 +854,7 @@ bool Binary_Output_Polarity_Set( index = Binary_Output_Instance_To_Index(object_instance); CurrentBO = &BO_Descr[index]; CurrentBO->Polarity=polarity; + CurrentBO->Changed = true; sprintf(idx_cc,"%d",index); idx_c = idx_cc; if(ctx) { @@ -1132,6 +1134,13 @@ int Binary_Output_Read_Property( break; #if defined(INTRINSIC_REPORTING) + case PROP_ALARM_VALUE: + len = + encode_application_enumerated(&apdu[apdu_len], + (CurrentBO->Feedback_Value == 1) ? 0 : 1); + apdu_len += len; + break; + case PROP_FEEDBACK_VALUE: len = encode_application_enumerated(&apdu[apdu_len], diff --git a/demo/object/bv.c b/demo/object/bv.c index 572af7f..9cfef2b 100644 --- a/demo/object/bv.c +++ b/demo/object/bv.c @@ -804,6 +804,7 @@ bool Binary_Value_Present_Value_Set( CurrentBV = &BV_Descr[index]; CurrentBV->Present_Value = (uint8_t) value; CurrentBV->Priority_Array[priority - 1] = (uint8_t) value; + CurrentBV->Changed = true; status = true; } return status; @@ -840,6 +841,7 @@ bool Binary_Value_Polarity_Set( index = Binary_Value_Instance_To_Index(object_instance); CurrentBV = &BV_Descr[index]; CurrentBV->Polarity=polarity; + CurrentBV->Changed = true; sprintf(idx_cc,"%d",index); idx_c = idx_cc; if(ctx) { diff --git a/demo/object/msi.c b/demo/object/msi.c index 2457f65..b56fcab 100644 --- a/demo/object/msi.c +++ b/demo/object/msi.c @@ -538,6 +538,7 @@ bool Multistate_Input_Present_Value_Set( if (priority == 8) { CurrentMSI->Priority_Array[15] = (uint8_t) value; } + CurrentMSI->Changed = true; status = true; } } @@ -571,6 +572,7 @@ void Multistate_Input_Out_Of_Service_Set( index = Multistate_Input_Instance_To_Index(object_instance); CurrentMSI = &MSI_Descr[index]; CurrentMSI->Out_Of_Service = value; + CurrentMSI->Changed = true; } } diff --git a/demo/object/mso.c b/demo/object/mso.c index 0f78227..f752d38 100644 --- a/demo/object/mso.c +++ b/demo/object/mso.c @@ -550,6 +550,7 @@ bool Multistate_Output_Present_Value_Set( if (priority == 8) { CurrentMSO->Priority_Array[15] = (uint8_t) value; } + CurrentMSO->Changed = true; status = true; } } @@ -583,6 +584,7 @@ void Multistate_Output_Out_Of_Service_Set( index = Multistate_Output_Instance_To_Index(object_instance); CurrentMSO = &MSO_Descr[index]; CurrentMSO->Out_Of_Service = value; + CurrentMSO->Changed = true; } } diff --git a/demo/object/msv.c b/demo/object/msv.c index dae9715..814be14 100644 --- a/demo/object/msv.c +++ b/demo/object/msv.c @@ -538,6 +538,7 @@ bool Multistate_Value_Present_Value_Set( if (priority == 8) { CurrentMSV->Priority_Array[15] = (uint8_t) value; } + CurrentMSV->Changed = true; status = true; } } @@ -571,6 +572,7 @@ void Multistate_Value_Out_Of_Service_Set( index = Multistate_Value_Instance_To_Index(object_instance); CurrentMSV = &MSV_Descr[index]; CurrentMSV->Out_Of_Service = value; + CurrentMSV->Changed = true; } }