Bugfix/atmel studio arm compile warnings (#60)
* Cleanup warnings generated by Atmel Studio compiling for SAMD21 ARM Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
+2
-2
@@ -296,10 +296,10 @@ int bacapp_decode_application_data(
|
|||||||
if (tag_len > 0) {
|
if (tag_len > 0) {
|
||||||
len += tag_len;
|
len += tag_len;
|
||||||
value->tag = tag_number;
|
value->tag = tag_number;
|
||||||
if (len <= apdu_len_max) {
|
if ((unsigned)len <= apdu_len_max) {
|
||||||
decode_len =
|
decode_len =
|
||||||
bacapp_decode_data_len(NULL, tag_number, len_value_type);
|
bacapp_decode_data_len(NULL, tag_number, len_value_type);
|
||||||
if (decode_len <= (apdu_len_max - len)) {
|
if ((unsigned)decode_len <= (apdu_len_max - len)) {
|
||||||
decode_len = bacapp_decode_data(
|
decode_len = bacapp_decode_data(
|
||||||
&apdu[len], tag_number, len_value_type, value);
|
&apdu[len], tag_number, len_value_type, value);
|
||||||
if (value->tag != MAX_BACNET_APPLICATION_TAG) {
|
if (value->tag != MAX_BACNET_APPLICATION_TAG) {
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ int bacnet_object_id_application_decode(uint8_t *apdu,
|
|||||||
if ((len > 0) && (tag_number == BACNET_APPLICATION_TAG_OBJECT_ID)) {
|
if ((len > 0) && (tag_number == BACNET_APPLICATION_TAG_OBJECT_ID)) {
|
||||||
apdu_len = len;
|
apdu_len = len;
|
||||||
if (apdu_len < apdu_len_max) {
|
if (apdu_len < apdu_len_max) {
|
||||||
if ((apdu_len_max - apdu_len) >= len_value_type) {
|
if ((apdu_len_max - (unsigned)apdu_len) >= len_value_type) {
|
||||||
len = bacnet_object_id_decode(
|
len = bacnet_object_id_decode(
|
||||||
&apdu[len], len_value_type, object_type, object_instance);
|
&apdu[len], len_value_type, object_type, object_instance);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
|||||||
@@ -48,11 +48,6 @@
|
|||||||
|
|
||||||
/** @file apdu.c Handles APDU services */
|
/** @file apdu.c Handles APDU services */
|
||||||
|
|
||||||
extern int Routed_Device_Service_Approval(BACNET_CONFIRMED_SERVICE service,
|
|
||||||
int service_argument,
|
|
||||||
uint8_t *apdu_buff,
|
|
||||||
uint8_t invoke_id);
|
|
||||||
|
|
||||||
/* APDU Timeout in Milliseconds */
|
/* APDU Timeout in Milliseconds */
|
||||||
static uint16_t Timeout_Milliseconds = 3000;
|
static uint16_t Timeout_Milliseconds = 3000;
|
||||||
/* Number of APDU Retries */
|
/* Number of APDU Retries */
|
||||||
@@ -140,7 +135,7 @@ bool apdu_service_supported(BACNET_SERVICES_SUPPORTED service_supported)
|
|||||||
if (confirmed_service_supported[i] == service_supported) {
|
if (confirmed_service_supported[i] == service_supported) {
|
||||||
found = true;
|
found = true;
|
||||||
if (Confirmed_Function[i] != NULL) {
|
if (Confirmed_Function[i] != NULL) {
|
||||||
#if BAC_ROUTING
|
#ifdef BAC_ROUTING
|
||||||
/* Check to see if the current Device supports this service.
|
/* Check to see if the current Device supports this service.
|
||||||
*/
|
*/
|
||||||
int len = Routed_Device_Service_Approval(
|
int len = Routed_Device_Service_Approval(
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ void handler_device_communication_control(uint8_t *service_request,
|
|||||||
"Sending Reject - undefined enumeration\n");
|
"Sending Reject - undefined enumeration\n");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#if BAC_ROUTING
|
#ifdef BAC_ROUTING
|
||||||
/* Check to see if the current Device supports this service. */
|
/* Check to see if the current Device supports this service. */
|
||||||
len = Routed_Device_Service_Approval(
|
len = Routed_Device_Service_Approval(
|
||||||
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL, (int)state,
|
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL, (int)state,
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ void handler_reinitialize_device(uint8_t *service_request,
|
|||||||
"ReinitializeDevice: Sending Reject - undefined enumeration\n");
|
"ReinitializeDevice: Sending Reject - undefined enumeration\n");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#if BAC_ROUTING
|
#ifdef BAC_ROUTING
|
||||||
/* Check to see if the current Device supports this service. */
|
/* Check to see if the current Device supports this service. */
|
||||||
len = Routed_Device_Service_Approval(
|
len = Routed_Device_Service_Approval(
|
||||||
SERVICE_CONFIRMED_REINITIALIZE_DEVICE, (int)rd_data.state,
|
SERVICE_CONFIRMED_REINITIALIZE_DEVICE, (int)rd_data.state,
|
||||||
|
|||||||
@@ -136,6 +136,12 @@ extern "C" {
|
|||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
bool dlmstp_send_pdu_queue_full(void);
|
bool dlmstp_send_pdu_queue_full(void);
|
||||||
|
|
||||||
|
BACNET_STACK_EXPORT
|
||||||
|
uint8_t dlmstp_max_info_frames_limit(void);
|
||||||
|
BACNET_STACK_EXPORT
|
||||||
|
uint8_t dlmstp_max_master_limit(void);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
+3
-3
@@ -194,7 +194,7 @@ int dcc_decode_service_request(uint8_t *apdu,
|
|||||||
results in no timeout */
|
results in no timeout */
|
||||||
*timeDuration = 0;
|
*timeDuration = 0;
|
||||||
}
|
}
|
||||||
if (apdu_len < apdu_len_max) {
|
if ((unsigned)apdu_len < apdu_len_max) {
|
||||||
/* Tag 1: enable_disable */
|
/* Tag 1: enable_disable */
|
||||||
len = bacnet_enumerated_context_decode(
|
len = bacnet_enumerated_context_decode(
|
||||||
&apdu[apdu_len], apdu_len_max - apdu_len, 1, &decoded_enum);
|
&apdu[apdu_len], apdu_len_max - apdu_len, 1, &decoded_enum);
|
||||||
@@ -208,7 +208,7 @@ int dcc_decode_service_request(uint8_t *apdu,
|
|||||||
return BACNET_STATUS_ERROR;
|
return BACNET_STATUS_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (apdu_len < apdu_len_max) {
|
if ((unsigned)apdu_len < apdu_len_max) {
|
||||||
/* Tag 2: password --optional-- */
|
/* Tag 2: password --optional-- */
|
||||||
if (!decode_is_context_tag(&apdu[apdu_len], 2)) {
|
if (!decode_is_context_tag(&apdu[apdu_len], 2)) {
|
||||||
/* since this is the last value of the packet,
|
/* since this is the last value of the packet,
|
||||||
@@ -220,7 +220,7 @@ int dcc_decode_service_request(uint8_t *apdu,
|
|||||||
apdu_len_max - apdu_len, &tag_number, &len_value_type);
|
apdu_len_max - apdu_len, &tag_number, &len_value_type);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
apdu_len += len;
|
apdu_len += len;
|
||||||
if (apdu_len < apdu_len_max) {
|
if ((unsigned)apdu_len < apdu_len_max) {
|
||||||
len = bacnet_character_string_decode(&apdu[apdu_len],
|
len = bacnet_character_string_decode(&apdu[apdu_len],
|
||||||
apdu_len_max - apdu_len, len_value_type, password);
|
apdu_len_max - apdu_len, len_value_type, password);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
|||||||
@@ -58,12 +58,6 @@ extern "C" {
|
|||||||
uint8_t * apdu,
|
uint8_t * apdu,
|
||||||
uint8_t invoke_id);
|
uint8_t invoke_id);
|
||||||
|
|
||||||
/* set GetAlarmSummary function */
|
|
||||||
BACNET_STACK_EXPORT
|
|
||||||
void handler_get_alarm_summary_set(
|
|
||||||
BACNET_OBJECT_TYPE object_type,
|
|
||||||
get_alarm_summary_function pFunction);
|
|
||||||
|
|
||||||
/* encode service */
|
/* encode service */
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
int get_alarm_summary_ack_encode_apdu_init(
|
int get_alarm_summary_ack_encode_apdu_init(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <math.h>
|
||||||
#include "bacnet/lighting.h"
|
#include "bacnet/lighting.h"
|
||||||
#include "bacnet/bacdcode.h"
|
#include "bacnet/bacdcode.h"
|
||||||
|
|
||||||
@@ -265,14 +266,15 @@ bool lighting_command_same(
|
|||||||
(dst->use_priority == src->use_priority)) {
|
(dst->use_priority == src->use_priority)) {
|
||||||
status = true;
|
status = true;
|
||||||
if ((dst->use_target_level) &&
|
if ((dst->use_target_level) &&
|
||||||
(dst->target_level != src->target_level)) {
|
islessgreater(dst->target_level, src->target_level)) {
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
if ((dst->use_ramp_rate) && (dst->ramp_rate != src->ramp_rate)) {
|
if ((dst->use_ramp_rate) &&
|
||||||
|
islessgreater(dst->ramp_rate, src->ramp_rate)) {
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
if ((dst->use_step_increment) &&
|
if ((dst->use_step_increment) &&
|
||||||
(dst->step_increment != src->step_increment)) {
|
islessgreater(dst->step_increment, src->step_increment)) {
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
if ((dst->use_fade_time) && (dst->fade_time != src->fade_time)) {
|
if ((dst->use_fade_time) && (dst->fade_time != src->fade_time)) {
|
||||||
|
|||||||
@@ -156,11 +156,6 @@ extern "C" {
|
|||||||
int apdu_len, /* total length of the apdu */
|
int apdu_len, /* total length of the apdu */
|
||||||
BACNET_READ_RANGE_DATA * rrdata);
|
BACNET_READ_RANGE_DATA * rrdata);
|
||||||
|
|
||||||
BACNET_STACK_EXPORT
|
|
||||||
uint8_t Send_ReadRange_Request(
|
|
||||||
uint32_t device_id, /* destination device */
|
|
||||||
BACNET_READ_RANGE_DATA * read_access_data);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
Reference in New Issue
Block a user