ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
esphome::canopen::ObjectDictionary Class Reference

#include <od.h>

Data Structures

struct  RecordSub
 

Public Member Functions

template<uint16_t VARS, uint16_t ARRAYS, uint16_t RECORDS, uint16_t RECORD_SUBS, uint16_t HANDLERS>
void set_table (OdTable< VARS, ARRAYS, RECORDS, RECORD_SUBS, HANDLERS > *table)
 
void add_var (uint16_t index, OD_attr_t attr, void *data, OD_size_t len)
 
void add_array (uint16_t index, OD_attr_t attr, uint8_t *count, void *data, OD_size_t elem_len, uint8_t n, OD_attr_t count_attr=ODA_SDO_R)
 
void add_record (uint16_t index, std::initializer_list< RecordSub > subs)
 
void add_record (uint16_t index, const RecordSub *subs, size_t count)
 
void add_string (uint16_t index, const char *str)
 
bool finalize ()
 
void dump_usage (const char *tag) const
 
bool finalized () const
 
OD_entry_t * find (uint16_t index)
 
OD_t * od ()
 
template<typename T >
void set_object (uint16_t index, T *handler)
 
OdResult write (uint16_t index, uint8_t sub, const void *data, size_t len)
 
OdResult read (uint16_t index, uint8_t sub, void *data, size_t max_len, size_t *len)
 
size_t value_size (uint16_t index, uint8_t sub)
 

Protected Member Functions

bool added_after_finalize_ (uint16_t index)
 
bool reserve_ (uint16_t &used, uint16_t needed, uint16_t capacity)
 
void add_entry_ (uint16_t index, uint8_t sub_count, uint8_t type, void *object)
 
OD_entry_t * entries_ () const
 
OD_obj_var_t * vars_ () const
 
OD_obj_array_t * arrays_ () const
 
OD_obj_record_t * record_subs_ () const
 
OD_extension_t * extensions_ () const
 
uint16_t * extension_index_ () const
 
void set_extension_ (uint16_t index, const OD_extension_t &extension)
 
bool attach_handlers_ ()
 
OdResult get_sub_ (uint16_t index, uint8_t sub, OD_IO_t *io)
 

Static Protected Member Functions

template<typename T >
static ODR_t read_trampoline (OD_stream_t *stream, void *buf, OD_size_t count, OD_size_t *count_read)
 
template<typename T >
static ODR_t write_trampoline (OD_stream_t *stream, const void *buf, OD_size_t count, OD_size_t *count_written)
 

Protected Attributes

uint8_t * table_ {nullptr}
 
OD_t od_ {0, nullptr}
 
uint16_t vars_cap_ {0}
 
uint16_t arrays_cap_ {0}
 
uint16_t records_cap_ {0}
 
uint16_t record_subs_cap_ {0}
 
uint16_t extensions_cap_ {0}
 
uint16_t vars_used_ {0}
 
uint16_t arrays_used_ {0}
 
uint16_t records_used_ {0}
 
uint16_t record_subs_used_ {0}
 
uint16_t extensions_used_ {0}
 
bool invalid_ {false}
 

Detailed Description

Definition at line 33 of file od.h.

Member Function Documentation

◆ add_array()

void esphome::canopen::ObjectDictionary::add_array ( uint16_t index,
OD_attr_t attr,
uint8_t * count,
void * data,
OD_size_t elem_len,
uint8_t n,
OD_attr_t count_attr = ODA_SDO_R )

Definition at line 39 of file od.cpp.

◆ add_entry_()

void esphome::canopen::ObjectDictionary::add_entry_ ( uint16_t index,
uint8_t sub_count,
uint8_t type,
void * object )
protected

Definition at line 75 of file od.cpp.

◆ add_record() [1/2]

void esphome::canopen::ObjectDictionary::add_record ( uint16_t index,
const RecordSub * subs,
size_t count )

Definition at line 49 of file od.cpp.

◆ add_record() [2/2]

void esphome::canopen::ObjectDictionary::add_record ( uint16_t index,
std::initializer_list< RecordSub > subs )
inline

Definition at line 58 of file od.h.

◆ add_string()

void esphome::canopen::ObjectDictionary::add_string ( uint16_t index,
const char * str )

Definition at line 64 of file od.cpp.

◆ add_var()

void esphome::canopen::ObjectDictionary::add_var ( uint16_t index,
OD_attr_t attr,
void * data,
OD_size_t len )

Definition at line 30 of file od.cpp.

◆ added_after_finalize_()

bool esphome::canopen::ObjectDictionary::added_after_finalize_ ( uint16_t index)
protected

Definition at line 14 of file od.cpp.

◆ arrays_()

OD_obj_array_t * esphome::canopen::ObjectDictionary::arrays_ ( ) const
inlineprotected

Definition at line 103 of file od.h.

◆ attach_handlers_()

bool esphome::canopen::ObjectDictionary::attach_handlers_ ( )
protected

Definition at line 19 of file od_handler.cpp.

◆ dump_usage()

void esphome::canopen::ObjectDictionary::dump_usage ( const char * tag) const

Definition at line 115 of file od.cpp.

◆ entries_()

OD_entry_t * esphome::canopen::ObjectDictionary::entries_ ( ) const
inlineprotected

Definition at line 98 of file od.h.

◆ extension_index_()

uint16_t * esphome::canopen::ObjectDictionary::extension_index_ ( ) const
inlineprotected

Definition at line 110 of file od.h.

◆ extensions_()

OD_extension_t * esphome::canopen::ObjectDictionary::extensions_ ( ) const
inlineprotected

Definition at line 107 of file od.h.

◆ finalize()

bool esphome::canopen::ObjectDictionary::finalize ( )

Definition at line 92 of file od.cpp.

◆ finalized()

bool esphome::canopen::ObjectDictionary::finalized ( ) const
inline

Definition at line 70 of file od.h.

◆ find()

OD_entry_t * esphome::canopen::ObjectDictionary::find ( uint16_t index)
inline

Definition at line 73 of file od.h.

◆ get_sub_()

OdResult esphome::canopen::ObjectDictionary::get_sub_ ( uint16_t index,
uint8_t sub,
OD_IO_t * io )
protected

Definition at line 38 of file od_handler.cpp.

◆ od()

OD_t * esphome::canopen::ObjectDictionary::od ( )
inline

Definition at line 74 of file od.h.

◆ read()

OdResult esphome::canopen::ObjectDictionary::read ( uint16_t index,
uint8_t sub,
void * data,
size_t max_len,
size_t * len )

Definition at line 44 of file od_handler.cpp.

◆ read_trampoline()

template<typename T >
static ODR_t esphome::canopen::ObjectDictionary::read_trampoline ( OD_stream_t * stream,
void * buf,
OD_size_t count,
OD_size_t * count_read )
inlinestaticprotected

Definition at line 123 of file od.h.

◆ record_subs_()

OD_obj_record_t * esphome::canopen::ObjectDictionary::record_subs_ ( ) const
inlineprotected

Definition at line 104 of file od.h.

◆ reserve_()

bool esphome::canopen::ObjectDictionary::reserve_ ( uint16_t & used,
uint16_t needed,
uint16_t capacity )
protected

Definition at line 21 of file od.cpp.

◆ set_extension_()

void esphome::canopen::ObjectDictionary::set_extension_ ( uint16_t index,
const OD_extension_t & extension )
protected

Definition at line 10 of file od_handler.cpp.

◆ set_object()

template<typename T >
void esphome::canopen::ObjectDictionary::set_object ( uint16_t index,
T * handler )
inline

Definition at line 78 of file od.h.

◆ set_table()

template<uint16_t VARS, uint16_t ARRAYS, uint16_t RECORDS, uint16_t RECORD_SUBS, uint16_t HANDLERS>
void esphome::canopen::ObjectDictionary::set_table ( OdTable< VARS, ARRAYS, RECORDS, RECORD_SUBS, HANDLERS > * table)
inline

Definition at line 44 of file od.h.

◆ value_size()

size_t esphome::canopen::ObjectDictionary::value_size ( uint16_t index,
uint8_t sub )

Definition at line 66 of file od_handler.cpp.

◆ vars_()

OD_obj_var_t * esphome::canopen::ObjectDictionary::vars_ ( ) const
inlineprotected

Definition at line 99 of file od.h.

◆ write()

OdResult esphome::canopen::ObjectDictionary::write ( uint16_t index,
uint8_t sub,
const void * data,
size_t len )

Definition at line 73 of file od_handler.cpp.

◆ write_trampoline()

template<typename T >
static ODR_t esphome::canopen::ObjectDictionary::write_trampoline ( OD_stream_t * stream,
const void * buf,
OD_size_t count,
OD_size_t * count_written )
inlinestaticprotected

Definition at line 130 of file od.h.

Field Documentation

◆ arrays_cap_

uint16_t esphome::canopen::ObjectDictionary::arrays_cap_ {0}
protected

Definition at line 142 of file od.h.

◆ arrays_used_

uint16_t esphome::canopen::ObjectDictionary::arrays_used_ {0}
protected

Definition at line 147 of file od.h.

◆ extensions_cap_

uint16_t esphome::canopen::ObjectDictionary::extensions_cap_ {0}
protected

Definition at line 145 of file od.h.

◆ extensions_used_

uint16_t esphome::canopen::ObjectDictionary::extensions_used_ {0}
protected

Definition at line 150 of file od.h.

◆ invalid_

bool esphome::canopen::ObjectDictionary::invalid_ {false}
protected

Definition at line 151 of file od.h.

◆ od_

OD_t esphome::canopen::ObjectDictionary::od_ {0, nullptr}
protected

Definition at line 140 of file od.h.

◆ record_subs_cap_

uint16_t esphome::canopen::ObjectDictionary::record_subs_cap_ {0}
protected

Definition at line 144 of file od.h.

◆ record_subs_used_

uint16_t esphome::canopen::ObjectDictionary::record_subs_used_ {0}
protected

Definition at line 149 of file od.h.

◆ records_cap_

uint16_t esphome::canopen::ObjectDictionary::records_cap_ {0}
protected

Definition at line 143 of file od.h.

◆ records_used_

uint16_t esphome::canopen::ObjectDictionary::records_used_ {0}
protected

Definition at line 148 of file od.h.

◆ table_

uint8_t* esphome::canopen::ObjectDictionary::table_ {nullptr}
protected

Definition at line 138 of file od.h.

◆ vars_cap_

uint16_t esphome::canopen::ObjectDictionary::vars_cap_ {0}
protected

Definition at line 141 of file od.h.

◆ vars_used_

uint16_t esphome::canopen::ObjectDictionary::vars_used_ {0}
protected

Definition at line 146 of file od.h.


The documentation for this class was generated from the following files: