V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
o1iver
V2EX  ›  问与答

有大佬会 BACNet 协议获取同网段下设备信息吗

  •  1
     
  •   o1iver · 344 天前 · 435 次点击
    这是一个创建于 344 天前的主题,其中的信息可能已经有所发展或是发生改变。
    怎样用 Java 通过 BACNet 协议获取同局域网下的所有设备信息,具体流程
    Eiden
        1
    Eiden  
       344 天前
    发送 whois 消息, 这个消息是个广播, 正常设备收到后会回复 i-am 消息, 这个流程一般 bacnet 的包都实现了的, 看看文档吧
    o1iver
        2
    o1iver  
    OP
       344 天前
    @Eiden 我就是在 bacnet 包中找不到发送 whois 消息的方法,一般是用哪个版本的 bacnet 包呀
    Eiden
        3
    Eiden  
       343 天前   ❤️ 1

    https://github.com/Code-House/bacnet4j-wrapper
    ```
    BacNetClient client = new BacNetIpClient("<bind ip>", "<broadcast ip>", <client device id>);
    client.start();
    Set<Device> devices = client.discoverDevices(5000); // given number is timeout in millis
    for (Device device : devices) {
    System.out.println(device);

    for (Property property : client.getDeviceProperties(device)) {
    System.out.println(property.getName() + " " + client.getPropertyValue(property));
    }
    }

    client.stop();
    ```
    这个 discoverDevices 就是
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5366 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 09:04 · PVG 17:04 · LAX 02:04 · JFK 05:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.