EthercatSlaveBase.cpp
Go to the documentation of this file.
1 // soem_interface
4 
5 namespace rokubimini
6 {
7 namespace soem_interface
8 {
9 EthercatSlaveBase::EthercatSlaveBase(EthercatBusBase* bus, const uint32_t address) : bus_(bus), address_(address)
10 {
11 }
12 
13 // This definition must not be in the header, because of the forward declaration of EthercatBus
14 template <typename Value>
15 bool EthercatSlaveBase::sendSdoWrite(const uint16_t index, const uint8_t subindex, const bool completeAccess,
16  const Value value)
17 {
18  std::lock_guard<std::recursive_mutex> lock(mutex_);
19  return bus_->sendSdoWrite(address_, index, subindex, completeAccess, value);
20 }
21 
22 // This definition must not be in the header, because of the forward declaration of EthercatBus
23 template <typename Value>
24 bool EthercatSlaveBase::sendSdoRead(const uint16_t index, const uint8_t subindex, const bool completeAccess,
25  Value& value)
26 {
27  std::lock_guard<std::recursive_mutex> lock(mutex_);
28  return bus_->sendSdoRead(address_, index, subindex, completeAccess, value);
29 }
30 
31 // These definitions must not be in the header, because of the forward declaration of EthercatBus
32 template bool EthercatSlaveBase::sendSdoWrite<int8_t>(const uint16_t index, const uint8_t subindex,
33  const bool completeAccess, const int8_t value);
34 template bool EthercatSlaveBase::sendSdoWrite<int16_t>(const uint16_t index, const uint8_t subindex,
35  const bool completeAccess, const int16_t value);
36 template bool EthercatSlaveBase::sendSdoWrite<int32_t>(const uint16_t index, const uint8_t subindex,
37  const bool completeAccess, const int32_t value);
38 template bool EthercatSlaveBase::sendSdoWrite<int64_t>(const uint16_t index, const uint8_t subindex,
39  const bool completeAccess, const int64_t value);
40 template bool EthercatSlaveBase::sendSdoWrite<uint8_t>(const uint16_t index, const uint8_t subindex,
41  const bool completeAccess, const uint8_t value);
42 template bool EthercatSlaveBase::sendSdoWrite<uint16_t>(const uint16_t index, const uint8_t subindex,
43  const bool completeAccess, const uint16_t value);
44 template bool EthercatSlaveBase::sendSdoWrite<uint32_t>(const uint16_t index, const uint8_t subindex,
45  const bool completeAccess, const uint32_t value);
46 template bool EthercatSlaveBase::sendSdoWrite<uint64_t>(const uint16_t index, const uint8_t subindex,
47  const bool completeAccess, const uint64_t value);
48 template bool EthercatSlaveBase::sendSdoWrite<float>(const uint16_t index, const uint8_t subindex,
49  const bool completeAccess, const float value);
50 template bool EthercatSlaveBase::sendSdoWrite<double>(const uint16_t index, const uint8_t subindex,
51  const bool completeAccess, const double value);
52 
53 template bool EthercatSlaveBase::sendSdoRead<int8_t>(const uint16_t index, const uint8_t subindex,
54  const bool completeAccess, int8_t& value);
55 template bool EthercatSlaveBase::sendSdoRead<int16_t>(const uint16_t index, const uint8_t subindex,
56  const bool completeAccess, int16_t& value);
57 template bool EthercatSlaveBase::sendSdoRead<int32_t>(const uint16_t index, const uint8_t subindex,
58  const bool completeAccess, int32_t& value);
59 template bool EthercatSlaveBase::sendSdoRead<int64_t>(const uint16_t index, const uint8_t subindex,
60  const bool completeAccess, int64_t& value);
61 template bool EthercatSlaveBase::sendSdoRead<uint8_t>(const uint16_t index, const uint8_t subindex,
62  const bool completeAccess, uint8_t& value);
63 template bool EthercatSlaveBase::sendSdoRead<uint16_t>(const uint16_t index, const uint8_t subindex,
64  const bool completeAccess, uint16_t& value);
65 template bool EthercatSlaveBase::sendSdoRead<uint32_t>(const uint16_t index, const uint8_t subindex,
66  const bool completeAccess, uint32_t& value);
67 template bool EthercatSlaveBase::sendSdoRead<uint64_t>(const uint16_t index, const uint8_t subindex,
68  const bool completeAccess, uint64_t& value);
69 template bool EthercatSlaveBase::sendSdoRead<float>(const uint16_t index, const uint8_t subindex,
70  const bool completeAccess, float& value);
71 template bool EthercatSlaveBase::sendSdoRead<double>(const uint16_t index, const uint8_t subindex,
72  const bool completeAccess, double& value);
73 
74 bool EthercatSlaveBase::sendSdoReadGeneric(const std::string& indexString, const std::string& subindexString,
75  const std::string& valueTypeString, std::string& valueString)
76 {
78  return false;
79 }
80 
81 bool EthercatSlaveBase::sendSdoWriteGeneric(const std::string& indexString, const std::string& subindexString,
82  const std::string& valueTypeString, const std::string& valueString)
83 {
85  return false;
86 }
87 
88 } // namespace soem_interface
89 } // namespace rokubimini
void printWarnNotImplemented()
Prints a warning. Use this method to suppress compiler warnings.
EthercatSlaveBase(EthercatBusBase *bus, const uint32_t address)
unsigned short uint16_t
bool sendSdoRead(const uint16_t index, const uint8_t subindex, const bool completeAccess, Value &value)
unsigned char uint8_t
bool sendSdoWrite(const uint16_t slave, const uint16_t index, const uint8_t subindex, const bool completeAccess, const Value value)
unsigned int uint32_t
signed short int16_t
unsigned __int64 uint64_t
virtual bool sendSdoWriteGeneric(const std::string &indexString, const std::string &subindexString, const std::string &valueTypeString, const std::string &valueString)
signed char int8_t
bool sendSdoRead(const uint16_t slave, const uint16_t index, const uint8_t subindex, const bool completeAccess, Value &value)
signed __int64 int64_t
Class for managing an ethercat bus containing one or multiple slaves.
bool sendSdoWrite(const uint16_t index, const uint8_t subindex, const bool completeAccess, const Value value)
signed int int32_t
virtual bool sendSdoReadGeneric(const std::string &indexString, const std::string &subindexString, const std::string &valueTypeString, std::string &valueString)


rokubimini_ethercat
Author(s):
autogenerated on Wed Mar 3 2021 03:09:16