Menu

#69 arguments handling for bacwpm

v0.9.1
pending
None
1
2020-04-19
2020-02-13
Anonymous
No

Issue with arguments handling for bacwpm
e.g.
bacwpm 938026 2 1 85 0 -1 4 100 2 2 85 0 -1 4 100
Error: tag=4294967295 - it must be less than 16

Think the following is a fix ?

--- a/apps/writepropm/main.c
+++ b/apps/writepropm/main.c
@@ -302,8 +302,8 @@ int main(int argc, char *argv[])
wpm_object = Write_Access_Data;
args_remaining = (argc - 2);
arg_sets = 0;

  • tag_value_arg = 2 + (arg_sets * 6);
    while (wpm_object) {
  • tag_value_arg = 2 + (arg_sets * 6);
    if (bactext_object_type_strtol(
    argv[tag_value_arg], &wpm_object->object_type) == false) {
    fprintf(
    @@ -368,6 +368,9 @@ int main(int argc, char *argv[])
    } else {
    wpm_property->propertyArrayIndex = BACNET_ARRAY_ALL;
    }
  • tag_value_arg++;
  • args_remaining--;
    +
    if (args_remaining <= 0) {
    fprintf(stderr,
    "Error: missing priority and tag value pair.\n");

Discussion

  • Steve Karg

    Steve Karg - 2020-04-19

    For RPM and WPM, the array index is passed within square brackets, or no brackets when not used, instead of -1 when not used.
    bacwpm 938026 2 1 85 0 4 100 2 2 85 0 4 100
    bacwpm 938026 2 1 87[1] 0 4 100 2 2 87[1] 0 4 100
    (yes, totally fictional example since priority-array is not writable)

     
  • Steve Karg

    Steve Karg - 2020-04-19
    • status: open --> pending
    • assigned_to: Steve Karg
     

Anonymous
Anonymous

Add attachments
Cancel