View Source BlueHeron.ErrorCode (blue_heron v0.5.4)

Defines all error codes and functions to map between error code and name.

When a command fails, or an LMP, LL, or AMP message needs to indicate a failure, error codes are used to indicate the reason for the error. Error codes have a size of one octet.

Reference: Version 5.0, Vol 2, Part D, 1

Summary

Types

name()

@type name() ::
  :unknown_hci_command
  | :unknown_connection_id
  | :hardware_failure
  | :page_timeout
  | :auth_failure
  | :pin_or_key_missing
  | :memory_capacity_exceeded
  | :connection_timeout
  | :connection_limit_exceeded
  | :synchronous_connection_limit_to_a_device_exceeded
  | :connection_already_exists
  | :command_disallowed
  | :connection_rejected_due_to_limited_resources
  | :connection_rejected_due_to_security_reasons
  | :connection_rejected_due_to_unacceptable_bd_addr
  | :connection_accept_timeout_exceeded
  | :unsupported_feature_or_parameter_value
  | :invalid_hci_command_parameters
  | :remote_user_terminated_connection
  | :remote_device_terminated_connection_due_to_low_resources
  | :remote_device_terminated_connection_due_to_power_off
  | :connection_terminated_by_local_host
  | :repeated_attempts
  | :pairing_not_allowed
  | :unknown_lmp_pdu
  | :unsupported_remote_feature
  | :sco_offset_rejected
  | :sco_interval_rejected
  | :sco_air_mode_rejected
  | :invalid_lmp_parameters
  | :unspecified_error
  | :unsupported_lmp_parameter_value
  | :role_change_not_allowed
  | :lmp_response_timeout
  | :lmp_error_transaction_collision
  | :lmp_pdu_not_allowed
  | :encryption_mode_not_acceptable
  | :link_key_cannot_be_changed
  | :requested_qos_not_supported
  | :instant_passed
  | :pairing_with_unit_key_not_supported
  | :different_transaction_collision
  | :reserved
  | :qos_unacceptable_parameter
  | :qos_rejected
  | :channel_classification_not_supported
  | :insufficient_security
  | :parameter_out_of_mandatory_range
  | :reserved
  | :role_switch_pending
  | :reserved
  | :reserved_slot_violation
  | :role_switch_failed
  | :extended_inquiry_response_too_large
  | :secure_simple_pairing_not_supported
  | :host_busy_pairing
  | :connection_rejected_no_suitable_channel
  | :controller_busy
  | :unacceptable_connection_parameters
  | :advertising_timeout
  | :connection_terminated_due_to_mic_failure
  | :connection_failed_to_be_established
  | :mac_connection_failed
  | :course_clock_adjustment_rejected
  | :type0_submap_not_defined
  | :unknown_advertising_identifier
  | :limit_reached
  | :operation_cancelled_by_host
  | :packet_too_long

Functions

to_atom(code)

@spec to_atom(non_neg_integer()) :: {0..255, atom(), String.t()}

to_code(status)

@spec to_code(non_neg_integer() | atom()) :: non_neg_integer() | :error

to_code!(status)

@spec to_code!(non_neg_integer() | atom()) :: non_neg_integer()

to_string(atom)

@spec to_string(atom()) :: String.t() | :error