FB::variant hapticAPI::stopDevice(void) { if (initialized){ if (hdPhantomClose(deviceID)!=-1){ hdPhantomStopServo(); initialized=false; return true; } } return false; }
//=========================================================================== int cPhantomDevice::close() { // check if drivers are installed if (!m_driverInstalled) return (-1); // check if the system has been opened previously if (!m_systemReady) return (-1); // yes, the device is open so let's close it int result = hdPhantomClose(m_deviceID); // update status m_systemReady = false; // possibly turn off servo loop hdPhantomStopServo(); // exit return (result); }