indented using indent.sh script to get uniform looking code for release

This commit is contained in:
skarg
2013-03-13 22:17:13 +00:00
parent 2de46521b8
commit ba3242aafd
120 changed files with 3382 additions and 3299 deletions
+2 -2
View File
@@ -150,7 +150,7 @@ int dlenv_register_as_foreign_device(
if (retval < 0)
fprintf(stderr, "FAILED to Register with BBMD at %s \n",
inet_ntoa(addr));
BBMD_Timer_Seconds = (uint16_t)bbmd_timetolive_seconds;
BBMD_Timer_Seconds = (uint16_t) bbmd_timetolive_seconds;
}
bbmd_result = retval;
@@ -176,7 +176,7 @@ void dlenv_maintenance_timer(
BBMD_Timer_Seconds -= elapsed_seconds;
}
if (BBMD_Timer_Seconds == 0) {
(void)dlenv_register_as_foreign_device();
(void) dlenv_register_as_foreign_device();
/* If that failed (negative), maybe just a network issue.
* If nothing happened (0), may be un/misconfigured.
* Set up to try again later in all cases. */
+2 -2
View File
@@ -125,8 +125,8 @@ void handler_ccov_notification(
fprintf(stderr, "CCOV: ");
if (pProperty_value->propertyIdentifier < 512) {
fprintf(stderr, "%s ",
bactext_property_name(pProperty_value->
propertyIdentifier));
bactext_property_name
(pProperty_value->propertyIdentifier));
} else {
fprintf(stderr, "proprietary %u ",
pProperty_value->propertyIdentifier);
+17 -16
View File
@@ -311,7 +311,7 @@ static bool cov_list_subscribe(
/* From BACnet Standard 135-2010-13.14.2
...Cancellations that are issued for which no matching COV
context can be found shall succeed as if a context had
existed, returning 'Result(+)'.*/
existed, returning 'Result(+)'. */
found = true;
}
}
@@ -406,10 +406,10 @@ static void cov_lifetime_expiration_handler(
/* expire the subscription */
#if PRINT_ENABLED
fprintf(stderr, "COVtimer: PID=%u ",
COV_Subscriptions[index].subscriberProcessIdentifier);
COV_Subscriptions[index].subscriberProcessIdentifier);
fprintf(stderr, "%s %u ",
bactext_object_type_name(
COV_Subscriptions[index].monitoredObjectIdentifier.type),
bactext_object_type_name(COV_Subscriptions[index].
monitoredObjectIdentifier.type),
COV_Subscriptions[index].monitoredObjectIdentifier.instance);
fprintf(stderr, "time remaining=%u seconds ",
COV_Subscriptions[index].lifetime);
@@ -497,13 +497,13 @@ void handler_cov_task(
object_type = (BACNET_OBJECT_TYPE)
COV_Subscriptions[index].monitoredObjectIdentifier.type;
object_instance =
COV_Subscriptions[index].monitoredObjectIdentifier.
instance;
COV_Subscriptions[index].
monitoredObjectIdentifier.instance;
status = Device_COV(object_type, object_instance);
if (status) {
COV_Subscriptions[index].flag.send_requested = true;
#if PRINT_ENABLED
fprintf(stderr,"COVtask: Marking...\n");
fprintf(stderr, "COVtask: Marking...\n");
#endif
}
}
@@ -520,8 +520,8 @@ void handler_cov_task(
object_type = (BACNET_OBJECT_TYPE)
COV_Subscriptions[index].monitoredObjectIdentifier.type;
object_instance =
COV_Subscriptions[index].monitoredObjectIdentifier.
instance;
COV_Subscriptions[index].
monitoredObjectIdentifier.instance;
Device_COV_Clear(object_type, object_instance);
}
index++;
@@ -537,8 +537,9 @@ void handler_cov_task(
(COV_Subscriptions[index].invokeID)) {
if (tsm_invoke_id_free(COV_Subscriptions[index].invokeID)) {
COV_Subscriptions[index].invokeID = 0;
} else if (tsm_invoke_id_failed(COV_Subscriptions[index].
invokeID)) {
} else
if (tsm_invoke_id_failed(COV_Subscriptions
[index].invokeID)) {
tsm_free_invoke_id(COV_Subscriptions[index].invokeID);
COV_Subscriptions[index].invokeID = 0;
}
@@ -566,13 +567,13 @@ void handler_cov_task(
}
if (send) {
object_type = (BACNET_OBJECT_TYPE)
COV_Subscriptions[index].monitoredObjectIdentifier.
type;
COV_Subscriptions[index].
monitoredObjectIdentifier.type;
object_instance =
COV_Subscriptions[index].monitoredObjectIdentifier.
instance;
COV_Subscriptions[index].
monitoredObjectIdentifier.instance;
#if PRINT_ENABLED
fprintf(stderr,"COVtask: Sending...\n");
fprintf(stderr, "COVtask: Sending...\n");
#endif
/* configure the linked list for the two properties */
value_list[0].next = &value_list[1];
+8 -9
View File
@@ -56,24 +56,23 @@
* decoded from the APDU header of this message.
*/
void get_alarm_summary_ack_handler(
uint8_t *service_request,
uint8_t * service_request,
uint16_t service_len,
BACNET_ADDRESS *src,
BACNET_CONFIRMED_SERVICE_ACK_DATA *service_data)
BACNET_ADDRESS * src,
BACNET_CONFIRMED_SERVICE_ACK_DATA * service_data)
{
uint16_t apdu_len = 0;
uint16_t len = 0;
BACNET_GET_ALARM_SUMMARY_DATA data;
while(service_len - len){
apdu_len = get_alarm_summary_ack_decode_apdu_data(
&service_request[len],
service_len - len,
&data);
while (service_len - len) {
apdu_len =
get_alarm_summary_ack_decode_apdu_data(&service_request[len],
service_len - len, &data);
len += apdu_len;
if(apdu_len > 0){
if (apdu_len > 0) {
/* FIXME: Add code to process data */
} else {
break;
+6 -6
View File
@@ -221,8 +221,8 @@ void rpm_ack_print_data(
#if PRINT_ENABLED
if (listOfProperties->propertyIdentifier < 512) {
fprintf(stdout, " %s: ",
bactext_property_name
(listOfProperties->propertyIdentifier));
bactext_property_name(listOfProperties->
propertyIdentifier));
} else {
fprintf(stdout, " proprietary %u: ",
(unsigned) listOfProperties->propertyIdentifier);
@@ -269,10 +269,10 @@ void rpm_ack_print_data(
#if PRINT_ENABLED
/* AccessError */
fprintf(stdout, "BACnet Error: %s: %s\r\n",
bactext_error_class_name((int) listOfProperties->error.
error_class),
bactext_error_code_name((int) listOfProperties->error.
error_code));
bactext_error_class_name((int) listOfProperties->
error.error_class),
bactext_error_code_name((int) listOfProperties->
error.error_code));
#endif
}
listOfProperties = listOfProperties->next;
+2 -2
View File
@@ -104,8 +104,8 @@ void handler_ucov_notification(
fprintf(stderr, "UCOV: ");
if (pProperty_value->propertyIdentifier < 512) {
fprintf(stderr, "%s ",
bactext_property_name(pProperty_value->
propertyIdentifier));
bactext_property_name
(pProperty_value->propertyIdentifier));
} else {
fprintf(stderr, "proprietary %u ",
pProperty_value->propertyIdentifier);
+3 -2
View File
@@ -65,8 +65,9 @@ static void match_name_or_object(
} else {
/* valid object_name copy in my device? */
found =
Device_Object_Name_Copy((BACNET_OBJECT_TYPE) data->object.
identifier.type, data->object.identifier.instance, &object_name);
Device_Object_Name_Copy((BACNET_OBJECT_TYPE) data->
object.identifier.type, data->object.identifier.instance,
&object_name);
if (found) {
Send_I_Have(Device_Object_Instance_Number(),
(BACNET_OBJECT_TYPE) data->object.identifier.type,
+3 -4
View File
@@ -175,10 +175,9 @@ void handler_write_property_multiple(
fprintf(stderr, "WPM: Sending Abort!\n");
#endif
} else if (len == BACNET_STATUS_ERROR) {
apdu_len = wpm_error_ack_encode_apdu(
&Handler_Transmit_Buffer[npdu_len],
service_data->invoke_id,
&wp_data);
apdu_len =
wpm_error_ack_encode_apdu(&Handler_Transmit_Buffer[npdu_len],
service_data->invoke_id, &wp_data);
#if PRINT_ENABLED
fprintf(stderr, "WPM: Sending Error!\n");
#endif
+1 -1
View File
@@ -97,7 +97,7 @@ uint8_t Send_Private_Transfer_Request(
block->cMyByte2);
len +=
encode_application_real(&pt_req_buffer[len], block->fMyReal);
characterstring_init_ansi(&bsTemp, (char *)block->sMyString);
characterstring_init_ansi(&bsTemp, (char *) block->sMyString);
len +=
encode_application_character_string(&pt_req_buffer[len],
&bsTemp);
+5 -6
View File
@@ -60,7 +60,7 @@
* @return invoke id of outgoing message, or 0 if device is not bound or no tsm available
*/
uint8_t Send_Read_Property_Request_Address(
BACNET_ADDRESS *dest,
BACNET_ADDRESS * dest,
uint16_t max_apdu,
BACNET_OBJECT_TYPE object_type,
uint32_t object_instance,
@@ -149,7 +149,7 @@ uint8_t Send_Read_Property_Request(
BACNET_PROPERTY_ID object_property,
uint32_t array_index)
{
BACNET_ADDRESS dest = {0};
BACNET_ADDRESS dest = { 0 };
unsigned max_apdu = 0;
uint8_t invoke_id = 0;
bool status = false;
@@ -157,10 +157,9 @@ uint8_t Send_Read_Property_Request(
/* is the device bound? */
status = address_get_by_device(device_id, &max_apdu, &dest);
if (status) {
invoke_id = Send_Read_Property_Request_Address(
&dest, max_apdu, object_type,
object_instance, object_property,
array_index);
invoke_id =
Send_Read_Property_Request_Address(&dest, max_apdu, object_type,
object_instance, object_property, array_index);
}
return invoke_id;
+3 -2
View File
@@ -157,8 +157,9 @@ uint8_t Send_Write_Property_Request(
#if PRINT_ENABLED_DEBUG
fprintf(stderr, "WriteProperty service: " "%s tag=%d\n",
(object_value->context_specific ? "context" : "application"),
(int) (object_value->context_specific ? object_value->
context_tag : object_value->tag));
(int) (object_value->
context_specific ? object_value->context_tag : object_value->
tag));
#endif
len = bacapp_encode_data(&application_data[apdu_len], object_value);
if ((len + apdu_len) < MAX_APDU) {