KaCanOpen
 All Classes Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
kaco::EDSLibrary Class Reference

This class provides access to KaCanOpen's EDS library. It manages device specific as well as generic CanOpen dictionaries. More...

#include <eds_library.h>

Public Member Functions

 EDSLibrary (std::unordered_map< Address, Entry > &dictionary, std::unordered_map< std::string, Address > &name_to_address)
 Constructor. More...
 
bool lookup_library (std::string path="")
 Finds EDS library on disk. More...
 
bool load_mandatory_entries ()
 Loads mandatory dictionary entries defined in CiA 301 standard. More...
 
bool load_default_eds (uint16_t device_profile_number)
 Loads entries defined in generic CiA profile EDS files. More...
 
bool load_manufacturer_eds_deprecated (uint32_t vendor_id, uint32_t product_code, uint32_t revision_number)
 Loads entries defined in device specific EDS files proviced by manufacturers. More...
 
bool load_manufacturer_eds (Device &device)
 Loads entries defined in device specific EDS files proviced by manufacturers. More...
 
bool ready () const
 Checks if lookup_library() was successful. More...
 
void reset_dictionary ()
 Resets the dictionary and the name-address mapping.
 
std::string get_most_recent_eds_file_path () const
 Returns the path to the most recently loaded EDS file.
 

Detailed Description

This class provides access to KaCanOpen's EDS library. It manages device specific as well as generic CanOpen dictionaries.

Examples:
examples/test/eds_library.cpp.

Definition at line 46 of file eds_library.h.

Constructor & Destructor Documentation

kaco::EDSLibrary::EDSLibrary ( std::unordered_map< Address, Entry > &  dictionary,
std::unordered_map< std::string, Address > &  name_to_address 
)

Constructor.

Parameters
dictionaryThe dictionary, into which entries will be inserted.
name_to_addressMapping from name to address in dictionary (to be created).

Definition at line 57 of file eds_library.cpp.

Member Function Documentation

bool kaco::EDSLibrary::load_default_eds ( uint16_t  device_profile_number)

Loads entries defined in generic CiA profile EDS files.

Parameters
device_profile_numberCiA standard profile number
Returns
true if successful

Definition at line 100 of file eds_library.cpp.

bool kaco::EDSLibrary::load_mandatory_entries ( )

Loads mandatory dictionary entries defined in CiA 301 standard.

Returns
true if successful

Definition at line 96 of file eds_library.cpp.

bool kaco::EDSLibrary::load_manufacturer_eds ( Device device)

Loads entries defined in device specific EDS files proviced by manufacturers.

Parameters
deviceReference to the device (needed to fetch some information from the device)
Returns
true if successful

Definition at line 136 of file eds_library.cpp.

bool kaco::EDSLibrary::load_manufacturer_eds_deprecated ( uint32_t  vendor_id,
uint32_t  product_code,
uint32_t  revision_number 
)

Loads entries defined in device specific EDS files proviced by manufacturers.

Parameters
vendor_idVencor ID from identity object in dictionary (one of the mandatory entries)
product_codeProduct code from identity object in dictionary (one of the mandatory entries)
revision_numberRevision number from identity object in dictionary (one of the mandatory entries)
Returns
true if successful
Todo:
Remove this!

Definition at line 229 of file eds_library.cpp.

bool kaco::EDSLibrary::lookup_library ( std::string  path = "")

Finds EDS library on disk.

Parameters
pathoptional custom path to EDS library
Returns
true if successful

Definition at line 61 of file eds_library.cpp.

bool kaco::EDSLibrary::ready ( ) const

Checks if lookup_library() was successful.

Returns
true if ready

Definition at line 269 of file eds_library.cpp.


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