Sync some handler fixes and demo object fixes and updates and some comment fixes from branch bacnet-stack-0-8-0.
This commit is contained in:
@@ -808,6 +808,7 @@ static void BuildPropRequest(
|
||||
}
|
||||
propEntry->propertyIdentifier = Property_Value_List[i].property_id;
|
||||
propEntry->propertyArrayIndex = BACNET_ARRAY_ALL;
|
||||
propEntry->next = NULL;
|
||||
oldEntry = propEntry;
|
||||
propEntry = NULL;
|
||||
}
|
||||
@@ -1377,6 +1378,7 @@ void StartNextObject(
|
||||
rpm_object->object_instance = pNewObject->instance;
|
||||
rpm_property = calloc(1, sizeof(BACNET_PROPERTY_REFERENCE));
|
||||
rpm_object->listOfProperties = rpm_property;
|
||||
rpm_object->next = NULL;
|
||||
assert(rpm_property);
|
||||
rpm_property->propertyIdentifier = PROP_ALL;
|
||||
rpm_property->propertyArrayIndex = BACNET_ARRAY_ALL;
|
||||
|
||||
@@ -298,9 +298,11 @@ void dlenv_init(
|
||||
if (!datalink_init(getenv("BACNET_IFACE"))) {
|
||||
exit(1);
|
||||
}
|
||||
#if (MAX_TSM_TRANSACTIONS)
|
||||
pEnv = getenv("BACNET_INVOKE_ID");
|
||||
if (pEnv) {
|
||||
tsm_invokeID_set((uint8_t) strtol(pEnv, NULL, 0));
|
||||
}
|
||||
#endif
|
||||
dlenv_register_as_foreign_device();
|
||||
}
|
||||
|
||||
@@ -892,13 +892,13 @@ void handler_cov_subscribe(
|
||||
bytes_sent =
|
||||
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
|
||||
pdu_len);
|
||||
if (bytes_sent <= 0) {
|
||||
#if PRINT_ENABLED
|
||||
if (bytes_sent <= 0)
|
||||
fprintf(stderr, "SubscribeCOV: Failed to send PDU (%s)!\n",
|
||||
strerror(errno));
|
||||
#else
|
||||
bytes_sent = bytes_sent;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
|
||||
ANALOG_INPUT_DESCR AI_Descr[MAX_ANALOG_INPUTS];
|
||||
|
||||
/* These arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Analog_Input_Properties_Required[] = {
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
@@ -62,7 +62,7 @@ static const int Analog_Input_Properties_Required[] = {
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Input_Properties_Optional[] = {
|
||||
static const int Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_RELIABILITY,
|
||||
PROP_COV_INCREMENT,
|
||||
@@ -81,7 +81,7 @@ static const int Analog_Input_Properties_Optional[] = {
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Input_Properties_Proprietary[] = {
|
||||
static const int Properties_Proprietary[] = {
|
||||
9997,
|
||||
9998,
|
||||
9999,
|
||||
@@ -94,11 +94,11 @@ void Analog_Input_Property_Lists(
|
||||
const int **pProprietary)
|
||||
{
|
||||
if (pRequired)
|
||||
*pRequired = Analog_Input_Properties_Required;
|
||||
*pRequired = Properties_Required;
|
||||
if (pOptional)
|
||||
*pOptional = Analog_Input_Properties_Optional;
|
||||
*pOptional = Properties_Optional;
|
||||
if (pProprietary)
|
||||
*pProprietary = Analog_Input_Properties_Proprietary;
|
||||
*pProprietary = Properties_Proprietary;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -100,10 +100,9 @@ void Analog_Value_Property_Lists(
|
||||
void Analog_Value_Init(
|
||||
void)
|
||||
{
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
unsigned i, j;
|
||||
#else
|
||||
unsigned i;
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
unsigned j;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < MAX_ANALOG_VALUES; i++) {
|
||||
@@ -247,7 +246,7 @@ int Analog_Value_Read_Property(
|
||||
ANALOG_VALUE_DESCR *CurrentAV;
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
int len = 0;
|
||||
unsigned int i = 0;
|
||||
unsigned i = 0;
|
||||
#endif
|
||||
|
||||
if ((rpdata == NULL) || (rpdata->application_data == NULL) ||
|
||||
|
||||
@@ -54,8 +54,8 @@ static BACNET_LIFE_SAFETY_OPERATION
|
||||
/* Writable out-of-service allows others to play with our Present Value */
|
||||
/* without changing the physical output */
|
||||
static bool Life_Safety_Point_Out_Of_Service[MAX_LIFE_SAFETY_POINTS];
|
||||
/* These arrays are used by the ReadPropertyMultiple handler and
|
||||
property-list property (as of protocol-revision 14) */
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Life_Safety_Point_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
#endif
|
||||
|
||||
/* When all the priorities are level null, the present value returns */
|
||||
/* the Relinquish Default value */
|
||||
#define MULTISTATE_RELINQUISH_DEFAULT 1 /* multistates cannot be 0 ! */
|
||||
/* the Relinquish Default value, 0 is not allowed */
|
||||
#define MULTISTATE_RELINQUISH_DEFAULT 1
|
||||
|
||||
/* NULL part of the array */
|
||||
#define MULTISTATE_NULL (255)
|
||||
|
||||
@@ -1594,13 +1594,13 @@ static int local_read_property(
|
||||
* Attempt to fetch the logged property and store it in the Trend Log *
|
||||
****************************************************************************/
|
||||
|
||||
static void TL_fetch_property(
|
||||
void TL_fetch_property(
|
||||
int iLog)
|
||||
{
|
||||
uint8_t ValueBuf[MAX_APDU]; /* This is a big buffer in case someone selects the device object list for example */
|
||||
uint8_t StatusBuf[3]; /* Should be tag, bits unused in last octet and 1 byte of data */
|
||||
BACNET_ERROR_CLASS error_class = 0;
|
||||
BACNET_ERROR_CODE error_code = ERROR_CODE_SUCCESS;
|
||||
BACNET_ERROR_CLASS error_class = ERROR_CLASS_SERVICES;
|
||||
BACNET_ERROR_CODE error_code = ERROR_CODE_OTHER;
|
||||
int iLen;
|
||||
uint8_t ucCount;
|
||||
TL_LOG_INFO *CurrentLog;
|
||||
|
||||
Reference in New Issue
Block a user