Enum ErrorCode

  • java.lang.Object
    • java.lang.Enum<ErrorCode>
      • com.zentri.zentri_ble_command.ErrorCode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ErrorCode>

public enum ErrorCode
extends java.lang.Enum<ErrorCode>
See Also:
onError()

Enum Constant Summary

Enum Constant and Description
COMMAND_TIMEOUT
Command failed to complete within the timeout.
CONNECT_FAILED
Failed to connect to device.
CONNECTION_LOST
Connection was lost unexpectedly.
CONNECTION_RECONNECT
Connection was re-established after being dropped (take any required corrective action).
DEVICE_ERROR
An error occurred at the device level such as not having required characteristics or failing to set notification on the TX characteristic.
DISCONNECT_FAILED
Failed to disconnect from device.
INCOMPLETE_RESPONSE
An incomplete response was received from the device.
INTERNAL_ERROR
An unexpected error occurred within the library.
NO_CONNECTION_FOUND
The connection context was not found when processing a command.
READ_FAILED
Failed to read from a characteristic.
SERVICE_DISCOVERY_ERROR
Failed to discover characteristics required for commands.
SET_NOTIFY_FAILED
Failed to enable notification on the OTA control characteristic.
SYSTEM_ERROR
An error with the Android system occurred, such as a null characteristic or Gatt object in a callback.
WRITE_FAILED
Failed to write to a characteristic.

Method Summary

Modifier and Type Method and Description
static ErrorCode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
static ErrorCode[] 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

  • CONNECT_FAILED

    public static final ErrorCode CONNECT_FAILED
    Failed to connect to device.
  • SERVICE_DISCOVERY_ERROR

    public static final ErrorCode SERVICE_DISCOVERY_ERROR
    Failed to discover characteristics required for commands.
  • DISCONNECT_FAILED

    public static final ErrorCode DISCONNECT_FAILED
    Failed to disconnect from device.
  • WRITE_FAILED

    public static final ErrorCode WRITE_FAILED
    Failed to write to a characteristic.
  • READ_FAILED

    public static final ErrorCode READ_FAILED
    Failed to read from a characteristic.
  • SET_NOTIFY_FAILED

    public static final ErrorCode SET_NOTIFY_FAILED
    Failed to enable notification on the OTA control characteristic.
  • INTERNAL_ERROR

    public static final ErrorCode INTERNAL_ERROR
    An unexpected error occurred within the library.
  • CONNECTION_LOST

    public static final ErrorCode CONNECTION_LOST
    Connection was lost unexpectedly.
  • CONNECTION_RECONNECT

    public static final ErrorCode CONNECTION_RECONNECT
    Connection was re-established after being dropped (take any required corrective action).
  • DEVICE_ERROR

    public static final ErrorCode DEVICE_ERROR
    An error occurred at the device level such as not having required characteristics or failing to set notification on the TX characteristic.
  • NO_CONNECTION_FOUND

    public static final ErrorCode NO_CONNECTION_FOUND
    The connection context was not found when processing a command.
  • SYSTEM_ERROR

    public static final ErrorCode SYSTEM_ERROR
    An error with the Android system occurred, such as a null characteristic or Gatt object in a callback.
  • INCOMPLETE_RESPONSE

    public static final ErrorCode INCOMPLETE_RESPONSE
    An incomplete response was received from the device.
  • COMMAND_TIMEOUT

    public static final ErrorCode COMMAND_TIMEOUT
    Command failed to complete within the timeout.

Method Detail

  • values

    public static ErrorCode[] 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 (ErrorCode c : ErrorCode.values())
        System.out.println(c);
    
    Returns:
    an array containing the constants of this enum type, in the order they are declared
  • valueOf

    public static ErrorCode valueOf(java.lang.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:
    java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
    java.lang.NullPointerException - if the argument is null