Menu

Demo bacwi [ip]:[port]

Tim G
2016-08-09
2016-08-09
  • Tim G

    Tim G - 2016-08-09

    I think the demo bacwi program is bugged. The demo program invoked as:

    $ bacwi 10.0.0.2:47808
    

    per Wireshark, sends a "whois 10 10" packet to the network broadcast (10.0.255.255 in my case), as opposed to what I expected: a unicast packet to the IP with no instance ID specified.

    This runs counter to the commad line help for the command, which says bacwi [ip]:[port] should work.

    Am I misreading something? Is it bugged?

    Newb analysis: I'm seeing that argv[1] is strtol'd straight away in the function that tries to parse the IP argument, and I get the impression this obliterates the IP. Throwing debug printf's into the code makes me wonder if it necessarily gets that far anyway.

     
  • Steve Karg

    Steve Karg - 2016-08-09

    The demo bacwi application in the 0.8.x branch seems to have a problem handlng the unicast form with an IP address, so it is indeed bugged.

    The demo bacwi application in trunk/bacnet-stack/ handles the arguments this way:

        printf("Usage: %s", filename);
        printf(" [device-instance-min [device-instance-max]]\n");
        printf("       [--dnet][--dadr][--mac]\n");
        printf("       [--version][--help]\n");
    

    My preference is to migrate the demo code from trunk/bacnet-stack into the 0.8.x branch rather than patching the broken argument handling. Would the demo bacwi in SVN from trunk/bacnet-stack work for you?

     
  • Tim G

    Tim G - 2016-08-09

    Yes, that works quite nicely, thanks. I hadn't realized the trunk was the best way to go.

     

Log in to post a comment.