Package br.org.scadabr.dnp34j.master.common.utils

Examples of br.org.scadabr.dnp34j.master.common.utils.Buffer.writeBytes()


    for (int i = 0; i < values.length; i++) {
      if ((qualifier & 0xF0) == 0x10) {
        getData.writeByte((byte) values[i]);
      } else {
        getData.writeBytes(values[i]);
      }

      getData.writeBytes(newDataObjects[i].data);
      setDB(values[i], newDataObjects[i].data, group, variation);
    }
View Full Code Here


        getData.writeByte((byte) values[i]);
      } else {
        getData.writeBytes(values[i]);
      }

      getData.writeBytes(newDataObjects[i].data);
      setDB(values[i], newDataObjects[i].data, group, variation);
    }

    return getData.readBytes();
  }
View Full Code Here

   * corresponding data in database
   */
  public Buffer buildRequestMsg(byte FC, byte group, byte variation,
      int start, int stop, boolean withData) throws Exception {
    Buffer requestFrame = new Buffer(S);
    requestFrame.writeBytes(buildHeader(FC, group, variation));

    if (stop < 256) {
      requestFrame.writeByte(START_STOP_8);
      requestFrame.writeByte((byte) start);
      requestFrame.writeByte((byte) stop);
View Full Code Here

      requestFrame.writeByte(START_STOP_8);
      requestFrame.writeByte((byte) start);
      requestFrame.writeByte((byte) stop);
    } else {
      requestFrame.writeByte(START_STOP_16);
      requestFrame.writeBytes(start);
      requestFrame.writeBytes(stop);
    }

    // if (withData) {
    // if (DataObject.getObjectType(group) == IIN) {
View Full Code Here

      requestFrame.writeByte((byte) start);
      requestFrame.writeByte((byte) stop);
    } else {
      requestFrame.writeByte(START_STOP_16);
      requestFrame.writeBytes(start);
      requestFrame.writeBytes(stop);
    }

    // if (withData) {
    // if (DataObject.getObjectType(group) == IIN) {
    // requestFrame.writeBytes(getIIN(start, stop));
View Full Code Here

   * in database
   */
  public Buffer buildRequestMsg(byte FC, byte group, byte variation,
      int quantity, boolean withData) {
    Buffer requestFrame = new Buffer(S);
    requestFrame.writeBytes(buildHeader(FC, group, variation));

    if (quantity < 256) {
      requestFrame.writeByte(QUANTITY_8);
      requestFrame.writeByte((byte) quantity);
    } else {
View Full Code Here

    if (quantity < 256) {
      requestFrame.writeByte(QUANTITY_8);
      requestFrame.writeByte((byte) quantity);
    } else {
      requestFrame.writeByte(QUANTITY_16);
      requestFrame.writeBytes(quantity);
    }

    if (withData) {
      if (group == 50) {
        requestFrame.writeBytes(DataObject.getTime(System
View Full Code Here

      requestFrame.writeBytes(quantity);
    }

    if (withData) {
      if (group == 50) {
        requestFrame.writeBytes(DataObject.getTime(System
            .currentTimeMillis()));
      }
      // else {
      // requestFrame.writeBytes(dataMap.get(group, variation, 0,
      // quantity - 1));
View Full Code Here

   * CONTROL function
   */
  public Buffer buildRequestMsg(byte FC, byte group, byte variation,
      int[] values, boolean withData) {
    Buffer requestFrame = new Buffer(S);
    requestFrame.writeBytes(buildHeader(FC, group, variation));

    if (values[values.length - 1] < 256) {
      requestFrame.writeByte(INDEXES_8);
      requestFrame.writeByte((byte) values.length);

View Full Code Here

        // requestFrame.writeBytes(appRcv.getDataMap().get(group,
        // variation, values, (byte) 0x17));
      } else {
        byte[] byteValues = new byte[values.length];
        System.arraycopy(values, 0, byteValues, 0, values.length);
        requestFrame.writeBytes(byteValues);
      }
    } else {
      requestFrame.writeByte(INDEXES_16);
      requestFrame.writeBytes(values.length);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.