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