类 DataPacket


  • public class DataPacket
    extends java.lang.Object
    The type Data packet.
    • 构造器概要

      构造器 
      构造器 说明
      DataPacket​(byte cmd)
      Instantiates a new Data packet.
      DataPacket​(byte[] bytes)
      Instantiates a new Data packet.
      DataPacket​(byte cmd, byte[] coreBytes)
      Instantiates a new Data packet.
      DataPacket​(byte head, byte address, byte cmd, byte[] data, int length)
      Instantiates a new Data packet.
    • 构造器详细资料

      • DataPacket

        public DataPacket​(byte cmd)
        Instantiates a new Data packet.
        参数:
        cmd - the cmd
      • DataPacket

        public DataPacket​(byte cmd,
                          byte[] coreBytes)
        Instantiates a new Data packet.
        参数:
        cmd - the cmd
        coreBytes - the core bytes
      • DataPacket

        public DataPacket​(byte head,
                          byte address,
                          byte cmd,
                          byte[] data,
                          int length)
        Instantiates a new Data packet.
        参数:
        head - the head
        address - the address
        cmd - the cmd
        data - the data
        length - the length
      • DataPacket

        public DataPacket​(byte[] bytes)
                   throws java.security.InvalidParameterException
        Instantiates a new Data packet.
        参数:
        bytes - the bytes
        抛出:
        java.security.InvalidParameterException - the invalid parameter exception
    • 方法详细资料

      • getHead

        public byte getHead()
        Gets head.
        返回:
        the head
      • getLen

        public byte getLen()
        Gets len.
        返回:
        the len
      • getAddress

        public byte getAddress()
        Gets address.
        返回:
        the address
      • getState

        public byte getState()
        Gets state.
        返回:
        the state
      • getCmd

        public byte getCmd()
        Gets cmd.
        返回:
        the cmd
      • getCoreDataLen

        public int getCoreDataLen()
        Gets core data len.
        返回:
        the core data len
      • getCoreData

        public byte[] getCoreData()
        Get core data byte [ ].
        返回:
        the byte [ ]
      • getCheckSum

        public byte getCheckSum()
        Gets check sum.
        返回:
        the check sum
      • getData

        public byte[] getData()
        Get data byte [ ].
        返回:
        the byte [ ]
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.lang.Object