tool/MasterDevice.cpp
changeset 1388 3c886ec376f5
parent 1363 11c0b2caa253
child 1485 5ddc3a455059
equal deleted inserted replaced
1387:57020c731092 1388:3c886ec376f5
   367     }
   367     }
   368 }
   368 }
   369 
   369 
   370 /****************************************************************************/
   370 /****************************************************************************/
   371 
   371 
   372 void MasterDevice::readPhy(
   372 void MasterDevice::readReg(
   373         ec_ioctl_slave_phy_t *data
   373         ec_ioctl_slave_reg_t *data
   374         )
   374         )
   375 {
   375 {
   376     if (ioctl(fd, EC_IOCTL_SLAVE_PHY_READ, data) < 0) {
   376     if (ioctl(fd, EC_IOCTL_SLAVE_REG_READ, data) < 0) {
   377         stringstream err;
   377         stringstream err;
   378         err << "Failed to read physical memory: " << strerror(errno);
   378         err << "Failed to read register: " << strerror(errno);
   379         throw MasterDeviceException(err);
   379         throw MasterDeviceException(err);
   380     }
   380     }
   381 }
   381 }
   382 
   382 
   383 /****************************************************************************/
   383 /****************************************************************************/
   384 
   384 
   385 void MasterDevice::writePhy(
   385 void MasterDevice::writeReg(
   386         ec_ioctl_slave_phy_t *data
   386         ec_ioctl_slave_reg_t *data
   387         )
   387         )
   388 {
   388 {
   389     if (ioctl(fd, EC_IOCTL_SLAVE_PHY_WRITE, data) < 0) {
   389     if (ioctl(fd, EC_IOCTL_SLAVE_REG_WRITE, data) < 0) {
   390         stringstream err;
   390         stringstream err;
   391         err << "Failed to write physical memory: " << strerror(errno);
   391         err << "Failed to write register: " << strerror(errno);
   392         throw MasterDeviceException(err);
   392         throw MasterDeviceException(err);
   393     }
   393     }
   394 }
   394 }
   395 
   395 
   396 /****************************************************************************/
   396 /****************************************************************************/