com.digi.xbee.api.models

## Enum SpecialByte

- java.lang.Object
- - java.lang.Enum<SpecialByte>
  - - com.digi.xbee.api.models.SpecialByte

- All Implemented Interfaces:
    Serializable, Comparable<SpecialByte>

      public enum SpecialByte
      extends Enum<SpecialByte>

  Enumerates all the special bytes of the XBee protocol that must be escaped when working on API 2 mode.
  See Also:
    `OperatingMode`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ESCAPE_BYTE`
    `HEADER_BYTE`
    `XOFF_BYTE`
    `XON_BYTE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `escapeByte()` Escapes the byte by performing a XOR operation with `0x20` value.
    `static SpecialByte` | `get(int value)` Returns the `SpecialByte` entry associated with the given value.
    `int` | `getValue()` Returns the special byte value.
    `static boolean` | `isSpecialByte(int byteToCheck)` Checks whether the given byte is special or not.
    `static SpecialByte` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static SpecialByte[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### ESCAPE_BYTE

          public static final SpecialByte ESCAPE_BYTE

    - #### HEADER_BYTE

          public static final SpecialByte HEADER_BYTE

    - #### XOFF_BYTE

          public static final SpecialByte XOFF_BYTE

    - #### XON_BYTE

          public static final SpecialByte XON_BYTE

  - ### Method Detail

    - #### escapeByte

          public int escapeByte()

      Escapes the byte by performing a XOR operation with `0x20` value.
      Returns:
        Escaped byte value.

    - #### get

          public static SpecialByte get(int value)

      Returns the `SpecialByte` entry associated with the given value.
      Parameters:
        `value` - Value of the `SpecialByte` to retrieve.
      Returns:
        `SpecialByte` associated to the given value, `null` if it does not exist in the list.

    - #### getValue

          public int getValue()

      Returns the special byte value.
      Returns:
        The special byte value.

    - #### isSpecialByte

          public static boolean isSpecialByte(int byteToCheck)

      Checks whether the given byte is special or not.
      Parameters:
        `byteToCheck` - Byte to check.
      Returns:
        `true` if given byte is special, `false` otherwise.

    - #### valueOf

          public static SpecialByte valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### values

          public static SpecialByte[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (SpecialByte c : SpecialByte.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

© Copyright 2014–2014 Digi International Inc. All rights reserved.