インタフェース Secs1MessageBlock


public interface Secs1MessageBlock
SECS-I Message Block.
  • メソッドの概要

    修飾子とタイプ メソッド 説明
    int blockNumber()
    Returns Block number.
    boolean checkSum()
    Returns Check SUM result.
    int deviceId()
    Returns Block Device-ID number.
    boolean ebit()
    Returns Block E-Bit.
    boolean equalsSystemBytes​(Secs1MessageBlock otherBlock)
    Returns Block system bytes is equals.
    byte[] getBytes()
    Returns Block bytes.
    boolean isFirstBlock()
    Return Block is First.
    boolean isNextBlock​(Secs1MessageBlock nextBlock)
    Returns nextBlock is next block.
    boolean isValid()
    Returns true if block is valid data.
    int length()
    Returns Length-byte number.
    static Secs1MessageBlock of​(byte[] bs)
    Returns Secs1MessageBlock.
  • メソッドの詳細

    • isValid

      boolean isValid()
      Returns true if block is valid data.

      Valid block condition is

      • bytes.ength is >=13 && <=257
      • length-byte is >=10 && <=254
      • length-byte + 3 == bytes.length
      • checksum is true
      戻り値:
      true if valid block
    • deviceId

      int deviceId()
      Returns Block Device-ID number.

      Returns -1 if block is NOT valid data.

      戻り値:
      Device-ID
    • ebit

      boolean ebit()
      Returns Block E-Bit.

      Returns false if block is NOT valid data.

      戻り値:
      true if has e-bit
    • blockNumber

      int blockNumber()
      Returns Block number.

      Returns -1 if block is NOT valid data.

      戻り値:
      block number
    • isFirstBlock

      boolean isFirstBlock()
      Return Block is First.

      Returns false if block is NOT valid data.

      戻り値:
      true if block-number is ZERO or ONE
    • length

      int length()
      Returns Length-byte number.

      Returns -1 if block is NOT valid data.

      戻り値:
      Length-byte number
    • getBytes

      byte[] getBytes()
      Returns Block bytes.
      戻り値:
      Block bytes
    • checkSum

      boolean checkSum()
      Returns Check SUM result.

      Returns false if block is NOT valid data.

      戻り値:
      true if check-sum is valid
    • equalsSystemBytes

      boolean equalsSystemBytes​(Secs1MessageBlock otherBlock)
      Returns Block system bytes is equals.

      Returns false if block is NOT valid data.

      パラメータ:
      otherBlock - the Other SECS-I Message Block
      戻り値:
      true if system bytes is equals
    • isNextBlock

      boolean isNextBlock​(Secs1MessageBlock nextBlock)
      Returns nextBlock is next block.

      Returns false if block is NOT valid data.

      パラメータ:
      nextBlock - the next SECS-I Message Block
      戻り値:
      true if nextBlock is next block.
    • of

      static Secs1MessageBlock of​(byte[] bs)
      Returns Secs1MessageBlock.

      This method can build also invalid block.

      パラメータ:
      bs - block bytes.
      戻り値:
      Secs1MessageBlock
      例外:
      java.lang.NullPointerException - if input null