running the indent on the files.
This commit is contained in:
@@ -42,85 +42,72 @@
|
||||
#include "txbuf.h"
|
||||
|
||||
/* for debugging... */
|
||||
static void PrintReadPropertyData(BACNET_READ_PROPERTY_DATA *data)
|
||||
static void PrintReadPropertyData(BACNET_READ_PROPERTY_DATA * data)
|
||||
{
|
||||
BACNET_APPLICATION_DATA_VALUE value; /* for decode value data */
|
||||
int len = 0;
|
||||
uint8_t *application_data;
|
||||
int application_data_len;
|
||||
bool first_value = true;
|
||||
bool print_brace = false;
|
||||
BACNET_APPLICATION_DATA_VALUE value; /* for decode value data */
|
||||
int len = 0;
|
||||
uint8_t *application_data;
|
||||
int application_data_len;
|
||||
bool first_value = true;
|
||||
bool print_brace = false;
|
||||
|
||||
if (data)
|
||||
{
|
||||
#if 0
|
||||
if (data->array_index == BACNET_ARRAY_ALL)
|
||||
fprintf(stderr,"%s #%u %s\n",
|
||||
bactext_object_type_name(data->object_type),
|
||||
data->object_instance,
|
||||
bactext_property_name(data->object_property));
|
||||
else
|
||||
fprintf(stderr,"%s #%u %s[%d]\n",
|
||||
bactext_object_type_name(data->object_type),
|
||||
data->object_instance,
|
||||
bactext_property_name(data->object_property),
|
||||
data->array_index);
|
||||
#endif
|
||||
application_data = data->application_data;
|
||||
application_data_len = data->application_data_len;
|
||||
/* value? need to loop until all of the len is gone... */
|
||||
for (;;)
|
||||
{
|
||||
len = bacapp_decode_application_data(
|
||||
application_data,
|
||||
application_data_len,
|
||||
&value);
|
||||
if (first_value && (len < application_data_len))
|
||||
{
|
||||
first_value = false;
|
||||
fprintf(stdout,"{");
|
||||
print_brace = true;
|
||||
}
|
||||
bacapp_print_value(stdout,&value,data->object_property);
|
||||
if (len)
|
||||
{
|
||||
if (len < application_data_len)
|
||||
{
|
||||
application_data += len;
|
||||
application_data_len -= len;
|
||||
/* there's more! */
|
||||
fprintf(stdout,",");
|
||||
}
|
||||
if (data) {
|
||||
#if 0
|
||||
if (data->array_index == BACNET_ARRAY_ALL)
|
||||
fprintf(stderr, "%s #%u %s\n",
|
||||
bactext_object_type_name(data->object_type),
|
||||
data->object_instance,
|
||||
bactext_property_name(data->object_property));
|
||||
else
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
fprintf(stderr, "%s #%u %s[%d]\n",
|
||||
bactext_object_type_name(data->object_type),
|
||||
data->object_instance,
|
||||
bactext_property_name(data->object_property),
|
||||
data->array_index);
|
||||
#endif
|
||||
application_data = data->application_data;
|
||||
application_data_len = data->application_data_len;
|
||||
/* value? need to loop until all of the len is gone... */
|
||||
for (;;) {
|
||||
len = bacapp_decode_application_data(application_data,
|
||||
application_data_len, &value);
|
||||
if (first_value && (len < application_data_len)) {
|
||||
first_value = false;
|
||||
fprintf(stdout, "{");
|
||||
print_brace = true;
|
||||
}
|
||||
bacapp_print_value(stdout, &value, data->object_property);
|
||||
if (len) {
|
||||
if (len < application_data_len) {
|
||||
application_data += len;
|
||||
application_data_len -= len;
|
||||
/* there's more! */
|
||||
fprintf(stdout, ",");
|
||||
} else
|
||||
break;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
if (print_brace)
|
||||
fprintf(stdout, "}");
|
||||
fprintf(stdout, "\r\n");
|
||||
}
|
||||
if (print_brace)
|
||||
fprintf(stdout,"}");
|
||||
fprintf(stdout,"\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
void handler_read_property_ack(
|
||||
uint8_t *service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS *src,
|
||||
BACNET_CONFIRMED_SERVICE_ACK_DATA *service_data)
|
||||
void handler_read_property_ack(uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src, BACNET_CONFIRMED_SERVICE_ACK_DATA * service_data)
|
||||
{
|
||||
int len = 0;
|
||||
BACNET_READ_PROPERTY_DATA data;
|
||||
int len = 0;
|
||||
BACNET_READ_PROPERTY_DATA data;
|
||||
|
||||
(void)src;
|
||||
(void)service_data; /* we could use these... */
|
||||
len = rp_ack_decode_service_request(
|
||||
service_request,
|
||||
service_len,
|
||||
&data);
|
||||
#if 0
|
||||
fprintf(stderr,"Received Read-Property Ack!\n");
|
||||
#endif
|
||||
if (len > 0)
|
||||
PrintReadPropertyData(&data);
|
||||
(void) src;
|
||||
(void) service_data; /* we could use these... */
|
||||
len = rp_ack_decode_service_request(service_request,
|
||||
service_len, &data);
|
||||
#if 0
|
||||
fprintf(stderr, "Received Read-Property Ack!\n");
|
||||
#endif
|
||||
if (len > 0)
|
||||
PrintReadPropertyData(&data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user