cleaned up compiler warnings
This commit is contained in:
@@ -176,8 +176,7 @@ void dlenv_maintenance_timer(
|
|||||||
BBMD_Timer_Seconds -= elapsed_seconds;
|
BBMD_Timer_Seconds -= elapsed_seconds;
|
||||||
}
|
}
|
||||||
if (BBMD_Timer_Seconds == 0) {
|
if (BBMD_Timer_Seconds == 0) {
|
||||||
int retval;
|
(void)dlenv_register_as_foreign_device();
|
||||||
retval = dlenv_register_as_foreign_device();
|
|
||||||
/* If that failed (negative), maybe just a network issue.
|
/* If that failed (negative), maybe just a network issue.
|
||||||
* If nothing happened (0), may be un/misconfigured.
|
* If nothing happened (0), may be un/misconfigured.
|
||||||
* Set up to try again later in all cases. */
|
* Set up to try again later in all cases. */
|
||||||
|
|||||||
@@ -150,6 +150,13 @@ void handler_get_alarm_summary(
|
|||||||
bytes_sent =
|
bytes_sent =
|
||||||
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
|
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
|
||||||
pdu_len);
|
pdu_len);
|
||||||
|
#if PRINT_ENABLED
|
||||||
|
if (bytes_sent <= 0) {
|
||||||
|
fprintf(stderr, "Failed to send PDU (%s)!\n", strerror(errno));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
bytes_sent = bytes_sent;
|
||||||
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,8 +99,10 @@ void handler_i_am_bind(
|
|||||||
len =
|
len =
|
||||||
iam_decode_service_request(service_request, &device_id, &max_apdu,
|
iam_decode_service_request(service_request, &device_id, &max_apdu,
|
||||||
&segmentation, &vendor_id);
|
&segmentation, &vendor_id);
|
||||||
/* only add address if requested to bind */
|
if (len > 0) {
|
||||||
address_add_binding(device_id, max_apdu, src);
|
/* only add address if requested to bind */
|
||||||
|
address_add_binding(device_id, max_apdu, src);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,11 +66,14 @@ void handler_timesync(
|
|||||||
len =
|
len =
|
||||||
timesync_decode_service_request(service_request, service_len, &bdate,
|
timesync_decode_service_request(service_request, service_len, &bdate,
|
||||||
&btime);
|
&btime);
|
||||||
|
if (len > 0) {
|
||||||
#if PRINT_ENABLED
|
#if PRINT_ENABLED
|
||||||
fprintf(stderr, "Received TimeSyncronization Request\r\n");
|
fprintf(stderr, "Received TimeSyncronization Request\r\n");
|
||||||
show_bacnet_date_time(&bdate, &btime);
|
show_bacnet_date_time(&bdate, &btime);
|
||||||
|
#else
|
||||||
|
/* FIXME: set the time? */
|
||||||
#endif
|
#endif
|
||||||
/* FIXME: set the time? */
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -89,11 +92,13 @@ void handler_timesync_utc(
|
|||||||
len =
|
len =
|
||||||
timesync_decode_service_request(service_request, service_len, &bdate,
|
timesync_decode_service_request(service_request, service_len, &bdate,
|
||||||
&btime);
|
&btime);
|
||||||
|
if (len > 0) {
|
||||||
#if PRINT_ENABLED
|
#if PRINT_ENABLED
|
||||||
fprintf(stderr, "Received TimeSyncronization Request\r\n");
|
fprintf(stderr, "Received TimeSyncronization Request\r\n");
|
||||||
show_bacnet_date_time(&bdate, &btime);
|
show_bacnet_date_time(&bdate, &btime);
|
||||||
#endif
|
#endif
|
||||||
/* FIXME: set the time? */
|
/* FIXME: set the time? */
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,4 +203,11 @@ void handler_write_property_multiple(
|
|||||||
bytes_sent =
|
bytes_sent =
|
||||||
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
|
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
|
||||||
pdu_len);
|
pdu_len);
|
||||||
|
#if PRINT_ENABLED
|
||||||
|
if (bytes_sent <= 0) {
|
||||||
|
fprintf(stderr, "Failed to send PDU (%s)!\n", strerror(errno));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
bytes_sent = bytes_sent;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ uint8_t Send_Read_Property_Request_Address(
|
|||||||
{
|
{
|
||||||
BACNET_ADDRESS my_address;
|
BACNET_ADDRESS my_address;
|
||||||
uint8_t invoke_id = 0;
|
uint8_t invoke_id = 0;
|
||||||
bool status = false;
|
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int pdu_len = 0;
|
int pdu_len = 0;
|
||||||
int bytes_sent = 0;
|
int bytes_sent = 0;
|
||||||
|
|||||||
@@ -405,7 +405,6 @@ bool Analog_Output_Write_Property(
|
|||||||
{
|
{
|
||||||
bool status = false; /* return value */
|
bool status = false; /* return value */
|
||||||
unsigned int object_index = 0;
|
unsigned int object_index = 0;
|
||||||
uint8_t level = AO_LEVEL_NULL;
|
|
||||||
int len = 0;
|
int len = 0;
|
||||||
BACNET_APPLICATION_DATA_VALUE value;
|
BACNET_APPLICATION_DATA_VALUE value;
|
||||||
|
|
||||||
@@ -451,7 +450,6 @@ bool Analog_Output_Write_Property(
|
|||||||
WPValidateArgType(&value, BACNET_APPLICATION_TAG_NULL,
|
WPValidateArgType(&value, BACNET_APPLICATION_TAG_NULL,
|
||||||
&wp_data->error_class, &wp_data->error_code);
|
&wp_data->error_class, &wp_data->error_code);
|
||||||
if (status) {
|
if (status) {
|
||||||
level = AO_LEVEL_NULL;
|
|
||||||
object_index =
|
object_index =
|
||||||
Analog_Output_Instance_To_Index(wp_data->
|
Analog_Output_Instance_To_Index(wp_data->
|
||||||
object_instance);
|
object_instance);
|
||||||
|
|||||||
@@ -312,8 +312,13 @@ bool bacfile_write_property(
|
|||||||
len =
|
len =
|
||||||
bacapp_decode_application_data(wp_data->application_data,
|
bacapp_decode_application_data(wp_data->application_data,
|
||||||
wp_data->application_data_len, &value);
|
wp_data->application_data_len, &value);
|
||||||
|
if (len < 0) {
|
||||||
|
/* error while decoding - a value larger than we can handle */
|
||||||
|
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||||
|
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
/* FIXME: len < application_data_len: more data? */
|
/* FIXME: len < application_data_len: more data? */
|
||||||
/* FIXME: len == 0: unable to decode? */
|
|
||||||
switch (wp_data->object_property) {
|
switch (wp_data->object_property) {
|
||||||
case PROP_ARCHIVE:
|
case PROP_ARCHIVE:
|
||||||
/* 12.13.8 Archive
|
/* 12.13.8 Archive
|
||||||
|
|||||||
@@ -358,7 +358,6 @@ int Multistate_Input_Read_Property(
|
|||||||
BACNET_CHARACTER_STRING char_string;
|
BACNET_CHARACTER_STRING char_string;
|
||||||
uint32_t present_value = 0;
|
uint32_t present_value = 0;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
unsigned int object_index = 0;
|
|
||||||
bool state = false;
|
bool state = false;
|
||||||
uint8_t *apdu = NULL;
|
uint8_t *apdu = NULL;
|
||||||
|
|
||||||
@@ -435,9 +434,6 @@ int Multistate_Input_Read_Property(
|
|||||||
} else if (rpdata->array_index == BACNET_ARRAY_ALL) {
|
} else if (rpdata->array_index == BACNET_ARRAY_ALL) {
|
||||||
/* if no index was specified, then try to encode the entire list */
|
/* if no index was specified, then try to encode the entire list */
|
||||||
/* into one packet. */
|
/* into one packet. */
|
||||||
object_index =
|
|
||||||
Multistate_Input_Instance_To_Index(rpdata->
|
|
||||||
object_instance);
|
|
||||||
for (i = 1; i <= MULTISTATE_NUMBER_OF_STATES; i++) {
|
for (i = 1; i <= MULTISTATE_NUMBER_OF_STATES; i++) {
|
||||||
characterstring_init_ansi(&char_string,
|
characterstring_init_ansi(&char_string,
|
||||||
Multistate_Input_State_Text(rpdata->object_instance,
|
Multistate_Input_State_Text(rpdata->object_instance,
|
||||||
@@ -457,9 +453,6 @@ int Multistate_Input_Read_Property(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
object_index =
|
|
||||||
Multistate_Input_Instance_To_Index(rpdata->
|
|
||||||
object_instance);
|
|
||||||
if (rpdata->array_index <= MULTISTATE_NUMBER_OF_STATES) {
|
if (rpdata->array_index <= MULTISTATE_NUMBER_OF_STATES) {
|
||||||
characterstring_init_ansi(&char_string,
|
characterstring_init_ansi(&char_string,
|
||||||
Multistate_Input_State_Text(rpdata->object_instance,
|
Multistate_Input_State_Text(rpdata->object_instance,
|
||||||
|
|||||||
Reference in New Issue
Block a user