:py:mod:`phoenix6.status_code`
==============================

.. py:module:: phoenix6.status_code

Module Contents
---------------


.. py:class:: StatusCode(*args, **kwds)


   Bases: :py:obj:`enum.Enum`

   Status codes reported by APIs, including OK,
   warnings, and errors.

   .. py:property:: name
      :type: str

      Gets the name of this StatusCode.

      :returns: Name of this StatusCode
      :rtype: str


   .. py:property:: description
      :type: str

      Gets the description of this StatusCode.

      :returns: Description of this StatusCode
      :rtype: str


   .. py:attribute:: OK
      :value: 0

      No Error


   .. py:attribute:: TASK_IS_BUSY

      Diagnostic Server is busy with another command.


   .. py:attribute:: INVALID_DEVICE_SPEC

      InvalidDeviceSpec


   .. py:attribute:: ECU_IS_NOT_PRESENT

      Device is not present. Verify the device is connected and powered, and that the
      CAN bus is terminated.


   .. py:attribute:: COULD_NOT_ENTER_BL

      Could not put the device into bootloader mode.


   .. py:attribute:: COULD_NOT_CONFIRM_BL

      Could not confirm the device has entered the bootloader.


   .. py:attribute:: COULD_NOT_ERASE

      Could not erase flash.


   .. py:attribute:: COULD_NOT_SEND_FLASH

      Could not field upgrade the device.


   .. py:attribute:: COULD_NOT_VALIDATE

      Bootloader could not verify integrity of the flashed application.


   .. py:attribute:: COULD_NOT_RUN_APP

      Could not run the device firmware application.


   .. py:attribute:: COULD_NOT_REQ_SET_ID

      Unable to set ID to this device.


   .. py:attribute:: COULD_NOT_CONFIRM_ID

      Could not verify that the changed ID took effect.


   .. py:attribute:: FLASH_WAS_GOOD

      Device field upgrade was successful.


   .. py:attribute:: APP_TOO_OLD

      Device firmware application is too old.


   .. py:attribute:: COULD_NOT_REQ_SET_DESC

      Unable to set name to this device.


   .. py:attribute:: COMPILE_SZ_IS_WRONG

      CompileSzIsWrong


   .. py:attribute:: GADGETEER_DEVICE_NO_SET_ID

      Cannot set the ID of a gadgeteer device.


   .. py:attribute:: INVALID_TASK

      This diagnostic action is not supported.


   .. py:attribute:: NOT_IMPLEMENTED

      Not Implemented, check latest installer.


   .. py:attribute:: NO_DEVICES_ON_BUS

      NoDevicesOnBus


   .. py:attribute:: MORE_THAN_ONE_FILE

      MoreThanOneFile


   .. py:attribute:: NODE_IS_INVALID

      Specified device was not found. Verify the device is connected and powered, and
      that the CAN bus is terminated.


   .. py:attribute:: INVALID_DEVICE_DESCRIPTOR

      InvalidDeviceDescriptor


   .. py:attribute:: COULD_NOT_SEND_CAN_FRAME

      CouldNotSendCanFrame


   .. py:attribute:: NORMAL_MODE_MSG_NOT_PRESENT

      NormalModeMsgNotPresent


   .. py:attribute:: FEATURE_NOT_SUPPORTED

      This feature is not supported.


   .. py:attribute:: NOT_UPDATING

      The diagnostic server is not field upgrading any devices.


   .. py:attribute:: CORRUPTED_POST

      CorruptedPOST


   .. py:attribute:: NO_CONFIGS

      This device did not report any available configs. Verify firmware and
      diagnostics are up-to-date.


   .. py:attribute:: CONFIG_FAILED

      ConfigFailed


   .. py:attribute:: COULD_NOT_REQ_FACTORY_DEFAULT

      Unable to factory default this device.


   .. py:attribute:: CUSTOM_NAME_NOT_SUPPORTED

      CustomNameNotSupported


   .. py:attribute:: CONFIG_READ_WRITE_MISMATCH

      The configs read from the device do not match the configs that were written.


   .. py:attribute:: COULD_NOT_REQ_SET_CONFIGS

      Could not apply the device configs.


   .. py:attribute:: INSUFFICIENT_SZ

      InsufficientSz


   .. py:attribute:: INVALID_MODEL

      This feature is not supported for this device model.


   .. py:attribute:: COULD_NOT_REQ_DEV_INFO

      CouldNotReqDevInfo


   .. py:attribute:: NO_CONTROLS

      This device does not support new controls.


   .. py:attribute:: DEVICE_IS_NULL

      DeviceIsNull


   .. py:attribute:: DEVICE_DID_NOT_RESPOND_TO_DIAG_REQ

      DeviceDidNotRespondToDiagReq


   .. py:attribute:: ONLY_SUPPORTED_IN_TUNER_X

      This feature requires Tuner X.


   .. py:attribute:: CANIV_CLI_ERROR

      Command-line issue with caniv.


   .. py:attribute:: INVALID_CRF_BAD_HEADER

      InvalidCrfBadHeader


   .. py:attribute:: INVALID_CRF_FILE_SZ_INVALD

      InvalidCrfFileSzInvald


   .. py:attribute:: INVALID_CRF_WRONG_PRODUCT

      Specified CRF is for the wrong product.


   .. py:attribute:: INVALID_CRF_NO_SECTS

      InvalidCrfNoSects


   .. py:attribute:: INVALID_CRF_BAD_SECT_HEADER

      InvalidCrfBadSectHeader


   .. py:attribute:: INVALID_CRF_BAD_SECT_SIZE

      InvalidCrfBadSectSize


   .. py:attribute:: NO_CRF_FILE

      Specified CRF file could not be found.


   .. py:attribute:: COULD_NOT_FIND_DYNAMIC_ID

      CouldNotFindDynamicId


   .. py:attribute:: DID_NOT_GET_DHCP

      DidNotGetDhcp


   .. py:attribute:: DID_NOT_GET_FULL_DHCP

      DidNotGetFullDhcp


   .. py:attribute:: INVALID_LICENSE_RESP

      InvalidLicenseResp


   .. py:attribute:: INVALID_CANIV_CACHE

      InvalidCanivCache


   .. py:attribute:: CANNOT_OPEN_SERIAL_PORT

      CannotOpenSerialPort


   .. py:attribute:: CANNOT_WRITE_SERIAL_PORT

      CannotWriteSerialPort


   .. py:attribute:: CANNOT_READ_SERIAL_PORT

      CannotReadSerialPort


   .. py:attribute:: CANNOT_SERIAL_TO_DEVICE

      CannotSerialToDevice


   .. py:attribute:: NO_SERIAL_CONTROL_FRAME_RESP

      NoSerialControlFrameResp


   .. py:attribute:: CANNOT_OPEN_UDP_PORT

      CannotOpenUdpPort


   .. py:attribute:: CANNOT_WRITE_UDP_PORT

      CannotWriteUdpPort


   .. py:attribute:: CANNOT_READ_UDP_PORT

      CannotReadUdpPort


   .. py:attribute:: CANNOT_UDP_TO_DEVICE

      CannotUdpToDevice


   .. py:attribute:: NO_UDP_CONTROL_FRAME_RESP

      NoUdpControlFrameResp


   .. py:attribute:: TIMEOUT_ISO15_RESPONSE

      TimeoutIso15Response


   .. py:attribute:: INVALID_JSON

      InvalidJson


   .. py:attribute:: APP_IS_TERMINATING

      The user application is shutting down.


   .. py:attribute:: CAN_MESSAGE_STALE
      :value: 1000

      CAN message is stale, data is valid but old. Check the CAN bus wiring, CAN bus
      utilization, and power to the device.


   .. py:attribute:: BUFFER_FULL
      :value: 1006

      Buffer is full, cannot insert more data.


   .. py:attribute:: PULSE_WIDTH_SENSOR_NOT_PRESENT
      :value: 1010

      PulseWidthSensorNotPresent


   .. py:attribute:: GENERAL_WARNING
      :value: 1100

      General Warning Occurred.


   .. py:attribute:: FIRM_VERSION_COULD_NOT_BE_RETRIEVED
      :value: 1103

      Firm Vers could not be retrieved. Use Phoenix Tuner X to check ID and
      firmware(CRF) version.


   .. py:attribute:: FEATURES_NOT_AVAILABLE_YET
      :value: 1104

      This feature will be supported in a future update.


   .. py:attribute:: CONTROL_MODE_NOT_VALID
      :value: 1105

      The control mode is not valid for this function.


   .. py:attribute:: CONTROL_MODE_NOT_SUPPORTED_YET
      :value: 1106

      This control mode is not supported yet.  A future release will supported this
      soon.


   .. py:attribute:: MOT_PROF_FIRM_THRESHOLD
      :value: 1109

      Motor Controller must have >= 3.2 firmware for motion profile control mode.


   .. py:attribute:: MOT_PROF_FIRM_THRESHOLD2
      :value: 1110

      Motor Controller must have >= 3.4 firmware for advanced PID0/PID1 features.


   .. py:attribute:: SIM_DEVICE_NOT_FOUND
      :value: 1200

      SimDeviceNotFound


   .. py:attribute:: SIM_PHYSICS_TYPE_NOT_SUPPORTED
      :value: 1201

      SimPhysicsTypeNotSupported


   .. py:attribute:: SIM_DEVICE_ALREADY_EXISTS
      :value: 1202

      SimDeviceAlreadyExists


   .. py:attribute:: TX_FAILED

      Could not transmit CAN Frame.


   .. py:attribute:: INVALID_PARAM_VALUE

      An invalid argument was passed into the function/VI, such as a null pointer.


   .. py:attribute:: RX_TIMEOUT

      CAN frame not received/too-stale. Check the CAN bus wiring, CAN bus utilization,
      and power to the device.


   .. py:attribute:: TX_TIMEOUT

      CAN Transmit timed out.


   .. py:attribute:: UNEXPECTED_ARB_ID

      ArbID is incorrect.


   .. py:attribute:: CAN_OVERFLOWED

      CanOverflowed


   .. py:attribute:: SENSOR_NOT_PRESENT

      Sensor Not Present.


   .. py:attribute:: FIRMWARE_TOO_OLD

      Firmware Too Old.  Use Phoenix Tuner X to field upgrade your CTRE CAN device
      firmware(CRF).  Then restart your robot application to clear this error.


   .. py:attribute:: COULD_NOT_CHANGE_PERIOD

      Control Frame Period could not be changed.  Most likely it is not being
      transmitted.


   .. py:attribute:: BUFFER_FAILURE

      BufferFailure


   .. py:attribute:: FIRMWARE_NON_FRC

      Firmware is legacy non-FRC version.  Use Phoenix Tuner X to field upgrade your
      CTRE CAN device firmware(CRF).  Firmware greater than 20.0 required.


   .. py:attribute:: GENERAL_ERROR

      General Error Occurred.


   .. py:attribute:: SIG_NOT_UPDATED

      No new response to update signal.


   .. py:attribute:: NOT_ALL_PID_VALUES_UPDATED

      NotAllPIDValuesUpdated


   .. py:attribute:: GEN_PORT_ERROR

      GEN_PORT_ERROR


   .. py:attribute:: PORT_MODULE_TYPE_MISMATCH

      PORT_MODULE_TYPE_MISMATCH


   .. py:attribute:: GEN_MODULE_ERROR

      GEN_MODULE_ERROR


   .. py:attribute:: MODULE_NOT_INIT_SET_ERROR

      MODULE_NOT_INIT_SET_ERROR


   .. py:attribute:: MODULE_NOT_INIT_GET_ERROR

      MODULE_NOT_INIT_GET_ERROR


   .. py:attribute:: WHEEL_RADIUS_TOO_SMALL

      Wheel Radius is too small, cannot get distance traveled.


   .. py:attribute:: TICKS_PER_REV_ZERO

      Ticks per revolution is 0, cannot get heading.


   .. py:attribute:: DISTANCE_BETWEEN_WHEELS_TOO_SMALL

      Distance between wheels is too small, cannot get heading.


   .. py:attribute:: GAINS_ARE_NOT_SET

      GainsAreNotSet


   .. py:attribute:: WRONG_REMOTE_LIMIT_SWITCH_SOURCE

      Use RemoteLimitSwitchSource instead of LimitSwitchSource.


   .. py:attribute:: DOUBLE_VOLTAGE_COMPENSATING_WPI

      Motor Controller Voltage Compensation should not be used with setVoltage(). 
      This causes compensation to happen twice.  Disable Voltage Compensation by
      calling enableVoltageCompensation(false) in order to use setVoltage().


   .. py:attribute:: CANDLE_ANIM_SLOT_OUT_OF_BOUNDS

      CANdleAnimSlotOutOfBounds


   .. py:attribute:: INCOMPATIBLE_MODE

      IncompatibleMode


   .. py:attribute:: INVALID_HANDLE

      Handle passed into function is incorrect.


   .. py:attribute:: FEATURE_REQUIRES_HIGHER_FIRM

      Features requires newer firmware version.


   .. py:attribute:: CONFIG_FACTORY_DEFAULT_REQUIRES_HIGHER_FIRM

      Config factory default features require firmware >=3.10.


   .. py:attribute:: CONFIG_MOTION_S_CURVE_REQUIRES_HIGHER_FIRM

      Config Motion S Curve Strength features require firmware >=4.16.


   .. py:attribute:: TALON_FX_FIRMWARE_PRE_V_BAT_DETECT

      Talon FX(Falcon 500) Firmware Too Old.  Use Phoenix Tuner to field upgrade your
      CTRE CAN device firmware(CRF) to >=20.3. Then restart your robot application to
      clear this error.


   .. py:attribute:: CANDLE_ANIMATIONS_REQUIRE_HIGHER_FIRM

      CANdleAnimationsRequireHigherFirm


   .. py:attribute:: LIBRARY_COULD_NOT_BE_LOADED

      LibraryCouldNotBeLoaded


   .. py:attribute:: MISSING_ROUTINE_IN_LIBRARY

      MissingRoutineInLibrary


   .. py:attribute:: RESOURCE_NOT_AVAILABLE

      ResourceNotAvailable


   .. py:attribute:: MUSIC_FILE_NOT_FOUND

      Could not find music file specified, try specifying an absolute path.


   .. py:attribute:: MUSIC_FILE_WRONG_SIZE

      Music file size is incorrect, could not parse correctly. Ensure you're using
      Tuner to generate file.


   .. py:attribute:: MUSIC_FILE_TOO_NEW

      Music file version is too new, update Phoenix to utilize this file.


   .. py:attribute:: MUSIC_FILE_INVALID

      Music file is invalid. Ensure you're using Tuner to generate file.


   .. py:attribute:: INVALID_ORCHESTRA_ACTION

      An invalid orchestra action occurred. Ensure a music file is loaded.


   .. py:attribute:: MUSIC_FILE_TOO_OLD

      This music file version is too old. Regenerate file using Tuner.


   .. py:attribute:: MUSIC_INTERRUPTED

      Music interrupted due to one of the instruments being commanded a different
      control mode. Press Play to resume music.


   .. py:attribute:: MUSIC_NOT_SUPPORTED

      This device doesn't support MusicTone control mode.


   .. py:attribute:: INVALID_INTERFACE

      kInvalidInterface


   .. py:attribute:: INVALID_GUID

      kInvalidGuid


   .. py:attribute:: INVALID_CLASS

      kInvalidClass


   .. py:attribute:: INVALID_PROTOCOL

      kInvalidProtocol


   .. py:attribute:: INVALID_PATH

      kInvalidPath


   .. py:attribute:: GENERAL_WIN_USB_ERROR

      kGeneralWinUsbError


   .. py:attribute:: FAILED_SETUP

      kFailedSetup


   .. py:attribute:: LISTEN_FAILED

      kListenFailed


   .. py:attribute:: SEND_FAILED

      kSendFailed


   .. py:attribute:: RECEIVE_FAILED

      kReceiveFailed


   .. py:attribute:: INVALID_RESP_FORMAT

      kInvalidRespFormat


   .. py:attribute:: WIN_USB_INIT_FAILED

      kWinUsbInitFailed


   .. py:attribute:: WIN_USB_QUERY_FAILED

      kWinUsbQueryFailed


   .. py:attribute:: WIN_USB_GENERAL_ERROR

      kWinUsbGeneralError


   .. py:attribute:: ACCESS_DENIED

      kAccessDenied


   .. py:attribute:: FIRMWARE_INVALID_RESPONSE

      kFirmwareInvalidResponse


   .. py:attribute:: STATUS_CODE_NOT_INITIALIZED

      This StatusCode has not been initialized. Make sure the StatusCode is getting
      assigned to the return of a method.


   .. py:attribute:: WARNING_NOT_INITIALIZED
      :value: 10000

      WarningNotInitialized


   .. py:attribute:: HW_TIMESTAMP_OUT_OF_SYNC
      :value: 10001

      The timestamp reported by CANivore is at least 10ms older than the timestamp
      reported by the system, indicating it's fallen out of sync. This does not impact
      the data of this message, only the timing.


   .. py:attribute:: FREQUENT_CONFIG_CALLS
      :value: 10002

      Do not apply or refresh configs periodically, as configs are blocking.


   .. py:attribute:: INVALID_NETWORK

      InvalidNetwork


   .. py:attribute:: MULTI_SIGNAL_NOT_SUPPORTED

      The CAN bus does not support multi-signal synchronization.


   .. py:attribute:: COULD_NOT_CAST

      Could not cast from base value to this particular signal's type


   .. py:attribute:: NOT_FOUND

      Could not find this value when searching for it


   .. py:attribute:: NOT_SUPPORTED

      This is not supported


   .. py:attribute:: MISSING_CONTEXT

      Could not determine context from this device hash


   .. py:attribute:: MODEL_MISMATCH

      Model name in license file does not match model name of selected device.


   .. py:attribute:: SERIAL_MISMATCH

      Serial Number in license file does not match model name of selected device.


   .. py:attribute:: NO_FILE

      Could not find specified file.


   .. py:attribute:: LICENSE_DOWNLOAD_FAILED

      License did not successfully download to Device.


   .. py:attribute:: SELF_TEST_IS_EMPTY

      Self Test report does not have any values, is the firmware up to date?


   .. py:attribute:: SIGNAL_LOOKUP_FAILED

      Failed to lookup signal properties.  This can happen if the fimware is too new
      and supports signals that older APIs do not support.


   .. py:attribute:: INVALID_MODE_TO_GET_SIGNAL

      The current mode of the device is invalid for getting this signal.


   .. py:attribute:: UNLICENSED_DEVICE

      Device is not licensed. Cannot get any data from it.


   .. py:attribute:: INVALID_SIZE

      Size is invalid.


   .. py:attribute:: INVALID_LICENSE_RESPONSE

      InvalidLicenseResponse


   .. py:attribute:: INVALID_CONTEXT

      InvalidContext


   .. py:attribute:: INTERNAL_ERROR

      InternalError


   .. py:attribute:: DEVICE_RESPONSE_INCORRECT

      kDeviceResponseIncorrect


   .. py:attribute:: ERROR_POLLING_FOR_DEVICES

      kErrorPollingForDevices


   .. py:attribute:: COULD_NOT_RETRIEVE_V6_FIRMWARE

      Device firmware could not be retrieved. Check that the device is running v6
      firmware, the device ID is correct, the specified CAN bus is correct, and the
      device is powered.


   .. py:attribute:: COULD_NOT_DECODE_DEVICE_FIRMWARE

      Device firmware could not be decoded. Check that the device is running v6
      firmware, the device ID is correct, the specified CAN bus is correct, and the
      device is powered.


   .. py:attribute:: INVALID_ID_TO_FOLLOW

      The values specified for master are in valid.  Make sure the Device ID of master
      are correct.


   .. py:attribute:: USING_PRO_FEATURE_ON_UNLICENSED_DEVICE

      Using a Pro only feature on an unlicensed device. The device may not behave as
      expected if it continues to operate while unlicensed.


   .. py:attribute:: FIRMWARE_TOO_NEW

      Firmware Too New.  Use Phoenix Tuner X to field upgrade your CTRE CAN device
      firmware(CRF) to a compatible version.  Then restart your robot application to
      clear this error.


   .. py:attribute:: COULD_NOT_SERIALIZE

      The data frame could not be serialized for transmit.


   .. py:attribute:: MECHANISM_FAULTED

      The mechanism is disabled due to a fault in one of the devices.


   .. py:attribute:: FIRMWARE_VERS_NOT_COMPATIBLE

      Firmware version is not compatible with this version of Phoenix. Make sure your
      firmware and API major versions match.


   .. py:attribute:: DIRECTORY_MISSING

      Could not find specified directory.


   .. py:attribute:: API_TOO_OLD

      This API version is too old for the firmware on the device. Either upgrade the
      API to a newer version or downgrade the device firmware to an older version for
      correct behavior.


   .. py:attribute:: LOGGER_NOT_RUNNING

      The signal logger is not running. Start the signal logger before writing any
      signals.


   .. py:attribute:: TIMEOUT_CANNOT_BE_ZERO

      Blocking operations, such as configs, cannot have a timeout of 0. Pass in a
      non-zero timeout (typically 0.050+ seconds) for normal operation.


   .. py:attribute:: CANNOT_LICENSE_WHILE_ENABLED

      Device cannot be licensed while it is control enabled. Disable and neutral the
      device to apply the licenses.


   .. py:attribute:: INVALID_FILE

      Could not open or read the given file.


   .. py:attribute:: HOOT_LOG_TOO_OLD

      The given hoot log requires an older version of Phoenix API.


   .. py:attribute:: HOOT_LOG_TOO_NEW

      The given hoot log requires a newer version of Phoenix API.


   .. py:attribute:: UNLICENSED_HOOT_LOG

      Hoot log is not licensed. Cannot get any data from it.


   .. py:attribute:: CANNOT_STEP_WHILE_UNPAUSED

      The simulation timing cannot be advanced by a time step while unpaused. Pause
      the simulator before advancing time.


   .. py:attribute:: MULTIPLE_REPLAY_NOT_SUPPORTED

      Hoot replay does not support replaying multiple files. Ensure that only one file
      is loaded at a time.


   .. py:attribute:: USER_SIGNAL_LIMIT_EXCEEDED

      The maximum number of loggable user signals has been exceeded. Additional user
      signals will not be logged.


   .. py:attribute:: INVALID_DEVICE_MODEL

      The provided model was not a valid device type.


   .. py:attribute:: SIGNAL_NOT_SUPPORTED_OR_MISSING

      The requested signal is missing or not supported. Verify that the device
      firmware is up-to-date.


   .. py:method:: is_error() -> bool

      Gets whether this code is an error.

      :returns: True if this code is an error
      :rtype: bool


   .. py:method:: is_warning() -> bool

      Gets whether this code is a warning.

      :returns: True if this code is a warning
      :rtype: bool


   .. py:method:: is_ok() -> bool

      Gets whether this code is OK.

      :returns: True if this code is OK
      :rtype: bool