22 #ifndef LELY_COAPP_DEVICE_HPP_ 23 #define LELY_COAPP_DEVICE_HPP_ 58 Device(const ::std::string& dcf_txt, const ::std::string& dcf_bin =
"",
68 uint8_t
netid()
const noexcept;
71 uint8_t
id()
const noexcept;
86 typename ::std::enable_if<detail::IsCanopenType<T>::value, T>::type
Read(
87 uint16_t idx, uint8_t subidx)
const;
101 typename ::std::enable_if<detail::IsCanopenType<T>::value, T>::type
Read(
102 uint16_t idx, uint8_t subidx, ::std::error_code& ec)
const;
116 typename ::std::enable_if<detail::IsCanopenBasic<T>::value>::type
Write(
117 uint16_t idx, uint8_t subidx, T value);
130 typename ::std::enable_if<detail::IsCanopenBasic<T>::value>::type
Write(
131 uint16_t idx, uint8_t subidx, T value, ::std::error_code& ec);
145 typename ::std::enable_if<detail::IsCanopenArray<T>::value>::type
Write(
146 uint16_t idx, uint8_t subidx,
const T& value);
159 typename ::std::enable_if<detail::IsCanopenArray<T>::value>::type
Write(
160 uint16_t idx, uint8_t subidx,
const T& value, ::std::error_code& ec);
173 void Write(uint16_t idx, uint8_t subidx,
const char* value);
185 void Write(uint16_t idx, uint8_t subidx,
const char* value,
186 ::std::error_code& ec);
200 void Write(uint16_t idx, uint8_t subidx,
const char16_t* value);
213 void Write(uint16_t idx, uint8_t subidx,
const char16_t* value,
214 ::std::error_code& ec);
228 void Write(uint16_t idx, uint8_t subidx,
const void* p, ::std::size_t n);
241 void Write(uint16_t idx, uint8_t subidx,
const void* p, ::std::size_t n,
242 ::std::error_code& ec);
261 const ::std::type_info&
Type(uint16_t idx, uint8_t subidx)
const;
274 const ::std::type_info&
Type(uint16_t idx, uint8_t subidx,
275 ::std::error_code& ec)
const;
291 typename ::std::enable_if<detail::IsCanopenType<T>::value, T>::type
Get(
292 uint16_t idx, uint8_t subidx)
const;
307 typename ::std::enable_if<detail::IsCanopenType<T>::value, T>::type
Get(
308 uint16_t idx, uint8_t subidx, ::std::error_code& ec)
const;
323 typename ::std::enable_if<detail::IsCanopenBasic<T>::value>::type
Set(
324 uint16_t idx, uint8_t subidx, T value);
338 typename ::std::enable_if<detail::IsCanopenBasic<T>::value>::type
Set(
339 uint16_t idx, uint8_t subidx, T value, ::std::error_code& ec);
354 typename ::std::enable_if<detail::IsCanopenArray<T>::value>::type
Set(
355 uint16_t idx, uint8_t subidx,
const T& value);
369 typename ::std::enable_if<detail::IsCanopenArray<T>::value>::type
Set(
370 uint16_t idx, uint8_t subidx,
const T& value, ::std::error_code& ec);
384 void Set(uint16_t idx, uint8_t subidx,
const char* value);
397 void Set(uint16_t idx, uint8_t subidx,
const char* value,
398 ::std::error_code& ec);
413 void Set(uint16_t idx, uint8_t subidx,
const char16_t* value);
427 void Set(uint16_t idx, uint8_t subidx,
const char16_t* value,
428 ::std::error_code& ec);
443 void Set(uint16_t idx, uint8_t subidx,
const void* p, ::std::size_t n);
457 void Set(uint16_t idx, uint8_t subidx,
const void* p, ::std::size_t n,
458 ::std::error_code& ec);
462 ::std::unique_ptr<Impl_> impl_;
469 #endif // LELY_COAPP_DEVICE_HPP_ typename ::std::enable_if< detail::IsCanopenType< T >::value, T >::type Get(uint16_t idx, uint8_t subidx) const
Reads the value of a sub-object.
This header file is part of the C++ CANopen application library; it contains the SDO error declaratio...
An opaque CANopen device type.
typename ::std::enable_if< detail::IsCanopenType< T >::value, T >::type Read(uint16_t idx, uint8_t subidx) const
Submits an SDO upload request to the local object dictionary.
uint8_t netid() const noexcept
Returns the network-ID.
Device(const ::std::string &dcf_txt, const ::std::string &dcf_bin="", uint8_t id=0xff, BasicLockable *mutex=nullptr)
Creates a new CANopen device description.
const ::std::type_info & Type(uint16_t idx, uint8_t subidx) const
Returns the type of a sub-object.
An abstract interface conforming to the BasicLockable concept.
This header file is part of the C++ CANopen application library; it contains the CANopen type traits...
typename ::std::enable_if< detail::IsCanopenBasic< T >::value >::type Write(uint16_t idx, uint8_t subidx, T value)
Submits an SDO download request to the local object dictionary.
The internal implementation of the CANopen device description.
CODev * dev() const noexcept
Returns a pointer to the internal CANopen device from <lely/co/dev.hpp>.
The CANopen device description.
Global namespace for the Lely Industries N.V. libraries.
uint8_t id() const noexcept
Returns the node-ID.
typename ::std::enable_if< detail::IsCanopenBasic< T >::value >::type Set(uint16_t idx, uint8_t subidx, T value)
Writes a CANopen basic value to a sub-object.