indented.
This commit is contained in:
@@ -217,7 +217,8 @@ static void Init_DataLink(
|
||||
if (bbmd_address) {
|
||||
struct in_addr addr;
|
||||
addr.s_addr = bbmd_address;
|
||||
printf("DeviceCommunicationControl: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
printf
|
||||
("DeviceCommunicationControl: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds);
|
||||
bvlc_register_with_bbmd(bbmd_address, bbmd_port,
|
||||
bbmd_timetolive_seconds);
|
||||
|
||||
@@ -236,7 +236,7 @@ static bool cov_list_subscribe(
|
||||
for (index = 0; index < MAX_COV_SUBCRIPTIONS; index++) {
|
||||
if (COV_Subscriptions[index].valid) {
|
||||
if ((COV_Subscriptions[index].monitoredObjectIdentifier.type ==
|
||||
cov_data->monitoredObjectIdentifier.type) &&
|
||||
cov_data->monitoredObjectIdentifier.type) &&
|
||||
(COV_Subscriptions[index].monitoredObjectIdentifier.instance ==
|
||||
cov_data->monitoredObjectIdentifier.instance) &&
|
||||
(COV_Subscriptions[index].subscriberProcessIdentifier ==
|
||||
|
||||
@@ -272,7 +272,8 @@ static void Init_DataLink(
|
||||
if (bbmd_address) {
|
||||
struct in_addr addr;
|
||||
addr.s_addr = bbmd_address;
|
||||
printf("AtomicReadFile: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
printf
|
||||
("AtomicReadFile: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds);
|
||||
bvlc_register_with_bbmd(bbmd_address, bbmd_port,
|
||||
bbmd_timetolive_seconds);
|
||||
|
||||
@@ -208,7 +208,8 @@ static void Init_DataLink(
|
||||
if (bbmd_address) {
|
||||
struct in_addr addr;
|
||||
addr.s_addr = bbmd_address;
|
||||
printf("ReadProperty: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
printf
|
||||
("ReadProperty: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds);
|
||||
bvlc_register_with_bbmd(bbmd_address, bbmd_port,
|
||||
bbmd_timetolive_seconds);
|
||||
@@ -231,10 +232,8 @@ int main(int argc, char *argv[]) {
|
||||
bool found = false;
|
||||
|
||||
if (argc < 5) {
|
||||
printf(
|
||||
"Usage: %s device-instance object-type object-instance "
|
||||
"property [index]\r\n",
|
||||
filename_remove_path(argv[0]));
|
||||
printf("Usage: %s device-instance object-type object-instance "
|
||||
"property [index]\r\n", filename_remove_path(argv[0]));
|
||||
if ((argc > 1) && (strcmp(argv[1], "--help") == 0)) {
|
||||
printf("device-instance:\r\n"
|
||||
"BACnet Device Object Instance number that you are\r\n"
|
||||
@@ -267,8 +266,7 @@ int main(int argc, char *argv[]) {
|
||||
"%s 123 1 101 85\r\n"
|
||||
"If you want read the Priority-Array of Analog Output 101\r\n"
|
||||
"in Device 123, you could send the following command:\r\n"
|
||||
"%s 123 1 101 87\r\n",
|
||||
filename_remove_path(argv[0]),
|
||||
"%s 123 1 101 87\r\n", filename_remove_path(argv[0]),
|
||||
filename_remove_path(argv[0]));
|
||||
}
|
||||
return 0;
|
||||
@@ -351,7 +349,7 @@ int main(int argc, char *argv[]) {
|
||||
fprintf(stderr, "\rError: TSM Timeout!\r\n");
|
||||
tsm_free_invoke_id(invoke_id);
|
||||
Error_Detected = true;
|
||||
/* try again or abort? */
|
||||
/* try again or abort? */
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -360,13 +358,14 @@ int main(int argc, char *argv[]) {
|
||||
if (elapsed_seconds > timeout_seconds) {
|
||||
printf("\rError: APDU Timeout!\r\n");
|
||||
Error_Detected = true;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* keep track of time for next check */
|
||||
last_seconds = current_seconds;
|
||||
}
|
||||
|
||||
if(Error_Detected) return 1;
|
||||
if (Error_Detected)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,8 @@ static void Init_DataLink(
|
||||
if (bbmd_address) {
|
||||
struct in_addr addr;
|
||||
addr.s_addr = bbmd_address;
|
||||
printf("ReinitDevice: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
printf
|
||||
("ReinitDevice: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds);
|
||||
bvlc_register_with_bbmd(bbmd_address, bbmd_port,
|
||||
bbmd_timetolive_seconds);
|
||||
|
||||
@@ -181,7 +181,8 @@ static void Init_DataLink(
|
||||
if (bbmd_address) {
|
||||
struct in_addr addr;
|
||||
addr.s_addr = bbmd_address;
|
||||
printf("TimeSync: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
printf
|
||||
("TimeSync: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds);
|
||||
bvlc_register_with_bbmd(bbmd_address, bbmd_port,
|
||||
bbmd_timetolive_seconds);
|
||||
|
||||
@@ -142,7 +142,8 @@ static void Init_DataLink(
|
||||
if (bbmd_address) {
|
||||
struct in_addr addr;
|
||||
addr.s_addr = bbmd_address;
|
||||
printf("UnconfirmedCOV: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
printf
|
||||
("UnconfirmedCOV: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds);
|
||||
bvlc_register_with_bbmd(bbmd_address, bbmd_port,
|
||||
bbmd_timetolive_seconds);
|
||||
@@ -211,8 +212,8 @@ int main(int argc, char *argv[]) {
|
||||
filename_remove_path(argv[0]), filename_remove_path(argv[0]));
|
||||
return 0;
|
||||
}
|
||||
/* decode the command line parameters */ cov_data.
|
||||
subscriberProcessIdentifier = strtol(argv[1], NULL, 0);
|
||||
/* decode the command line parameters */
|
||||
cov_data.subscriberProcessIdentifier = strtol(argv[1], NULL, 0);
|
||||
cov_data.initiatingDeviceIdentifier = strtol(argv[2], NULL, 0);
|
||||
cov_data.monitoredObjectIdentifier.type = strtol(argv[3], NULL, 0);
|
||||
cov_data.monitoredObjectIdentifier.instance = strtol(argv[4], NULL, 0);
|
||||
|
||||
@@ -238,15 +238,13 @@ int main(int argc, char *argv[]) {
|
||||
time_t timeout_seconds = 0;
|
||||
|
||||
if (argc < 2) {
|
||||
printf
|
||||
("Usage: %s device-instance | "
|
||||
printf("Usage: %s device-instance | "
|
||||
"device-instance-min device-instance-max\r\n",
|
||||
filename_remove_path(argv[0]));
|
||||
return 0;
|
||||
}
|
||||
if ((argc > 1) && (strcmp(argv[1], "--help") == 0)) {
|
||||
printf(
|
||||
"Send BACnet WhoIs service request to a device or\r\n"
|
||||
printf("Send BACnet WhoIs service request to a device or\r\n"
|
||||
"multiple devices, and wait for responses. Displays\r\n"
|
||||
"any devices found and their network information.\r\n"
|
||||
"\r\ndevice-instance:\r\n"
|
||||
@@ -254,17 +252,12 @@ int main(int argc, char *argv[]) {
|
||||
"send a Who-Is service request. The value should be in\r\n"
|
||||
"the range of 0 to 4194303. A range of values can also be\r\n"
|
||||
"specified by using a minimum value and a maximum value.\r\n"
|
||||
"\r\nExample:\r\n"
|
||||
"To send a WhoIs request to Device 123\r\n"
|
||||
"use the following command:\r\n"
|
||||
"%s 123\r\n"
|
||||
"\r\nExample:\r\n" "To send a WhoIs request to Device 123\r\n"
|
||||
"use the following command:\r\n" "%s 123\r\n"
|
||||
"To send a WhoIs request to Devices from 1000 to 9000:\r\n"
|
||||
"%s 1000 9000\r\n"
|
||||
"To send a WhoIs request to all devices\r\n"
|
||||
"use the following command:\r\n"
|
||||
"%s -1\r\n",
|
||||
filename_remove_path(argv[0]),
|
||||
filename_remove_path(argv[0]),
|
||||
"%s 1000 9000\r\n" "To send a WhoIs request to all devices\r\n"
|
||||
"use the following command:\r\n" "%s -1\r\n",
|
||||
filename_remove_path(argv[0]), filename_remove_path(argv[0]),
|
||||
filename_remove_path(argv[0]));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -226,7 +226,8 @@ static void Init_DataLink(
|
||||
if (bbmd_address) {
|
||||
struct in_addr addr;
|
||||
addr.s_addr = bbmd_address;
|
||||
printf("AtomicWriteFile: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
printf
|
||||
("AtomicWriteFile: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds);
|
||||
bvlc_register_with_bbmd(bbmd_address, bbmd_port,
|
||||
bbmd_timetolive_seconds);
|
||||
|
||||
@@ -223,7 +223,8 @@ static void Init_DataLink(
|
||||
if (bbmd_address) {
|
||||
struct in_addr addr;
|
||||
addr.s_addr = bbmd_address;
|
||||
printf("WriteProperty: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
printf
|
||||
("WriteProperty: Registering with BBMD at %s:%ld for %ld seconds\n",
|
||||
inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds);
|
||||
bvlc_register_with_bbmd(bbmd_address, bbmd_port,
|
||||
bbmd_timetolive_seconds);
|
||||
@@ -304,15 +305,13 @@ int main(int argc, char *argv[]) {
|
||||
"accepting REAL, BOOLEAN, NULL, etc. Perhaps it would be simpler for\r\n"
|
||||
"the demo to use this kind of table - but I also wanted to be able\r\n"
|
||||
"to do negative testing by passing the wrong tag and have the server\r\n"
|
||||
"return a reject message.\r\n"
|
||||
"\r\nExample:\r\n"
|
||||
"return a reject message.\r\n" "\r\nExample:\r\n"
|
||||
"If you want send a value of 100 to the Present-Value in\r\n"
|
||||
"Analog Output 0 of Device 123 at priority 16,\r\n"
|
||||
"send the following command:\r\n"
|
||||
"%s 123 1 0 85 16 -1 4 100\r\n"
|
||||
"To send a relinquish command to the same object:\r\n"
|
||||
"%s 123 1 0 85 16 -1 0 0\r\n",
|
||||
filename_remove_path(argv[0]),
|
||||
"%s 123 1 0 85 16 -1 0 0\r\n", filename_remove_path(argv[0]),
|
||||
filename_remove_path(argv[0]));
|
||||
}
|
||||
return 0;
|
||||
@@ -392,7 +391,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
if (args_remaining > 0) {
|
||||
fprintf(stderr, "Error: Exceeded %d tag-value pairs.\r\n",
|
||||
fprintf(stderr, "Error: Exceeded %d tag-value pairs.\r\n",
|
||||
MAX_PROPERTY_VALUES);
|
||||
return 1;
|
||||
}
|
||||
@@ -448,7 +447,7 @@ int main(int argc, char *argv[]) {
|
||||
fprintf(stderr, "\rError: TSM Timeout!\r\n");
|
||||
tsm_free_invoke_id(invoke_id);
|
||||
Error_Detected = true;
|
||||
/* try again or abort? */
|
||||
/* try again or abort? */
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -463,6 +462,7 @@ int main(int argc, char *argv[]) {
|
||||
/* keep track of time for next check */
|
||||
last_seconds = current_seconds;
|
||||
}
|
||||
if(Error_Detected) return 1;
|
||||
if (Error_Detected)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user