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:
@@ -468,7 +468,7 @@ char *Device_Valid_Object_Id(int object_type, uint32_t object_instance)
|
|||||||
name = Analog_Output_Name(object_instance);
|
name = Analog_Output_Name(object_instance);
|
||||||
break;
|
break;
|
||||||
case OBJECT_LIFE_SAFETY_POINT:
|
case OBJECT_LIFE_SAFETY_POINT:
|
||||||
name = Analog_Output_Name(object_instance);
|
name = Life_Safety_Point_Name(object_instance);
|
||||||
break;
|
break;
|
||||||
#if BACFILE
|
#if BACFILE
|
||||||
case OBJECT_FILE:
|
case OBJECT_FILE:
|
||||||
@@ -588,10 +588,19 @@ int Device_Encode_Property_APDU(uint8_t * apdu,
|
|||||||
}
|
}
|
||||||
/* FIXME: indicate the objects that YOU support */
|
/* FIXME: indicate the objects that YOU support */
|
||||||
bitstring_set_bit(&bit_string, OBJECT_DEVICE, true);
|
bitstring_set_bit(&bit_string, OBJECT_DEVICE, true);
|
||||||
bitstring_set_bit(&bit_string, OBJECT_ANALOG_INPUT, true);
|
if (Analog_Input_Count())
|
||||||
bitstring_set_bit(&bit_string, OBJECT_ANALOG_OUTPUT, true);
|
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
|
#if BACFILE
|
||||||
bitstring_set_bit(&bit_string, OBJECT_FILE, true);
|
if (bacfile_count())
|
||||||
|
bitstring_set_bit(&bit_string, OBJECT_FILE, true);
|
||||||
#endif
|
#endif
|
||||||
apdu_len = encode_tagged_bitstring(&apdu[0], &bit_string);
|
apdu_len = encode_tagged_bitstring(&apdu[0], &bit_string);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ bool Life_Safety_Point_Write_Property(BACNET_WRITE_PROPERTY_DATA * wp_data,
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "ctest.h"
|
#include "ctest.h"
|
||||||
|
|
||||||
void testAnalogOutput(Test * pTest)
|
void testLifeSafetyPoint(Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU] = { 0 };
|
uint8_t apdu[MAX_APDU] = { 0 };
|
||||||
int len = 0;
|
int len = 0;
|
||||||
@@ -316,15 +316,15 @@ void testAnalogOutput(Test * pTest)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TEST_ANALOG_OUTPUT
|
#ifdef TEST_LIFE_SAFETY_POINT
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
Test *pTest;
|
Test *pTest;
|
||||||
bool rc;
|
bool rc;
|
||||||
|
|
||||||
pTest = ct_create("BACnet Analog Output", NULL);
|
pTest = ct_create("BACnet Life Safety Point", NULL);
|
||||||
/* individual tests */
|
/* individual tests */
|
||||||
rc = ct_addTestFunction(pTest, testAnalogOutput);
|
rc = ct_addTestFunction(pTest, testLifeSafetyPoint);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
ct_setStream(pTest, stdout);
|
ct_setStream(pTest, stdout);
|
||||||
@@ -334,5 +334,5 @@ int main(void)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* TEST_ANALOG_INPUT */
|
#endif /* TEST_LIFE_SAFETY_POINT */
|
||||||
#endif /* TEST */
|
#endif /* TEST */
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ extern "C" {
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
#include "ctest.h"
|
#include "ctest.h"
|
||||||
void testAnalogOutput(Test * pTest);
|
void testLifeSafetyPoint(Test * pTest);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
Reference in New Issue
Block a user