FB::variant hapticAPI::startDevice(void){ if (!initialized){ if ( hdPhantomOpen(deviceID)!=-1) { hdPhantomStartServo(); initialized = true; return (FB::variant)initialized; } } return initialized; }
//=========================================================================== int cPhantomDevice::open() { // check if drivers are installed if (!m_driverInstalled) return (-1); // check if the system is available if (!m_systemAvailable) return (-1); // if system is already opened then return if (m_systemReady) return (0); // try to open the device hdPhantomOpen(m_deviceID); // update device status m_systemReady = true; // success return (0); }