• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Daniel McKinnell

    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
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    Daniel McKinnell

    @Daniel McKinnell

    0
    Reputation
    208
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Daniel McKinnell Unfollow Follow

    Latest posts made by Daniel McKinnell

    • RE: Request list of object properties

      Wish I knew about that before! Thanks heaps for the reference.
      Gonna put my function here for any future references too. Feel free to point out any improvements.

      public Map<PropertyIdentifier, Encodable> getObjectPropertyListNotNull(RemoteDevice d, ObjectIdentifier obj) throws BACnetException{
      
              List<ObjectPropertyTypeDefinition> propsDefs = ObjectProperties.getObjectPropertyTypeDefinitions(obj.getObjectType());
              ArrayList<PropertyIdentifier> props = new ArrayList<PropertyIdentifier>(propsDefs.size());
              Map<PropertyIdentifier, Encodable> propValuesFinal = new HashMap<>();
              
              for(ObjectPropertyTypeDefinition prop : propsDefs){props.add(prop.getPropertyTypeDefinition().getPropertyIdentifier());}
              
              
              if(d.getObject(obj) == null){
                  Map<PropertyIdentifier, Encodable> propValues = RequestUtils.getProperties(localDevice, d, obj, null, props.toArray(new PropertyIdentifier[props.size()]));
                  propValues.forEach((pid, val) -> {
                      if(val instanceof ErrorClassAndCode)
                          return;
                      propValuesFinal.put(pid, val);
                      d.setObjectProperty(obj, pid, val);
                  });
              }
              else{
                  for(PropertyIdentifier pid : props){
                      Encodable val = d.getObject(obj).getProperty(pid);
                      if(val != null){
                          propValuesFinal.put(pid, val);
                      }
                  }
              }
              return propValuesFinal;
          }
      
      posted in BACnet4J general discussion
      D
      Daniel McKinnell
    • RE: Request list of object properties

      I was hoping there was a simple way to just get the objects property list since there are nearly 500 defined properties making try-catching a bit inefficient.
      When using YABE I noticed how when you view a devices object it lists only the properties it has instead of a defined list of the same properties for every object of that type.

      posted in BACnet4J general discussion
      D
      Daniel McKinnell
    • Request list of object properties

      I'm trying to get a list of all the properties defined in an object on a remote device.

      RequestUtils.getProperty( localDevice, remoteDevice, AnalogInRef, PropertyIdentifier.propertyList);
      

      But it just throws and returns

      com.serotonin.bacnet4j.exception.BACnetErrorException: device: other
        at com.serotonin.bacnet4j.util.RequestUtils.getProperty(RequestUtils.java:104)
        at test.main(test.java:101)
      

      Same for PropertyIdentifier.listOfObjectPropertyReferences
      So I am not sure how to go about this.
      I'm using YABE (Yet Another BACnet Explorer) to run a simulator.

      posted in BACnet4J general discussion
      D
      Daniel McKinnell