You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have been using this library to control CiA401 devices and I found a memory access violation issue if we try to remap pdo after a deleting old device and creating a new one. The issue was related to the residual add_pdo_received_callback entry. The workaround is to remove the residual add_pdo_received_callback while destroying a device.
Device::~Device() {
for (auto& cob_id : cob_ids_)
m_core.pdo.remove_pdo_received_callback(cob_id);
}
void PDO::remove_pdo_received_callback(uint16_t cob_id) {
std::lock_guardstd::mutex scoped_lock(m_receive_callbacks_mutex);
for (auto i = m_receive_callbacks.begin(); i != m_receive_callbacks.end();
i++)
if ((*i).cob_id == cob_id) {
m_receive_callbacks.erase(i);
break;
}
}
I am now trying to write a master side example which handles multiple slave device on the same bus. Any suggestion will really be appreciated.
The text was updated successfully, but these errors were encountered:
Hi, I have been using this library to control CiA401 devices and I found a memory access violation issue if we try to remap pdo after a deleting old device and creating a new one. The issue was related to the residual add_pdo_received_callback entry. The workaround is to remove the residual add_pdo_received_callback while destroying a device.
Device::~Device() {
for (auto& cob_id : cob_ids_)
m_core.pdo.remove_pdo_received_callback(cob_id);
}
void PDO::remove_pdo_received_callback(uint16_t cob_id) {
std::lock_guardstd::mutex scoped_lock(m_receive_callbacks_mutex);
for (auto i = m_receive_callbacks.begin(); i != m_receive_callbacks.end();
i++)
if ((*i).cob_id == cob_id) {
m_receive_callbacks.erase(i);
break;
}
}
I am now trying to write a master side example which handles multiple slave device on the same bus. Any suggestion will really be appreciated.
The text was updated successfully, but these errors were encountered: