diff --git a/bacnet-stack/demo/object/device.c b/bacnet-stack/demo/object/device.c index eddfb853..37dedeb4 100644 --- a/bacnet-stack/demo/object/device.c +++ b/bacnet-stack/demo/object/device.c @@ -468,7 +468,7 @@ char *Device_Valid_Object_Id(int object_type, uint32_t object_instance) name = Analog_Output_Name(object_instance); break; case OBJECT_LIFE_SAFETY_POINT: - name = Analog_Output_Name(object_instance); + name = Life_Safety_Point_Name(object_instance); break; #if BACFILE case OBJECT_FILE: @@ -588,10 +588,19 @@ int Device_Encode_Property_APDU(uint8_t * apdu, } /* FIXME: indicate the objects that YOU support */ bitstring_set_bit(&bit_string, OBJECT_DEVICE, true); - bitstring_set_bit(&bit_string, OBJECT_ANALOG_INPUT, true); - bitstring_set_bit(&bit_string, OBJECT_ANALOG_OUTPUT, true); + if (Analog_Input_Count()) + bitstring_set_bit(&bit_string, OBJECT_ANALOG_INPUT, true); + if (Analog_Output_Count()) + bitstring_set_bit(&bit_string, OBJECT_ANALOG_OUTPUT, true); + if (Binary_Input_Count()) + bitstring_set_bit(&bit_string, OBJECT_BINARY_INPUT, true); + if (Binary_Output_Count()) + bitstring_set_bit(&bit_string, OBJECT_BINARY_OUTPUT, true); + if (Life_Safety_Point_Count()) + bitstring_set_bit(&bit_string, OBJECT_LIFE_SAFETY_POINT, true); #if BACFILE - bitstring_set_bit(&bit_string, OBJECT_FILE, true); + if (bacfile_count()) + bitstring_set_bit(&bit_string, OBJECT_FILE, true); #endif apdu_len = encode_tagged_bitstring(&apdu[0], &bit_string); break; diff --git a/bacnet-stack/demo/object/lsp.c b/bacnet-stack/demo/object/lsp.c index 691e6521..63080df7 100644 --- a/bacnet-stack/demo/object/lsp.c +++ b/bacnet-stack/demo/object/lsp.c @@ -288,7 +288,7 @@ bool Life_Safety_Point_Write_Property(BACNET_WRITE_PROPERTY_DATA * wp_data, #include #include "ctest.h" -void testAnalogOutput(Test * pTest) +void testLifeSafetyPoint(Test * pTest) { uint8_t apdu[MAX_APDU] = { 0 }; int len = 0; @@ -316,15 +316,15 @@ void testAnalogOutput(Test * pTest) return; } -#ifdef TEST_ANALOG_OUTPUT +#ifdef TEST_LIFE_SAFETY_POINT int main(void) { Test *pTest; bool rc; - pTest = ct_create("BACnet Analog Output", NULL); + pTest = ct_create("BACnet Life Safety Point", NULL); /* individual tests */ - rc = ct_addTestFunction(pTest, testAnalogOutput); + rc = ct_addTestFunction(pTest, testLifeSafetyPoint); assert(rc); ct_setStream(pTest, stdout); @@ -334,5 +334,5 @@ int main(void) return 0; } -#endif /* TEST_ANALOG_INPUT */ +#endif /* TEST_LIFE_SAFETY_POINT */ #endif /* TEST */ diff --git a/bacnet-stack/demo/object/lsp.h b/bacnet-stack/demo/object/lsp.h index 2b1cedc3..35f274b8 100644 --- a/bacnet-stack/demo/object/lsp.h +++ b/bacnet-stack/demo/object/lsp.h @@ -51,7 +51,7 @@ extern "C" { #ifdef TEST #include "ctest.h" - void testAnalogOutput(Test * pTest); + void testLifeSafetyPoint(Test * pTest); #endif #ifdef __cplusplus