- edited description
Chai returns bool instead of int
Issue #65
resolved
\return Return 0 if no error occurred.
*/
//==============================================================================
int cHapticDeviceHandler::getDevice(cGenericHapticDevice*& a_hapticDevice,
unsigned int a_index)
{
printf("\n\n ********************* \n\n Num devices = %d \n\n *************", static_cast<int>(m_numDevices));
if (a_index < m_numDevices)
{
printf("\n\n ********************* \n\n SUCCESS Num devices = %d \n\n *************", static_cast<int>(m_numDevices));
a_hapticDevice = m_devices[a_index];
return 0;
}
else
{
printf("\n\n ********************* \n\n FAILURE Num devices = %d \n\n *************", static_cast<int>(m_numDevices));
a_hapticDevice = m_nullHapticDevice;
return (C_ERROR);
}
}
Comments (3)
-
reporter -
reporter Also CChaiHaptics.cpp has an incorrect return var.
// 2. Open a connection to the haptic device. bool hflag = tmp_haptic_device->open(); if (false == hflag) { std::stringstream ss; ss<<"Could not connect to haptic device: "<<i; throw(std::runtime_error(ss.str())); } else { std::cout << "\nConnected to haptic device: "<< i << std::flush; }
-
repo owner - changed status to resolved
Fixed as of ac141073b420a4f9a880e9c517736899a7099ebf
- Log in to comment