indented.
This commit is contained in:
@@ -178,50 +178,39 @@ int main(
|
||||
"communicate to. This number will be used to try and bind with\r\n"
|
||||
"the device using Who-Is and I-Am services. For example, if you were\r\n"
|
||||
"writing to Device Object 123, the device-instance would be 123.\r\n"
|
||||
"\r\n"
|
||||
"object-type:\r\n"
|
||||
"\r\n" "object-type:\r\n"
|
||||
"The object type is the integer value of the enumeration\r\n"
|
||||
"BACNET_OBJECT_TYPE in bacenum.h. It is the object that you are\r\n"
|
||||
"writing to. For example if you were writing to Analog Output 2, \r\n"
|
||||
"the object-type would be 1.\r\n"
|
||||
"\r\n"
|
||||
"object-instance:\r\n"
|
||||
"the object-type would be 1.\r\n" "\r\n" "object-instance:\r\n"
|
||||
"This is the object instance number of the object that you are \r\n"
|
||||
"writing to. For example, if you were writing to Analog Output 2, \r\n"
|
||||
"the object-instance would be 2.\r\n"
|
||||
"\r\n"
|
||||
"property:\r\n"
|
||||
"the object-instance would be 2.\r\n" "\r\n" "property:\r\n"
|
||||
"The property is an integer value of the enumeration \r\n"
|
||||
"BACNET_PROPERTY_ID in bacenum.h. It is the property you are \r\n"
|
||||
"writing to. For example, if you were writing to the Present Value\r\n"
|
||||
"property, you would use 85 as the property.\r\n"
|
||||
"\r\n"
|
||||
"property, you would use 85 as the property.\r\n" "\r\n"
|
||||
"priority:\r\n"
|
||||
"This parameter is used for setting the priority of the\r\n"
|
||||
"write. If Priority 0 is given, no priority is sent. The BACnet \r\n"
|
||||
"standard states that the value is written at the lowest \r\n"
|
||||
"priority (16) if the object property supports priorities\r\n"
|
||||
"when no priority is sent.\r\n"
|
||||
"\r\n"
|
||||
"index\r\n"
|
||||
"when no priority is sent.\r\n" "\r\n" "index\r\n"
|
||||
"This integer parameter is the index number of an array.\r\n"
|
||||
"If the property is an array, individual elements can be written\r\n"
|
||||
"to if supported. If this parameter is -1, the index is ignored.\r\n"
|
||||
"\r\n"
|
||||
"tag:\r\n"
|
||||
"\r\n" "tag:\r\n"
|
||||
"Tag is the integer value of the enumeration BACNET_APPLICATION_TAG \r\n"
|
||||
"in bacenum.h. It is the data type of the value that you are\r\n"
|
||||
"writing. For example, if you were writing a REAL value, you would \r\n"
|
||||
"use a tag of 4.\r\n"
|
||||
"Context tags are created using two tags in a row. The context tag\r\n"
|
||||
"is preceded by a C. Ctag tag. C2 4 creates a context 2 tagged REAL.\r\n"
|
||||
"\r\n"
|
||||
"value:\r\n"
|
||||
"\r\n" "value:\r\n"
|
||||
"The value is an ASCII representation of some type of data that you\r\n"
|
||||
"are writing. It is encoded using the tag information provided. For\r\n"
|
||||
"example, if you were writing a REAL value of 100.0, you would use \r\n"
|
||||
"100.0 as the value.\r\n"
|
||||
"\r\n"
|
||||
"100.0 as the value.\r\n" "\r\n"
|
||||
"Here is a brief overview of BACnet property and tags:\r\n"
|
||||
"Certain properties are expected to be written with certain \r\n"
|
||||
"application tags, so you probably need to know which ones to use\r\n"
|
||||
@@ -232,15 +221,13 @@ int main(
|
||||
"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\n"
|
||||
"Example:\r\n"
|
||||
"return a reject message.\r\n" "\r\n" "Example:\r\n"
|
||||
"If you want send a 100 to the Present-Value in the Analog Output\r\n"
|
||||
"at priority 16, you could send the following command:\r\n"
|
||||
"%s 123 1 0 85 4 100\r\n"
|
||||
"You could also send a relinquish command:\r\n"
|
||||
"%s 123 1 0 85 0 0\r\n",
|
||||
filename_remove_path(argv[0]), filename_remove_path(argv[0]));
|
||||
"%s 123 1 0 85 0 0\r\n", filename_remove_path(argv[0]),
|
||||
filename_remove_path(argv[0]));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -296,8 +283,9 @@ int main(
|
||||
property_tag, MAX_BACNET_APPLICATION_TAG);
|
||||
return 1;
|
||||
}
|
||||
status = bacapp_parse_application_data(property_tag,
|
||||
value_string, &Target_Object_Property_Value[i]);
|
||||
status =
|
||||
bacapp_parse_application_data(property_tag, value_string,
|
||||
&Target_Object_Property_Value[i]);
|
||||
if (!status) {
|
||||
/* FIXME: show the expected entry format for the tag */
|
||||
fprintf(stderr, "unable to parse the tag value\r\n");
|
||||
@@ -319,8 +307,8 @@ int main(
|
||||
return 1;
|
||||
/* configure the timeout values */
|
||||
last_seconds = time(NULL);
|
||||
timeout_seconds = (Device_APDU_Timeout() / 1000) *
|
||||
Device_Number_Of_APDU_Retries();
|
||||
timeout_seconds =
|
||||
(Device_APDU_Timeout() / 1000) * Device_Number_Of_APDU_Retries();
|
||||
/* try to bind with the device */
|
||||
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
||||
/* loop forever */
|
||||
@@ -341,15 +329,15 @@ int main(
|
||||
if (Error_Detected)
|
||||
break;
|
||||
/* wait until the device is bound, or timeout and quit */
|
||||
found = address_bind_request(Target_Device_Object_Instance,
|
||||
&max_apdu, &Target_Address);
|
||||
found =
|
||||
address_bind_request(Target_Device_Object_Instance, &max_apdu,
|
||||
&Target_Address);
|
||||
if (found) {
|
||||
if (invoke_id == 0) {
|
||||
invoke_id =
|
||||
Send_Write_Property_Request
|
||||
(Target_Device_Object_Instance, Target_Object_Type,
|
||||
Target_Object_Instance, Target_Object_Property,
|
||||
&Target_Object_Property_Value[0],
|
||||
Send_Write_Property_Request(Target_Device_Object_Instance,
|
||||
Target_Object_Type, Target_Object_Instance,
|
||||
Target_Object_Property, &Target_Object_Property_Value[0],
|
||||
Target_Object_Property_Priority,
|
||||
Target_Object_Property_Index);
|
||||
} else if (tsm_invoke_id_free(invoke_id))
|
||||
|
||||
Reference in New Issue
Block a user