Lely core libraries  1.9.2
lely::canopen::BasicMaster::SubObject Class Reference

A mutator providing read/write access to a CANopen sub-object in a local object dictionary. More...

#include <master.hpp>

Public Member Functions

template<class T >
SubObjectoperator= (T &&value)
 Sets the value of the sub-object. More...
 
template<class T >
 operator T () const
 Returns the value of the sub-object by submitting an SDO upload request to the local object dictionary. More...
 
template<class T >
Read () const
 Reads the value of the sub-object by submitting an SDO upload request to the local object dictionary. More...
 
template<class T >
Read (::std::error_code &ec) const
 Reads the value of the sub-object by submitting an SDO upload request to the local object dictionary. More...
 
template<class T >
void Write (T &&value)
 Writes a value to the sub-object by submitting an SDO download request to the local object dictionary. More...
 
template<class T >
void Write (T &&value, ::std::error_code &ec)
 Writes a value to the sub-object by submitting an SDO download request to the local object dictionary. More...
 
void Write (const void *p, ::std::size_t n)
 Writes an OCTET_STRING or DOMAIN value to the sub-object by submitting an SDO download request to the local object dictionary. More...
 
void Write (const void *p, ::std::size_t n, ::std::error_code &ec)
 Writes an OCTET_STRING or DOMAIN value to the sub-object by submitting an SDO download request to the local object dictionary. More...
 

Detailed Description

A mutator providing read/write access to a CANopen sub-object in a local object dictionary.

Definition at line 55 of file master.hpp.

Member Function Documentation

◆ operator=()

template<class T >
SubObject& lely::canopen::BasicMaster::SubObject::operator= ( T &&  value)
inline

Sets the value of the sub-object.

Parameters
valuethe value to be written.
Exceptions
lely::canopen::SdoErrorif the sub-object does not exist or the type does not match.
See also
Write()

Definition at line 77 of file master.hpp.

◆ operator T()

template<class T >
lely::canopen::BasicMaster::SubObject::operator T ( ) const
inline

Returns the value of the sub-object by submitting an SDO upload request to the local object dictionary.

Exceptions
lely::canopen::SdoErroron error.
See also
Read()

Definition at line 91 of file master.hpp.

◆ Read() [1/2]

template<class T >
T lely::canopen::BasicMaster::SubObject::Read ( ) const
inline

Reads the value of the sub-object by submitting an SDO upload request to the local object dictionary.

Returns
the result of the SDO request.
Exceptions
lely::canopen::SdoErroron error.
See also
Device::Read(uint16_t idx, uint8_t subidx) const

Definition at line 107 of file master.hpp.

◆ Read() [2/2]

template<class T >
T lely::canopen::BasicMaster::SubObject::Read ( ::std::error_code &  ec) const
inline

Reads the value of the sub-object by submitting an SDO upload request to the local object dictionary.

Parameters
econ error, the SDO abort code is stored in ec.
Returns
the result of the SDO request, or an empty value on error.
See also
Device::Read(uint16_t idx, uint8_t subidx, ::std::error_code& ec) const

Definition at line 124 of file master.hpp.

◆ Write() [1/4]

template<class T >
void lely::canopen::BasicMaster::SubObject::Write ( T &&  value)
inline

Writes a value to the sub-object by submitting an SDO download request to the local object dictionary.

Parameters
valuethe value to be written.
Exceptions
lely::canopen::SdoErroron error.
See also
Device::Write(uint16_t idx, uint8_t subidx, T&& value)

Definition at line 140 of file master.hpp.

◆ Write() [2/4]

template<class T >
void lely::canopen::BasicMaster::SubObject::Write ( T &&  value,
::std::error_code &  ec 
)
inline

Writes a value to the sub-object by submitting an SDO download request to the local object dictionary.

Parameters
valuethe value to be written.
econ error, the SDO abort code is stored in ec.
See also
Device::Write(uint16_t idx, uint8_t subidx, T value, ::std::error_code& ec), Device::Write(uint16_t idx, uint8_t subidx, const T& value, ::std::error_code& ec), Device::Write(uint16_t idx, uint8_t subidx, const char* value, ::std::error_code& ec), Device::Write(uint16_t idx, uint8_t subidx, const char16_t* value, ::std::error_code& ec)

Definition at line 159 of file master.hpp.

◆ Write() [3/4]

void lely::canopen::BasicMaster::SubObject::Write ( const void *  p,
::std::size_t  n 
)
inline

Writes an OCTET_STRING or DOMAIN value to the sub-object by submitting an SDO download request to the local object dictionary.

Parameters
pa pointer to the bytes to be written.
nthe number of bytes to write.
Exceptions
lely::canopen::SdoErroron error.
See also
Device::Write(uint16_t idx, uint8_t subidx, const void* p, ::std::size_t n)

Definition at line 176 of file master.hpp.

◆ Write() [4/4]

void lely::canopen::BasicMaster::SubObject::Write ( const void *  p,
::std::size_t  n,
::std::error_code &  ec 
)
inline

Writes an OCTET_STRING or DOMAIN value to the sub-object by submitting an SDO download request to the local object dictionary.

Parameters
pa pointer to the bytes to be written.
nthe number of bytes to write.
econ error, the SDO abort code is stored in ec.
See also
Device::Write(uint16_t idx, uint8_t subidx, const void* p, ::std::size_t n, ::std::error_code& ec)

Definition at line 192 of file master.hpp.


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