• 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

    Bug in LogData class

    BACnet4J general discussion
    1
    2
    2.0k
    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.
    • J
      joolz
      last edited by

      According to the standard, BACnetLogData is a choice of log-status, log-data or time-change.

      However, looking at com.serotonin.bacnet4j.type.constructed.LogData.java:```
      public LogData(ByteQueue queue) throws BACnetException {
      logStatus = read(queue, LogStatus.class, 0);
      logData = readSequenceOfChoice(queue, classes, 1);
      timeChange = read(queue, Real.class, 2);
      }

      @Override
      public void write(ByteQueue queue) {
          write(queue, logStatus, 0);
          write(queue, logData, 1);
          write(queue, timeChange, 2);
      }
      
      
      By changing
      
      public LogData(ByteQueue queue) throws BACnetException {
          logStatus = read(queue, LogStatus.class, 0);
          logData = readSequenceOfChoice(queue, classes, 1);
          timeChange = read(queue, Real.class, 2);
      }
      
      public LogData(ByteQueue queue) throws BACnetException {
          int tag = peekTagNumber(queue);
          if (tag == 0)
          {
              logStatus = read(queue, LogStatus.class, 0);
              logData = null;
              timeChange = null;
          }
          else if (tag == 1)
          {
              logStatus = null;
              logData = readSequenceOfChoice(queue, classes, 1);
              timeChange = null;
          }
          else if (tag == 2)
          {
              logStatus = null;
              logData = null;
              timeChange = read(queue, Real.class, 2);
          }
          else
          {
              throw new BACnetErrorException(ErrorClass.property, ErrorCode.missingRequiredParameter);
          }
      }
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post