java.lang.Object
java.lang.Enum<ScanControlEnum>
io.github.lunasaw.gb28181.common.entity.control.instruction.enums.ScanControlEnum
All Implemented Interfaces:
Serializable, Comparable<ScanControlEnum>, java.lang.constant.Constable

public enum ScanControlEnum extends Enum<ScanControlEnum>
扫描指令枚举 根据 A.3.6 扫描指令 规范实现
  • Enum Constant Details

  • Method Details

    • values

      public static ScanControlEnum[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ScanControlEnum valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getByCode

      public static ScanControlEnum getByCode(byte code)
      根据指令码查找枚举 - 注意0x89指令码需要结合操作类型判断
      Parameters:
      code - 指令码
      Returns:
      扫描控制枚举(对于0x89返回START_AUTO_SCAN作为默认值)
    • getByCodeAndOperation

      public static ScanControlEnum getByCodeAndOperation(byte code, ScanControlEnum.ScanOperationType operationType)
      根据指令码和操作类型查找枚举
      Parameters:
      code - 指令码
      operationType - 操作类型
      Returns:
      扫描控制枚举
    • getByName

      public static ScanControlEnum getByName(String name)
      根据名称查找枚举
    • isValidGroupNumber

      public static boolean isValidGroupNumber(int groupNumber)
      验证扫描组号是否有效
      Parameters:
      groupNumber - 扫描组号 (0-255)
      Returns:
      是否有效
    • isValidSpeed

      public static boolean isValidSpeed(int speed)
      验证扫描速度是否有效
      Parameters:
      speed - 扫描速度 (数据的低8位在字节6,高4位在字节7的高4位)
      Returns:
      是否有效