|
| | CANopenComponent (canbus::Canbus *canbus, uint8_t node_id) |
| |
| bool | is_client_only () const |
| |
| void | setup () override |
| |
| void | loop () override |
| |
| void | dump_config () override |
| |
| float | get_setup_priority () const override |
| |
| void | set_next_local (CANopenComponent *next) |
| |
| void | set_heartbeat_interval (uint16_t ms) |
| |
| void | set_start_operational (bool operational) |
| |
| void | set_response_timeout (uint16_t ms) |
| |
| NMTState | get_nmt_state () const |
| |
| template<typename F > |
| void | add_on_nmt_state_callback (F &&callback) |
| |
| NMTState | get_nmt_state () const |
| |
| bool | set_nmt_state (NMTState state) |
| |
| bool | transmit (uint16_t ident, const uint8_t *data, uint8_t len) |
| |
| bool | flush_held () const |
| |
| void | set_identity (uint32_t vendor_id, uint32_t product_code, uint32_t revision_number, uint32_t serial_number) |
| |
| void | set_device_name (const char *name) |
| |
| void | set_hardware_version (const char *version) |
| |
| void | set_software_version (const char *version) |
| |
| ObjectDictionary & | get_od () |
| |
| OdResult | write_od (uint16_t index, uint8_t sub, const void *data, size_t len) |
| |
| OdResult | read_od (uint16_t index, uint8_t sub, void *data, size_t max_len, size_t *len) |
| |
| template<typename F > |
| void | add_on_node_event_callback (F &&callback) |
| |
| | SLOT_LIST_REQUIRES (ESPHOME_CANOPEN_HEARTBEAT_CLIENTS) void monitor_node(uint8_t node_id |
| |
| NMTState | get_node_state (uint8_t node_id) |
| |
| bool | is_node_online (uint8_t node_id) |
| |
| NMTState | get_node_state (uint8_t) |
| |
| bool | is_node_online (uint8_t) |
| |
| template<typename F > |
| void | add_on_heartbeat_callback (F &&callback) |
| |
| template<typename F > |
| void | add_on_emcy_callback (F &&callback) |
| |
| void | add_frame_listener (FrameListener &listener) |
| |
| bool | send_frame (uint32_t can_id, const uint8_t *data, size_t len) |
| |
| bool | read_sdo (uint8_t node_id, uint16_t index, uint8_t sub, uint8_t expected_size, SDOCallback callback, void *context) |
| |
| template<typename T > |
| bool | read_sdo (uint8_t node_id, uint16_t index, uint8_t sub, SDOCallback callback, void *context) |
| |
| bool | write_sdo (uint8_t node_id, uint16_t index, uint8_t sub, uint32_t value, uint8_t size, SDOCallback callback=nullptr, void *context=nullptr) |
| |
| template<typename T > |
| bool | write_sdo (uint8_t node_id, uint16_t index, uint8_t sub, T value, SDOCallback callback=nullptr, void *context=nullptr) |
| |
| bool | read_sdo_data (uint8_t node_id, uint16_t index, uint8_t sub, uint8_t *data, size_t capacity, SDOCallback callback, void *context) |
| |
| bool | write_sdo_data (uint8_t node_id, uint16_t index, uint8_t sub, const uint8_t *data, size_t len, SDOCallback callback=nullptr, void *context=nullptr) |
| |
| void | cancel_sdo (void *context) |
| |
| bool | send_nmt (uint8_t node_id, NMTCommand command) |
| |
| bool | configure_tpdo (uint8_t n, uint32_t cob_id, std::initializer_list< PdoMapping > mappings, uint16_t event_timer_ms=0, uint16_t inhibit_time_100us=0, uint8_t transmission_type=254) |
| |
| bool | configure_rpdo (uint8_t n, uint32_t cob_id, std::initializer_list< PdoMapping > mappings, uint16_t event_timer_ms=0, uint8_t transmission_type=254) |
| |
| bool | request_tpdo (uint8_t n) |
| |
| bool | request_tpdo (uint16_t index, uint8_t sub) |
| |
| void | set_pdo_table (PdoParams *pdos, uint8_t rpdo_count, uint8_t tpdo_count) |
| |
| void | set_pdo_storage_key (uint32_t key) |
| |
| float | get_actual_setup_priority () const |
| |
| void | set_setup_priority (float priority) |
| |
| void | call () |
| |
| virtual void | on_shutdown () |
| |
| virtual void | on_safe_shutdown () |
| |
| virtual bool | teardown () |
| | Called during teardown to allow component to gracefully finish operations.
|
| |
| virtual void | on_powerdown () |
| | Called last before a reboot or deep sleep to power down hardware.
|
| |
| uint8_t | get_component_state () const |
| |
| void | reset_to_construction_state () |
| | Reset this component back to the construction state to allow setup to run again.
|
| |
| bool | is_in_loop_state () const |
| | Check if this component has completed setup and is in the loop state.
|
| |
| bool | is_idle () const |
| | Check if this component is idle.
|
| |
| void | mark_failed () |
| | Mark this component as failed.
|
| |
| void | mark_failed (const LogString *message) |
| |
| bool ESPHOME_ALWAYS_INLINE | setup_check (bool ok) |
| | Marks the component failed with message (default "Communication failed") unless ok; returns ok.
|
| |
| bool ESPHOME_ALWAYS_INLINE | setup_check (bool ok, const LogString *message) |
| |
| void | disable_loop () |
| | Disable this component's loop.
|
| |
| void | enable_loop () |
| | Enable this component's loop.
|
| |
| void | enable_loop_soon_any_context () |
| | Thread and ISR-safe version of enable_loop() that can be called from any context.
|
| |
| bool | is_failed () const |
| |
| bool | is_ready () const |
| |
| virtual bool | can_proceed () |
| |
| bool | status_has_warning () const |
| |
| bool | status_has_error () const |
| |
| void | status_set_warning () |
| |
| void | status_set_warning (const char *message) |
| |
| void | status_set_warning (const LogString *message) |
| |
| bool | status_comm_result (bool ok) |
| | Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok.
|
| |
| bool | status_comm_result (bool ok, const LogString *message) |
| |
| bool | status_comm_check (bool ok) |
| | Sets the warning ("Communication failed") when not ok but never clears it; returns ok.
|
| |
| void | status_set_error () |
| |
| void | status_set_error (const LogString *message) |
| |
| void | status_clear_warning () |
| |
| void | status_clear_error () |
| |
| | ESPDEPRECATED ("Use status_momentary_warning() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_warning(const char *name |
| |
| void | status_momentary_warning (uint32_t length=5000) |
| | Set warning status flag and clear it after length ms.
|
| |
| void | status_momentary_warning (const LogString *message, uint32_t length=5000) |
| |
| | ESPDEPRECATED ("Use status_momentary_error() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_error(const char *name |
| |
| void | status_momentary_error (uint32_t length=5000) |
| | Set error status flag and clear it after length ms.
|
| |
| void | status_momentary_error (const LogString *message, uint32_t length=5000) |
| |
| bool | has_overridden_loop () const |
| |
| const LogString * | get_component_log_str () const ESPHOME_ALWAYS_INLINE |
| | Get the integration where this component was declared as a LogString for logging.
|
| |
| bool | should_warn_of_blocking (uint32_t blocking_time, uint32_t &threshold_ms_out) |
| |
|
| void | on_frame_ (const canbus::CanFrame &frame) |
| |
| void | handle_frame_ (uint16_t ident, const uint8_t *data, uint8_t len) |
| |
| bool | receive_ (uint16_t ident, const uint8_t *data, uint8_t len) |
| | Returns whether a CANopenNode object took the frame.
|
| |
| void | queue_local_ (uint16_t ident, const uint8_t *data, uint8_t len) |
| |
| void | deliver_local_ () |
| |
| void | stage_bus_frame_ (uint16_t ident, const uint8_t *data, uint8_t len) |
| |
| bool | idle_ () const |
| |
| void | process_node_ () |
| |
| void | send_upload_block_ () |
| |
| bool | local_queues_busy_ () const |
| |
| void | apply_nmt_command_ () |
| |
| bool | nmt_command_pending_ () const |
| |
| void | fail_setup_ (const LogString *reason) |
| |
| void | set_device_info_defaults_ () |
| |
| void | add_device_info_od_ () |
| |
| void | config_device_info_ (CO_config_t &cfg) |
| |
| void | dump_device_info_config_ () |
| |
| void | node_event_ (uint8_t node_id, NodeEvent event, NMTState state) |
| |
| void | monitor_node_ (uint8_t node_id, uint16_t timeout_ms) |
| |
| void | add_node_monitor_od_ () |
| |
| void | config_node_monitor_ (CO_config_t &cfg) |
| |
| void | init_node_monitor_ () |
| |
| void | process_node_monitor_ (uint32_t dt_us) |
| |
| void | dump_node_monitor_config_ () |
| |
| void | dispatch_node_events_ () |
| |
| void | dispatch_frame_ (const CO_CANrxMsg_t &msg) |
| |
| void | check_frame_listener_ (uint16_t can_id, uint16_t mask) |
| |
| bool | sdo_idle_ () const |
| |
| void | add_sdo_client_od_ () |
| |
| void | config_sdo_client_ (CO_config_t &cfg) |
| |
| bool | init_sdo_client_ () |
| |
| bool | queue_sdo_ (const SDORequest &request) |
| |
| void | reject_queued_sdo_ () |
| |
| bool | sdo_stopped_ () const |
| |
| bool | sdo_is_local_ () const |
| |
| void | stop_sdo_ () |
| |
| bool | sdo_reply_is_stale_ (const uint8_t *data, uint8_t len) const |
| |
| void | process_sdo_ (uint32_t dt_us) |
| |
| bool | drain_upload_ (uint32_t dt_us, CO_SDO_return_t &ret, CO_SDO_abortCode_t &abort) |
| |
| CO_SDO_return_t | start_sdo_ () |
| |
| void | finish_sdo_ (SDOResult result, uint32_t abort_code) |
| |
| void | abort_sdo_ () |
| |
| void | process_sdo_abort_ (uint32_t dt_us) |
| |
| void | add_pdo_od_ () |
| |
| void | config_pdo_ (CO_config_t &cfg) |
| |
| bool | init_pdo_ () |
| |
| void | log_invalid_pdos_ () |
| |
| void | process_pdo_ (uint32_t dt_us) |
| |
| bool | configure_pdo_ (bool tpdo, uint8_t n, uint32_t cob_id, std::initializer_list< PdoMapping > mappings, uint16_t event_timer_ms, uint16_t inhibit_time_100us, uint8_t transmission_type) |
| |
| void | discard_pending_tpdos_ () |
| |
| size_t | pdo_count_ () const |
| |
| bool | has_pdos_ () const |
| |
| void | add_pdo_storage_od_ () |
| |
| bool | init_pdo_storage_ () |
| |
| void | load_pdos_ () |
| |
| bool | store_pdos_ () |
| |
| bool | restore_pdo_defaults_ () |
| |
| friend | void::setup () |
| |
| friend | void::original_setup () |
| |
| void | set_component_source_ (uint8_t index) |
| | Set where this component was loaded from for some debug messages.
|
| |
| virtual void | call_setup () |
| |
| void | call_dump_config_ () |
| |
| void | enable_loop_slow_path_ () |
| |
| void | set_component_state_ (uint8_t state) |
| | Helper to set component state (clears state bits and sets new state)
|
| |
| bool | set_status_flag_ (uint8_t flag) |
| | Helper to set a status LED flag on both this component and the app.
|
| |
| bool | set_error_flag_ (const LogString *message) |
| | Set the error flag and log it; true when it was not set before.
|
| |
| void | set_interval (const char *name, uint32_t interval, SchedulerCallback &&f) |
| | Set an interval function with a const char* name.
|
| |
| void | set_interval (uint32_t id, uint32_t interval, SchedulerCallback &&f) |
| | Set an interval function with a numeric ID (zero heap allocation).
|
| |
| void | set_interval (InternalSchedulerID id, uint32_t interval, SchedulerCallback &&f) |
| |
| void | set_interval (uint32_t interval, SchedulerCallback &&f) |
| |
| bool | cancel_interval (const char *name) |
| | Cancel an interval function.
|
| |
| bool | cancel_interval (uint32_t id) |
| |
| bool | cancel_interval (InternalSchedulerID id) |
| |
| void | set_timeout (const char *name, uint32_t timeout, SchedulerCallback &&f) |
| | Set a timeout function with a const char* name.
|
| |
| void | set_timeout (uint32_t id, uint32_t timeout, SchedulerCallback &&f) |
| | Set a timeout function with a numeric ID (zero heap allocation).
|
| |
| void | set_timeout (InternalSchedulerID id, uint32_t timeout, SchedulerCallback &&f) |
| |
| void | set_timeout (uint32_t timeout, SchedulerCallback &&f) |
| |
| bool | cancel_timeout (const char *name) |
| | Cancel a timeout function.
|
| |
| bool | cancel_timeout (uint32_t id) |
| |
| bool | cancel_timeout (InternalSchedulerID id) |
| |
| void | defer (const char *name, SchedulerCallback &&f) |
| | Defer a callback to the next loop() call with a const char* name.
|
| |
| void | defer (SchedulerCallback &&f) |
| | Defer a callback to the next loop() call.
|
| |
| void | defer (uint32_t id, SchedulerCallback &&f) |
| | Defer a callback with a numeric ID (zero heap allocation)
|
| |
| bool | cancel_defer (const char *name) |
| | Cancel a defer callback using the specified name, name must not be empty.
|
| |
| bool | cancel_defer (uint32_t id) |
| |
| void | status_clear_warning_slow_path_ () |
| |
| void | status_comm_check_slow_path_ () |
| |
| void | status_clear_error_slow_path_ () |
| |
|
| canbus::Canbus * | canbus_ |
| |
| CO_t * | co_ {nullptr} |
| |
| CO_config_t | config_ {} |
| |
| ObjectDictionary | od_ |
| |
| uint16_t | response_timeout_ms_ {500} |
| |
| uint8_t | node_id_ |
| |
| bool | hold_flush_ {false} |
| |
| CANopenComponent * | next_local_ {nullptr} |
| |
| FixedRingBuffer< LocalFrame, LOCAL_QUEUE_SIZE > | local_queue_ |
| |
| uint16_t | local_dropped_ {0} |
| |
| bool | bus_frame_staged_ {false} |
| |
| LazyCallbackManager< void(NMTState)> | nmt_state_callback_ |
| |
| uint32_t | cob_emcy_ {0x80} |
| |
| uint32_t | last_us_ {0} |
| |
| uint32_t | reset_deadline_ms_ {0} |
| |
| uint32_t | dev_type_ {0} |
| |
| const char * | device_name_ {nullptr} |
| |
| const char * | hardware_version_ {nullptr} |
| |
| const char * | software_version_ {nullptr} |
| |
| std::array< uint32_t, 4 > | identity_ {} |
| |
| uint32_t | sdo_srv_cob_rx_ {0} |
| |
| uint32_t | sdo_srv_cob_tx_ {0} |
| |
| uint16_t | hb_producer_ms_ {5000} |
| |
| uint8_t | err_reg_ {0} |
| |
| uint8_t | identity_highest_sub_ {4} |
| |
| uint8_t | sdo_srv_highest_sub_ {2} |
| |
| NMTState | nmt_state_ {NMTState::NMT_STATE_UNKNOWN} |
| |
| bool | start_operational_ {true} |
| |
| bool | reset_pending_ {false} |
| |
| bool | processing_ {false} |
| |
| bool | nmt_sending_ {false} |
| |
| uint8_t | hb_cons_count_ {0} |
| |
| LazyCallbackManager< void(uint8_t, NodeEvent, NMTState)> | node_event_callback_ |
| |
| StaticVector< PendingNodeEvent, 2 *ESPHOME_CANOPEN_HEARTBEAT_CLIENTS > | pending_node_events_ |
| |
| SlotList< uint32_t, ESPHOME_CANOPEN_HEARTBEAT_CLIENTS > | hb_cons_ |
| |
| FrameListener * | frame_listeners_ {nullptr} |
| |
| CallbackManager< void(uint8_t, NMTState)> | heartbeat_callback_ |
| |
| CallbackManager< void(uint8_t, const Emergency &)> | emcy_callback_ |
| |
| StaticRingBuffer< SDORequest, SDO_QUEUE_SIZE > | sdo_queue_ |
| |
| SDORequest | sdo_active_ {} |
| |
| size_t | sdo_len_ {0} |
| |
| uint32_t | sdo_last_ms_ {0} |
| |
| uint32_t | sdo_abort_guard_us_ {0} |
| |
| uint32_t | sdo_cli_cob_tx_ {0x80000000} |
| |
| uint32_t | sdo_cli_cob_rx_ {0x80000000} |
| |
| std::array< uint8_t, 4 > | sdo_rx_value_ {} |
| |
| uint8_t | sdo_cli_highest_sub_ {3} |
| |
| uint8_t | sdo_cli_node_ {0} |
| |
| bool | sdo_busy_ {false} |
| |
| bool | sdo_abort_pending_ {false} |
| |
| bool | sdo_cancel_pending_ {false} |
| |
| PdoParams * | pdos_ {nullptr} |
| |
| uint8_t | rpdo_count_ {0} |
| |
| uint8_t | tpdo_count_ {0} |
| |
| bool | pdo_not_reserved_ {false} |
| |
| CO_storage_t | storage_ {} |
| |
| CO_storage_entry_t | storage_entry_ {} |
| |
| ESPPreferenceObject | pdo_pref_ |
| |
| ESPPreferenceObject | pdo_valid_pref_ |
| |
| uint32_t | pdo_fingerprint_ {0} |
| |
| uint8_t | component_source_index_ {0} |
| | Index into component source PROGMEM lookup table (0 = not set)
|
| |
| uint8_t | warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_CS} |
| | Warn threshold in centiseconds (max 2550ms)
|
| |
| uint8_t | component_state_ {0x00} |
| | State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED, 0x04=LOOP_DONE) Bit 3: STATUS_LED_WARNING Bit 4: STATUS_LED_ERROR Bit 5: Has overridden loop() (set at registration time) Bits 6-7: Unused - reserved for future expansion.
|
| |
| volatile bool | pending_enable_loop_ {false} |
| | ISR-safe flag for enable_loop_soon_any_context.
|
| |
| ComponentRuntimeStats | runtime_stats_ |
| |
Definition at line 62 of file canopen.h.