• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    GetAddress

    BACnet4J general discussion
    2
    4
    2.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      robert bouwens
      last edited by

      hi,
      today the cvs is a little bit broken.
      in localDevice.java the getAddress calls the wrong constructor:
      private byte[] getLocalIPAddress() throws UnknownHostException, SocketException
      {
      Enumeration<NetworkInterface> netInter = NetworkInterface.getNetworkInterfaces();
      int n = 0;

      	while (netInter.hasMoreElements())
      	{
      		NetworkInterface ni = netInter.nextElement();
      
      		System.out.println("NetworkInterface " + n++ + ": " + ni.getDisplayName());
      
      		for (InetAddress iaddress : Collections.list(ni.getInetAddresses()))
      		{
      			System.out.println("CanonicalHostName: " + iaddress.getCanonicalHostName());
      
      			System.out.println("IP: " + iaddress.getHostAddress());
      
      			System.out.println("Loopback? " + iaddress.isLoopbackAddress());
      			System.out.println("SiteLocal? " + iaddress.isSiteLocalAddress());
      			System.out.println();
      			if (false == iaddress.isLoopbackAddress() && iaddress.isSiteLocalAddress())
      				return iaddress.getAddress();
      		}
      	}
      
      	return InetAddress.getLocalHost().getAddress();
      }
      public Address getAddress() {
          try {
          	return new Address(null, getLocalIPAddress(), messageControl.getPort());
          }
          catch (UnknownHostException e) {
              // Should never happen, so just wrap in a RuntimeException
              throw new RuntimeException(e);
          }
          catch (SocketException e) {
              // Should never happen, so just wrap in a RuntimeException
              throw new RuntimeException(e);
          }
      }
      

      in the class Address the networkNumber member has to of type Unsigned16.
      correct all compiling errrors and you are ready to add yourself as listener in the notification objects.

      regards
      robert

      you can change that quickly.

      1 Reply Last reply Reply Quote 0
      • M
        mlohbihler
        last edited by

        Hi Robert,

        Not sure what you are saying is broken since getLocalIPAddress is not in the CVS version of the class.

        Best regards,
        Matthew

        1 Reply Last reply Reply Quote 0
        • R
          robert bouwens
          last edited by

          hi matt,

          broken means that as local address 127.0.0.1 is returned. plus the bacnet port is being used as bacnet network number.
          at least our app did not work anymore after updating from cvs. .now it should again after your latest fixes.

          best regards
          robert

          1 Reply Last reply Reply Quote 0
          • First post
            Last post