BB.Error.Protocol.Feetech.HardwareAlert exception (bb_servo_feetech v0.2.3)

Copy Markdown View Source

Feetech servo hardware alert error.

Raised when a Feetech servo reports hardware error status flags. The alerts field contains a list of active alert atoms.

Alert Types

  • :voltage_error - Input voltage out of range
  • :sensor_error - Magnetic encoder malfunction
  • :temperature_error - Motor temperature too high
  • :current_error - Over current detected
  • :overload_error - Overload protection triggered

Note: Bit 4 in the status byte indicates torque state, not an error.

Summary

Functions

Creates a HardwareAlert from raw hardware error bits.

Types

alert()

@type alert() ::
  :voltage_error
  | :sensor_error
  | :temperature_error
  | :current_error
  | :overload_error

t()

@type t() :: %BB.Error.Protocol.Feetech.HardwareAlert{
  __exception__: true,
  alerts: [alert()],
  bread_crumbs: term(),
  class: term(),
  path: term(),
  raw_value: non_neg_integer(),
  servo_id: non_neg_integer(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Functions

exception(args)

@spec exception(opts :: Keyword.t()) :: %BB.Error.Protocol.Feetech.HardwareAlert{
  __exception__: true,
  alerts: term(),
  bread_crumbs: term(),
  class: term(),
  path: term(),
  raw_value: term(),
  servo_id: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Create an Elixir.BB.Error.Protocol.Feetech.HardwareAlert without raising it.

Keys

  • :servo_id
  • :alerts
  • :raw_value

from_bits(servo_id, bits)

@spec from_bits(non_neg_integer(), non_neg_integer()) :: t()

Creates a HardwareAlert from raw hardware error bits.

Bit 4 (torque enabled) is filtered out as it is not an error condition.