mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-02-07 04:11:50 +08:00
Implemented SoE write state machine and soe_write command.
This commit is contained in:
@@ -528,7 +528,7 @@ void MasterDevice::getEoeHandler(
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
void MasterDevice::readSoe(ec_ioctl_slave_soe_t *data)
|
||||
void MasterDevice::readSoe(ec_ioctl_slave_soe_read_t *data)
|
||||
{
|
||||
if (ioctl(fd, EC_IOCTL_SLAVE_SOE_READ, data) < 0) {
|
||||
if (errno == EIO && data->error_code) {
|
||||
@@ -541,4 +541,19 @@ void MasterDevice::readSoe(ec_ioctl_slave_soe_t *data)
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
void MasterDevice::writeSoe(ec_ioctl_slave_soe_write_t *data)
|
||||
{
|
||||
if (ioctl(fd, EC_IOCTL_SLAVE_SOE_WRITE, data) < 0) {
|
||||
if (errno == EIO && data->error_code) {
|
||||
throw MasterDeviceSoeException(data->error_code);
|
||||
} else {
|
||||
stringstream err;
|
||||
err << "Failed to write IDN: " << strerror(errno);
|
||||
throw MasterDeviceException(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user