Corrected life safety point info in device object.

Added binary input, binary output, and life safety point to the object-types-supported property in the device object.
Corrected life safety unit test.
This commit is contained in:
skarg
2006-05-05 19:08:39 +00:00
parent a6cd9d3967
commit a5715f1cd1
3 changed files with 19 additions and 10 deletions
+13 -4
View File
@@ -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;
+5 -5
View File
@@ -288,7 +288,7 @@ bool Life_Safety_Point_Write_Property(BACNET_WRITE_PROPERTY_DATA * wp_data,
#include <string.h>
#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 */
+1 -1
View File
@@ -51,7 +51,7 @@ extern "C" {
#ifdef TEST
#include "ctest.h"
void testAnalogOutput(Test * pTest);
void testLifeSafetyPoint(Test * pTest);
#endif
#ifdef __cplusplus