Ejemplo n.º 1
0
 /// <summary>
 /// Performs a GET operation </summary>
 /// <param name="phy"> PhyLayer to transmit / receive bytes </param>
 /// <param name="obj"> Long-name descriptor of the objected to be accessed </param>
 /// <exception cref="PhyLayerException"> </exception>
 /// <exception cref="DlmsException"> </exception>
 /// <exception cref="LinkLayerException">  </exception>
 public void get(PhyLayer phy, LnDescriptor obj)
 {
     do
     {
         link.send(phy, cosem.requestGet(obj));
     } while (!cosem.parseGetResponse(obj, link.read(phy)));
 }
Ejemplo n.º 2
0
        public int getIntegerValue(DlmsClient dlms, PhyLayer phy)
        {
            LnDescriptor desc = new LnDescriptor(CosemClasses.REGISTER.id, obis, attValue);

            dlms.get(phy, desc);
            return(DlmsParser.getInteger(desc.getResponseData()));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Performs a ACTION operation </summary>
 /// <param name="phy"> PhyLayer to transmit / receive bytes </param>
 /// <param name="obj"> Long-name descriptor of the objected to be accessed </param>
 /// <exception cref="PhyLayerException"> </exception>
 /// <exception cref="DlmsException"> </exception>
 /// <exception cref="LinkLayerException">  </exception>
 public void action(PhyLayer phy, LnDescriptor obj)
 {
     do
     {
         link.send(phy, cosem.requestAction(obj));
     } while (!cosem.parseActionResponse(obj, link.read(phy)));
 }
Ejemplo n.º 4
0
        public string getStringValue(DlmsClient dlms, PhyLayer phy)
        {
            LnDescriptor desc = new LnDescriptor(CosemClasses.DATA.id, obis, attValue);

            dlms.get(phy, desc);
            return(DlmsParser.getString(desc.getResponseData()));
        }
Ejemplo n.º 5
0
        public byte[] getValue(DlmsClient dlms, PhyLayer phy)
        {
            LnDescriptor desc = new LnDescriptor(CosemClasses.REGISTER.id, obis, attValue);

            dlms.get(phy, desc);
            return(desc.getResponseData());
        }
        public int getImageBlockSize(DlmsClient dlms, PhyLayer phy)
        {
            LnDescriptor att = createDesc(attBlockSize);

            dlms.get(phy, att);
            return(DlmsParser.getInteger(att.getResponseData()));
        }
        public bool isTransferEnabled(DlmsClient dlms, PhyLayer phy)
        {
            LnDescriptor att = createDesc(attTransferEnabled);

            dlms.get(phy, att);
            return(DlmsParser.getBoolean(att.getResponseData()));
        }
        private LnDescriptor createDesc(int index, byte[] data)
        {
            LnDescriptor att = createDesc(index);

            att.setRequestData(data);
            return(att);
        }
        public void transferBlocks(DlmsClient dlms, PhyLayer phy, ImageInformation imageInfo)
        {
            int          offset = 0;
            int          nblock = 1;
            LnDescriptor att    = createDesc(mtdImageBlockTransfer);

            while (offset < imageInfo.getImage().Length)
            {
                att.setRequestData(getTransferBlockData(nblock, imageInfo));
                dlms.action(phy, att);
                nblock++;
                offset += imageInfo.getBlockSize();
            }
        }
Ejemplo n.º 10
0
        public void reset(DlmsClient dlms, PhyLayer phy)
        {
            LnDescriptor desc = new LnDescriptor(CosemClasses.REGISTER.id, obis, mtdReset);

            dlms.action(phy, desc);
        }