Code cleanup to get rid of some warnings during compilation.
This commit is contained in:
@@ -72,6 +72,7 @@
|
|||||||
#include "wp.h"
|
#include "wp.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "lso.h"
|
#include "lso.h"
|
||||||
|
#include "alarm_ack.h"
|
||||||
|
|
||||||
/* required object - note: developer must supply the device.c file
|
/* required object - note: developer must supply the device.c file
|
||||||
since it is not included in the library. However, the library
|
since it is not included in the library. However, the library
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ int alarm_ack_decode_service_request(
|
|||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int section_len;
|
int section_len;
|
||||||
|
uint32_t enumValue;
|
||||||
|
|
||||||
if (-1 == (section_len =
|
if (-1 == (section_len =
|
||||||
decode_context_unsigned(&apdu[len], 0,
|
decode_context_unsigned(&apdu[len], 0,
|
||||||
@@ -141,9 +142,10 @@ int alarm_ack_decode_service_request(
|
|||||||
|
|
||||||
if (-1 == (section_len =
|
if (-1 == (section_len =
|
||||||
decode_context_enumerated(&apdu[len], 2,
|
decode_context_enumerated(&apdu[len], 2,
|
||||||
(int *) &data->eventTypeAcked))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
data->eventTypeAcked = (BACNET_EVENT_TYPE)enumValue;
|
||||||
len += section_len;
|
len += section_len;
|
||||||
|
|
||||||
if (-1 == (section_len =
|
if (-1 == (section_len =
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ int arf_decode_service_request(
|
|||||||
if (tag_number != BACNET_APPLICATION_TAG_OBJECT_ID)
|
if (tag_number != BACNET_APPLICATION_TAG_OBJECT_ID)
|
||||||
return -1;
|
return -1;
|
||||||
len += decode_object_id(&apdu[len], &type, &data->object_instance);
|
len += decode_object_id(&apdu[len], &type, &data->object_instance);
|
||||||
data->object_type = type;
|
data->object_type = (BACNET_OBJECT_TYPE)type;
|
||||||
if (decode_is_opening_tag_number(&apdu[len], 0)) {
|
if (decode_is_opening_tag_number(&apdu[len], 0)) {
|
||||||
data->access = FILE_STREAM_ACCESS;
|
data->access = FILE_STREAM_ACCESS;
|
||||||
/* a tag number is not extended so only one octet */
|
/* a tag number is not extended so only one octet */
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ int awf_decode_service_request(
|
|||||||
if (tag_number != BACNET_APPLICATION_TAG_OBJECT_ID)
|
if (tag_number != BACNET_APPLICATION_TAG_OBJECT_ID)
|
||||||
return -1;
|
return -1;
|
||||||
len += decode_object_id(&apdu[len], &type, &data->object_instance);
|
len += decode_object_id(&apdu[len], &type, &data->object_instance);
|
||||||
data->object_type = type;
|
data->object_type = (BACNET_OBJECT_TYPE)type;
|
||||||
if (decode_is_opening_tag_number(&apdu[len], 0)) {
|
if (decode_is_opening_tag_number(&apdu[len], 0)) {
|
||||||
data->access = FILE_STREAM_ACCESS;
|
data->access = FILE_STREAM_ACCESS;
|
||||||
/* a tag number of 2 is not extended so only one octet */
|
/* a tag number of 2 is not extended so only one octet */
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ int bacapp_decode_device_obj_property_ref(
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
int apdu_len = 0;
|
int apdu_len = 0;
|
||||||
|
uint32_t enumValue;
|
||||||
if (-1 == (len =
|
if (-1 == (len =
|
||||||
decode_context_object_id(&apdu[apdu_len], 0,
|
decode_context_object_id(&apdu[apdu_len], 0,
|
||||||
&value->objectIdentifier.type,
|
&value->objectIdentifier.type,
|
||||||
@@ -106,9 +106,10 @@ int bacapp_decode_device_obj_property_ref(
|
|||||||
|
|
||||||
if (-1 == (len =
|
if (-1 == (len =
|
||||||
decode_context_enumerated(&apdu[apdu_len], 1,
|
decode_context_enumerated(&apdu[apdu_len], 1,
|
||||||
&value->propertyIdentifier))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->propertyIdentifier = (BACNET_PROPERTY_ID)enumValue;
|
||||||
apdu_len += len;
|
apdu_len += len;
|
||||||
|
|
||||||
if (decode_is_context_tag(&apdu[apdu_len], 2)) {
|
if (decode_is_context_tag(&apdu[apdu_len], 2)) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ int bacapp_decode_property_state(
|
|||||||
int len = 0;
|
int len = 0;
|
||||||
uint32_t len_value_type;
|
uint32_t len_value_type;
|
||||||
int section_length;
|
int section_length;
|
||||||
|
uint32_t enumValue;
|
||||||
|
|
||||||
section_length =
|
section_length =
|
||||||
decode_tag_number_and_value(&apdu[len], (uint8_t *) & value->tag,
|
decode_tag_number_and_value(&apdu[len], (uint8_t *) & value->tag,
|
||||||
@@ -65,81 +65,91 @@ int bacapp_decode_property_state(
|
|||||||
case BINARY_VALUE:
|
case BINARY_VALUE:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.binaryValue))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.binaryValue = (BACNET_BINARY_PV)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_TYPE:
|
case EVENT_TYPE:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.eventType))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.eventType = (BACNET_EVENT_TYPE)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case POLARITY:
|
case POLARITY:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.polarity))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.polarity = (BACNET_POLARITY)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROGRAM_CHANGE:
|
case PROGRAM_CHANGE:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.programChange))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.programChange = (BACNET_PROGRAM_REQUEST)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROGRAM_STATE:
|
case PROGRAM_STATE:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.programState))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.programState = (BACNET_PROGRAM_STATE)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REASON_FOR_HALT:
|
case REASON_FOR_HALT:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.programError))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.programError = (BACNET_PROGRAM_ERROR)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RELIABILITY:
|
case RELIABILITY:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.reliability))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.reliability = (BACNET_RELIABILITY)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE:
|
case STATE:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.state))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.state = (BACNET_EVENT_STATE)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SYSTEM_STATUS:
|
case SYSTEM_STATUS:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.systemStatus))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.systemStatus = (BACNET_DEVICE_STATUS)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UNITS:
|
case UNITS:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.units))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.units = (BACNET_ENGINEERING_UNITS)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UNSIGNED_VALUE:
|
case UNSIGNED_VALUE:
|
||||||
@@ -153,17 +163,19 @@ int bacapp_decode_property_state(
|
|||||||
case LIFE_SAFETY_MODE:
|
case LIFE_SAFETY_MODE:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.lifeSafetyMode))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.lifeSafetyMode = (BACNET_LIFE_SAFETY_MODE)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LIFE_SAFETY_STATE:
|
case LIFE_SAFETY_STATE:
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
decode_enumerated(&apdu[len], len_value_type,
|
decode_enumerated(&apdu[len], len_value_type,
|
||||||
&value->state.lifeSafetyState))) {
|
&enumValue))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
value->state.lifeSafetyState = (BACNET_LIFE_SAFETY_STATE)enumValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ uint16_t bip_receive(
|
|||||||
fd_set read_fds;
|
fd_set read_fds;
|
||||||
int max = 0;
|
int max = 0;
|
||||||
struct timeval select_timeout;
|
struct timeval select_timeout;
|
||||||
struct sockaddr_in sin = { -1 };
|
struct sockaddr_in sin = { 0 };
|
||||||
socklen_t sin_len = sizeof(sin);
|
socklen_t sin_len = sizeof(sin);
|
||||||
uint16_t i = 0;
|
uint16_t i = 0;
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ uint16_t bip_receive(
|
|||||||
select_timeout.tv_usec = 1000 * timeout;
|
select_timeout.tv_usec = 1000 * timeout;
|
||||||
}
|
}
|
||||||
FD_ZERO(&read_fds);
|
FD_ZERO(&read_fds);
|
||||||
FD_SET((unsigned int) BIP_Socket, &read_fds);
|
FD_SET(BIP_Socket, &read_fds);
|
||||||
max = BIP_Socket;
|
max = BIP_Socket;
|
||||||
/* see if there is a packet for us */
|
/* see if there is a packet for us */
|
||||||
if (select(max + 1, &read_fds, NULL, NULL, &select_timeout) > 0)
|
if (select(max + 1, &read_fds, NULL, NULL, &select_timeout) > 0)
|
||||||
|
|||||||
@@ -659,7 +659,6 @@ static void bvlc_bdt_forward_npdu(
|
|||||||
{ /* length of the NPDU */
|
{ /* length of the NPDU */
|
||||||
uint8_t mtu[MAX_MPDU] = { 0 };
|
uint8_t mtu[MAX_MPDU] = { 0 };
|
||||||
uint16_t mtu_len = 0;
|
uint16_t mtu_len = 0;
|
||||||
int bytes_sent = 0;
|
|
||||||
unsigned i = 0; /* loop counter */
|
unsigned i = 0; /* loop counter */
|
||||||
struct sockaddr_in bip_dest = { 0 };
|
struct sockaddr_in bip_dest = { 0 };
|
||||||
|
|
||||||
@@ -685,7 +684,7 @@ static void bvlc_bdt_forward_npdu(
|
|||||||
(bip_dest.sin_port == htons(bip_get_port()))) {
|
(bip_dest.sin_port == htons(bip_get_port()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bytes_sent = bvlc_send_mpdu(&bip_dest, mtu, mtu_len);
|
bvlc_send_mpdu(&bip_dest, mtu, mtu_len);
|
||||||
debug_printf("BVLC: BDT Sent Forwarded-NPDU to %s:%04X\n",
|
debug_printf("BVLC: BDT Sent Forwarded-NPDU to %s:%04X\n",
|
||||||
inet_ntoa(bip_dest.sin_addr), ntohs(bip_dest.sin_port));
|
inet_ntoa(bip_dest.sin_addr), ntohs(bip_dest.sin_port));
|
||||||
}
|
}
|
||||||
@@ -719,7 +718,6 @@ static void bvlc_fdt_forward_npdu(
|
|||||||
{ /* amount of space available in the NPDU */
|
{ /* amount of space available in the NPDU */
|
||||||
uint8_t mtu[MAX_MPDU] = { 0 };
|
uint8_t mtu[MAX_MPDU] = { 0 };
|
||||||
uint16_t mtu_len = 0;
|
uint16_t mtu_len = 0;
|
||||||
int bytes_sent = 0;
|
|
||||||
unsigned i = 0; /* loop counter */
|
unsigned i = 0; /* loop counter */
|
||||||
struct sockaddr_in bip_dest = { 0 };
|
struct sockaddr_in bip_dest = { 0 };
|
||||||
|
|
||||||
@@ -739,7 +737,7 @@ static void bvlc_fdt_forward_npdu(
|
|||||||
(bip_dest.sin_port == sin->sin_port)) {
|
(bip_dest.sin_port == sin->sin_port)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bytes_sent = bvlc_send_mpdu(&bip_dest, mtu, mtu_len);
|
bvlc_send_mpdu(&bip_dest, mtu, mtu_len);
|
||||||
debug_printf("BVLC: FDT Sent Forwarded-NPDU to %s:%04X\n",
|
debug_printf("BVLC: FDT Sent Forwarded-NPDU to %s:%04X\n",
|
||||||
inet_ntoa(bip_dest.sin_addr), ntohs(bip_dest.sin_port));
|
inet_ntoa(bip_dest.sin_addr), ntohs(bip_dest.sin_port));
|
||||||
}
|
}
|
||||||
@@ -846,9 +844,9 @@ uint16_t bvlc_receive(
|
|||||||
fd_set read_fds;
|
fd_set read_fds;
|
||||||
int max = 0;
|
int max = 0;
|
||||||
struct timeval select_timeout;
|
struct timeval select_timeout;
|
||||||
struct sockaddr_in sin = { -1 };
|
struct sockaddr_in sin = { 0 };
|
||||||
struct sockaddr_in original_sin = { -1 };
|
struct sockaddr_in original_sin = { 0 };
|
||||||
struct sockaddr_in dest = { -1 };
|
struct sockaddr_in dest = { 0 };
|
||||||
socklen_t sin_len = sizeof(sin);
|
socklen_t sin_len = sizeof(sin);
|
||||||
int function_type = 0;
|
int function_type = 0;
|
||||||
int received_bytes = 0;
|
int received_bytes = 0;
|
||||||
@@ -874,7 +872,7 @@ uint16_t bvlc_receive(
|
|||||||
select_timeout.tv_usec = 1000 * timeout;
|
select_timeout.tv_usec = 1000 * timeout;
|
||||||
}
|
}
|
||||||
FD_ZERO(&read_fds);
|
FD_ZERO(&read_fds);
|
||||||
FD_SET((unsigned int) bip_socket(), &read_fds);
|
FD_SET(bip_socket(), &read_fds);
|
||||||
max = bip_socket();
|
max = bip_socket();
|
||||||
/* see if there is a packet for us */
|
/* see if there is a packet for us */
|
||||||
if (select(max + 1, &read_fds, NULL, NULL, &select_timeout) > 0) {
|
if (select(max + 1, &read_fds, NULL, NULL, &select_timeout) > 0) {
|
||||||
@@ -912,7 +910,7 @@ uint16_t bvlc_receive(
|
|||||||
Register-Foreign-Device message */
|
Register-Foreign-Device message */
|
||||||
/* FIXME: clients may need this result */
|
/* FIXME: clients may need this result */
|
||||||
(void) decode_unsigned16(&npdu[4], &result_code);
|
(void) decode_unsigned16(&npdu[4], &result_code);
|
||||||
BVLC_Result_Code = result_code;
|
BVLC_Result_Code = (BACNET_BVLC_RESULT)result_code;
|
||||||
debug_printf("BVLC: Result Code=%d\n", BVLC_Result_Code);
|
debug_printf("BVLC: Result Code=%d\n", BVLC_Result_Code);
|
||||||
/* not an NPDU */
|
/* not an NPDU */
|
||||||
npdu_len = 0;
|
npdu_len = 0;
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ int cov_notify_decode_service_request(
|
|||||||
decode_tag_number_and_value(&apdu[len], &tag_number,
|
decode_tag_number_and_value(&apdu[len], &tag_number,
|
||||||
&len_value);
|
&len_value);
|
||||||
len += decode_enumerated(&apdu[len], len_value, &property);
|
len += decode_enumerated(&apdu[len], len_value, &property);
|
||||||
value->propertyIdentifier = property;
|
value->propertyIdentifier = (BACNET_PROPERTY_ID)property;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -572,7 +572,7 @@ int cov_subscribe_property_decode_service_request(
|
|||||||
decode_tag_number_and_value(&apdu[len], &tag_number,
|
decode_tag_number_and_value(&apdu[len], &tag_number,
|
||||||
&len_value);
|
&len_value);
|
||||||
len += decode_enumerated(&apdu[len], len_value, &property);
|
len += decode_enumerated(&apdu[len], len_value, &property);
|
||||||
data->monitoredProperty.propertyIdentifier = property;
|
data->monitoredProperty.propertyIdentifier = (BACNET_PROPERTY_ID)property;
|
||||||
} else
|
} else
|
||||||
return -4;
|
return -4;
|
||||||
/* the optional array index is tag 1 */
|
/* the optional array index is tag 1 */
|
||||||
|
|||||||
@@ -504,7 +504,7 @@ int event_notify_decode_service_request(
|
|||||||
decode_context_enumerated(&apdu[len], 6, &value)) == -1) {
|
decode_context_enumerated(&apdu[len], 6, &value)) == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
data->eventType = value;
|
data->eventType = (BACNET_EVENT_TYPE)value;
|
||||||
len += section_length;
|
len += section_length;
|
||||||
}
|
}
|
||||||
/* tag 7 - messageText */
|
/* tag 7 - messageText */
|
||||||
@@ -533,7 +533,7 @@ int event_notify_decode_service_request(
|
|||||||
decode_context_enumerated(&apdu[len], 8, &value)) == -1) {
|
decode_context_enumerated(&apdu[len], 8, &value)) == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
data->notifyType = value;
|
data->notifyType = (BACNET_NOTIFY_TYPE)value;
|
||||||
len += section_length;
|
len += section_length;
|
||||||
}
|
}
|
||||||
switch (data->notifyType) {
|
switch (data->notifyType) {
|
||||||
@@ -553,7 +553,7 @@ int event_notify_decode_service_request(
|
|||||||
&value)) == -1) {
|
&value)) == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
data->fromState = value;
|
data->fromState = (BACNET_EVENT_STATE)value;
|
||||||
len += section_length;
|
len += section_length;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -561,7 +561,6 @@ int event_notify_decode_service_request(
|
|||||||
/* FIXME: handle this case */
|
/* FIXME: handle this case */
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* tag 11 - toState */
|
/* tag 11 - toState */
|
||||||
@@ -569,7 +568,7 @@ int event_notify_decode_service_request(
|
|||||||
decode_context_enumerated(&apdu[len], 11, &value)) == -1) {
|
decode_context_enumerated(&apdu[len], 11, &value)) == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
data->toState = value;
|
data->toState = (BACNET_EVENT_STATE)value;
|
||||||
len += section_length;
|
len += section_length;
|
||||||
}
|
}
|
||||||
/* tag 12 - eventValues */
|
/* tag 12 - eventValues */
|
||||||
@@ -751,7 +750,7 @@ int event_notify_decode_service_request(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
data->notificationParams.changeOfLifeSafety.newState =
|
data->notificationParams.changeOfLifeSafety.newState =
|
||||||
value;
|
(BACNET_LIFE_SAFETY_STATE)value;
|
||||||
len += section_length;
|
len += section_length;
|
||||||
|
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
@@ -760,7 +759,7 @@ int event_notify_decode_service_request(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
data->notificationParams.changeOfLifeSafety.newMode =
|
data->notificationParams.changeOfLifeSafety.newMode =
|
||||||
value;
|
(BACNET_LIFE_SAFETY_MODE)value;
|
||||||
len += section_length;
|
len += section_length;
|
||||||
|
|
||||||
if (-1 == (section_length =
|
if (-1 == (section_length =
|
||||||
@@ -777,7 +776,7 @@ int event_notify_decode_service_request(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
data->notificationParams.changeOfLifeSafety.
|
data->notificationParams.changeOfLifeSafety.
|
||||||
operationExpected = value;
|
operationExpected = (BACNET_LIFE_SAFETY_OPERATION)value;
|
||||||
len += section_length;
|
len += section_length;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -853,7 +852,6 @@ int event_notify_decode_service_request(
|
|||||||
/* FIXME: handle this case */
|
/* FIXME: handle this case */
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ int lso_decode_service_request(
|
|||||||
decode_context_enumerated(&apdu[len], 2, &operation)) == -1) {
|
decode_context_enumerated(&apdu[len], 2, &operation)) == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
data->operation = operation;
|
data->operation = (BACNET_LIFE_SAFETY_OPERATION)operation;
|
||||||
len += section_length;
|
len += section_length;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -242,7 +242,6 @@ void tsm_timer_milliseconds(
|
|||||||
uint16_t milliseconds)
|
uint16_t milliseconds)
|
||||||
{
|
{
|
||||||
unsigned i = 0; /* counter */
|
unsigned i = 0; /* counter */
|
||||||
int bytes_sent = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < MAX_TSM_TRANSACTIONS; i++) {
|
for (i = 0; i < MAX_TSM_TRANSACTIONS; i++) {
|
||||||
if (TSM_List[i].state == TSM_STATE_AWAIT_CONFIRMATION) {
|
if (TSM_List[i].state == TSM_STATE_AWAIT_CONFIRMATION) {
|
||||||
@@ -255,7 +254,6 @@ void tsm_timer_milliseconds(
|
|||||||
TSM_List[i].RetryCount--;
|
TSM_List[i].RetryCount--;
|
||||||
TSM_List[i].RequestTimer = apdu_timeout();
|
TSM_List[i].RequestTimer = apdu_timeout();
|
||||||
if (TSM_List[i].RetryCount) {
|
if (TSM_List[i].RetryCount) {
|
||||||
bytes_sent =
|
|
||||||
datalink_send_pdu(&TSM_List[i].dest,
|
datalink_send_pdu(&TSM_List[i].dest,
|
||||||
&TSM_List[i].npdu_data, &TSM_List[i].apdu[0],
|
&TSM_List[i].npdu_data, &TSM_List[i].apdu[0],
|
||||||
TSM_List[i].apdu_len);
|
TSM_List[i].apdu_len);
|
||||||
|
|||||||
Reference in New Issue
Block a user