Applied standard indentation to files.
This commit is contained in:
@@ -107,8 +107,7 @@ static bool cov_list_subscribe(
|
||||
bacnet_address_copy(&COV_Subscriptions[index].dest, src);
|
||||
COV_Subscriptions[index].issueConfirmedNotifications =
|
||||
cov_data->issueConfirmedNotifications;
|
||||
COV_Subscriptions[index].lifetime =
|
||||
cov_data->lifetime;
|
||||
COV_Subscriptions[index].lifetime = cov_data->lifetime;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
@@ -131,8 +130,7 @@ static bool cov_list_subscribe(
|
||||
cov_data->subscriberProcessIdentifier;
|
||||
COV_Subscriptions[index].issueConfirmedNotifications =
|
||||
cov_data->issueConfirmedNotifications;
|
||||
COV_Subscriptions[index].lifetime =
|
||||
cov_data->lifetime;
|
||||
COV_Subscriptions[index].lifetime = cov_data->lifetime;
|
||||
} else {
|
||||
found = false;
|
||||
}
|
||||
@@ -164,8 +162,10 @@ void handler_cov_task(
|
||||
COV_Subscriptions[index].valid = false;
|
||||
}
|
||||
/* handle COV notifications */
|
||||
object_id.type = COV_Subscriptions[index].monitoredObjectIdentifier.type;
|
||||
object_id.instance = COV_Subscriptions[index].monitoredObjectIdentifier.instance;
|
||||
object_id.type =
|
||||
COV_Subscriptions[index].monitoredObjectIdentifier.type;
|
||||
object_id.instance =
|
||||
COV_Subscriptions[index].monitoredObjectIdentifier.instance;
|
||||
switch (object_id.type) {
|
||||
case OBJECT_BINARY_INPUT:
|
||||
if (Binary_Input_Change_Of_Value(object_id.instance)) {
|
||||
|
||||
@@ -281,9 +281,11 @@ int Binary_Input_Encode_Property_APDU(
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_FAULT, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OVERRIDDEN, false);
|
||||
if (Binary_Input_Out_Of_Service(object_instance)) {
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE, true);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
true);
|
||||
} else {
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE, false);
|
||||
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE,
|
||||
false);
|
||||
}
|
||||
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
|
||||
break;
|
||||
|
||||
@@ -994,7 +994,8 @@ bool Device_Write_Property(
|
||||
case PROP_MAX_INFO_FRAMES:
|
||||
if (value.tag == BACNET_APPLICATION_TAG_UNSIGNED_INT) {
|
||||
if (value.type.Unsigned_Int <= 255) {
|
||||
dlmstp_set_max_info_frames((uint8_t)value.type.Unsigned_Int);
|
||||
dlmstp_set_max_info_frames((uint8_t) value.type.
|
||||
Unsigned_Int);
|
||||
status = true;
|
||||
} else {
|
||||
*error_class = ERROR_CLASS_PROPERTY;
|
||||
|
||||
@@ -109,8 +109,8 @@ static void print_address_cache(
|
||||
uint32_t device_id = 0;
|
||||
unsigned max_apdu = 0;
|
||||
|
||||
printf("%-7s %-14s %-4s %-5s %-14s\n",
|
||||
"Device","MAC","APDU","SNET","SADR");
|
||||
printf("%-7s %-14s %-4s %-5s %-14s\n", "Device", "MAC", "APDU", "SNET",
|
||||
"SADR");
|
||||
printf("------- -------------- ---- ----- --------------\n");
|
||||
for (i = 0; i < MAX_ADDRESS_CACHE; i++) {
|
||||
if (address_get_by_index(i, &device_id, &max_apdu, &address)) {
|
||||
|
||||
@@ -236,8 +236,8 @@ int main(
|
||||
/* count # of times through the idle loop */
|
||||
IdleCount++;
|
||||
/* BACnet handling */
|
||||
pdu_len = datalink_receive(&src,
|
||||
&Receive_PDU[0], sizeof(Receive_PDU), 0);
|
||||
pdu_len =
|
||||
datalink_receive(&src, &Receive_PDU[0], sizeof(Receive_PDU), 0);
|
||||
if (pdu_len) {
|
||||
pPIO->PIO_CODR = LED3;
|
||||
npdu_handler(&src, &Receive_PDU[0], pdu_len);
|
||||
|
||||
@@ -126,17 +126,18 @@ void handler_read_property(
|
||||
} else {
|
||||
/* most cases will be error */
|
||||
error = true;
|
||||
ack_len = rp_ack_encode_apdu_init(
|
||||
&Handler_Transmit_Buffer[pdu_len],
|
||||
ack_len =
|
||||
rp_ack_encode_apdu_init(&Handler_Transmit_Buffer[pdu_len],
|
||||
service_data->invoke_id, &data);
|
||||
/* FIXME: add buffer len as passed into function or use smart buffer */
|
||||
property_len = Encode_Property_APDU(
|
||||
&Handler_Transmit_Buffer[pdu_len + ack_len], data.object_type,
|
||||
data.object_instance, data.object_property, data.array_index,
|
||||
&error_class, &error_code);
|
||||
property_len =
|
||||
Encode_Property_APDU(&Handler_Transmit_Buffer[pdu_len + ack_len],
|
||||
data.object_type, data.object_instance, data.object_property,
|
||||
data.array_index, &error_class, &error_code);
|
||||
if (len >= 0) {
|
||||
len = rp_ack_encode_apdu_object_property_end(
|
||||
&Handler_Transmit_Buffer[pdu_len + property_len + ack_len]);
|
||||
len =
|
||||
rp_ack_encode_apdu_object_property_end(&Handler_Transmit_Buffer
|
||||
[pdu_len + property_len + ack_len]);
|
||||
len += ack_len + property_len;
|
||||
error = false;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
#define _delay_us(x) \
|
||||
|
||||
/* inline function */
|
||||
static inline void delay_us(uint8_t microseconds)
|
||||
static inline void delay_us(
|
||||
uint8_t microseconds)
|
||||
{
|
||||
do {
|
||||
__delay_cycles(F_CPU / 1000000);
|
||||
@@ -56,8 +57,7 @@ static inline void delay_us(uint8_t microseconds)
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
unsigned char bit0:1;
|
||||
unsigned char bit1:1;
|
||||
unsigned char bit2:1;
|
||||
|
||||
@@ -73,7 +73,8 @@ void Timer_Initialize(
|
||||
/* Timer Overflowed! Increment the time. */
|
||||
#if defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ASM__)
|
||||
#pragma vector=TIMER0_OVF_vect
|
||||
__interrupt void myTIMER0_OVF_vect()
|
||||
__interrupt void myTIMER0_OVF_vect(
|
||||
)
|
||||
#else
|
||||
ISR(TIMER0_OVF_vect)
|
||||
#endif
|
||||
|
||||
@@ -94,4 +94,3 @@ void datalink_set(
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -134,8 +134,8 @@ int rp_ack_encode_apdu_init(
|
||||
apdu_len = 3;
|
||||
/* service ack follows */
|
||||
len =
|
||||
encode_context_object_id(&apdu[apdu_len], 0,
|
||||
rpdata->object_type, rpdata->object_instance);
|
||||
encode_context_object_id(&apdu[apdu_len], 0, rpdata->object_type,
|
||||
rpdata->object_instance);
|
||||
apdu_len += len;
|
||||
len =
|
||||
encode_context_enumerated(&apdu[apdu_len], 1,
|
||||
|
||||
Reference in New Issue
Block a user