Fixed some warnings detected by CSTAT.
Consolidated some unit tests and added a single test prototype to header file.
This commit is contained in:
@@ -608,7 +608,7 @@ void handler_cov_timer_seconds(
|
||||
}
|
||||
}
|
||||
|
||||
void handler_cov_task(
|
||||
bool handler_cov_fsm(
|
||||
void)
|
||||
{
|
||||
static int index = 0;
|
||||
@@ -739,6 +739,13 @@ void handler_cov_task(
|
||||
cov_task_state = COV_STATE_IDLE;
|
||||
break;
|
||||
}
|
||||
return (cov_task_state == COV_STATE_IDLE);
|
||||
}
|
||||
|
||||
void handler_cov_task(
|
||||
void)
|
||||
{
|
||||
handler_cov_fsm();
|
||||
}
|
||||
|
||||
static bool cov_subscribe(
|
||||
|
||||
@@ -143,11 +143,12 @@ uint8_t Send_COV_Subscribe(
|
||||
bytes_sent =
|
||||
datalink_send_pdu(&dest, &npdu_data,
|
||||
&Handler_Transmit_Buffer[0], pdu_len);
|
||||
if (bytes_sent <= 0) {
|
||||
#if PRINT_ENABLED
|
||||
if (bytes_sent <= 0)
|
||||
fprintf(stderr, "Failed to Send SubscribeCOV Request (%s)!\n",
|
||||
strerror(errno));
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
tsm_free_invoke_id(invoke_id);
|
||||
invoke_id = 0;
|
||||
|
||||
@@ -80,11 +80,13 @@ void Send_I_Am_To_Network(
|
||||
bytes_sent =
|
||||
datalink_send_pdu(target_address, &npdu_data,
|
||||
&Handler_Transmit_Buffer[0], pdu_len);
|
||||
if (bytes_sent <= 0) {
|
||||
#if PRINT_ENABLED
|
||||
if (bytes_sent <= 0)
|
||||
fprintf(stderr, "Failed to Send I-Am Request (%s)!\n",
|
||||
strerror(errno));
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Encode an I Am message to be broadcast.
|
||||
@@ -227,10 +229,9 @@ void Send_I_Am_Unicast(
|
||||
/* send data */
|
||||
bytes_sent = datalink_send_pdu(&dest, &npdu_data, &buffer[0], pdu_len);
|
||||
|
||||
if (bytes_sent <= 0) {
|
||||
#if PRINT_ENABLED
|
||||
if (bytes_sent <= 0)
|
||||
fprintf(stderr, "Failed to Send I-Am Reply (%s)!\n", strerror(errno));
|
||||
#else
|
||||
(void)bytes_sent;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
/** @file s_upt.c Send an Unconfirmed Private Transfer request. */
|
||||
|
||||
void Send_UnconfirmedPrivateTransfer(
|
||||
int Send_UnconfirmedPrivateTransfer(
|
||||
BACNET_ADDRESS * dest,
|
||||
BACNET_PRIVATE_TRANSFER_DATA * private_data)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ void Send_UnconfirmedPrivateTransfer(
|
||||
BACNET_ADDRESS my_address;
|
||||
|
||||
if (!dcc_communication_enabled())
|
||||
return;
|
||||
return bytes_sent;
|
||||
|
||||
datalink_get_my_address(&my_address);
|
||||
/* encode the NPDU portion of the packet */
|
||||
@@ -73,10 +73,13 @@ void Send_UnconfirmedPrivateTransfer(
|
||||
bytes_sent =
|
||||
datalink_send_pdu(dest, &npdu_data, &Handler_Transmit_Buffer[0],
|
||||
pdu_len);
|
||||
if (bytes_sent <= 0) {
|
||||
#if PRINT_ENABLED
|
||||
if (bytes_sent <= 0)
|
||||
fprintf(stderr,
|
||||
"Failed to Send UnconfirmedPrivateTransfer Request (%s)!\n",
|
||||
strerror(errno));
|
||||
#endif
|
||||
}
|
||||
|
||||
return bytes_sent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user