tool/MasterDevice.cpp
changeset 1200 ce1a65f06efc
parent 1184 75cd6681eb08
child 1222 7348d6abb6cb
--- a/tool/MasterDevice.cpp	Wed Aug 13 13:21:35 2008 +0000
+++ b/tool/MasterDevice.cpp	Wed Aug 13 13:23:52 2008 +0000
@@ -344,6 +344,32 @@
 
 /****************************************************************************/
 
+void MasterDevice::readPhy(
+        ec_ioctl_slave_phy_t *data
+        )
+{
+    if (ioctl(fd, EC_IOCTL_SLAVE_PHY_READ, data) < 0) {
+        stringstream err;
+        err << "Failed to read physical memory: " << strerror(errno);
+        throw MasterDeviceException(err);
+    }
+}
+
+/****************************************************************************/
+
+void MasterDevice::writePhy(
+        ec_ioctl_slave_phy_t *data
+        )
+{
+    if (ioctl(fd, EC_IOCTL_SLAVE_PHY_WRITE, data) < 0) {
+        stringstream err;
+        err << "Failed to write physical memory: " << strerror(errno);
+        throw MasterDeviceException(err);
+    }
+}
+
+/****************************************************************************/
+
 void MasterDevice::setDebug(unsigned int debugLevel)
 {
     if (ioctl(fd, EC_IOCTL_MASTER_DEBUG, debugLevel) < 0) {