src/libYARP_dev/esdcan/linux/yarp/YARPEsdCanDeviceDriver.cpp
int YARPEsdCanDeviceDriver::_readDWord (int msg, int axis, int& value)
{
	EsdCanResources& r = RES(system_resources);
	ACE_ASSERT (axis >= 0 && axis <= (ESD_MAX_CARDS-1)*2);

	if (!ENABLED(axis))
	{
		value = 0;
		return YARP_OK;
	}

	_mutex.Wait();

	r.startPacket();
	r.addMessage (msg, axis);
		
	_writerequested = true;
	_noreply = false;
	
	_mutex.Post();

	_done.Wait();

	if (r.getErrorStatus() != YARP_OK)
	{
		value = 0;
		return YARP_FAIL;
	}

	value = *((int *)(r._replyBuffer[0].data+1));
	return YARP_OK;
}
///
/// sends a message and gets a dword back.
/// 
sends a message and gets a dword back.
sends a message and gets a dword back .
int YARPEsdCanDeviceDriver::_readDWord (int msg, int axis, int& value)
{
	EsdCanResources& r = RES(system_resources);
	ACE_ASSERT (axis >= 0 && axis <= (ESD_MAX_CARDS-1)*2);
	if (!ENABLED(axis))
	{
		value = 0;
		return YARP_OK;
	}
	_mutex.Wait();
	r.startPacket();
	r.addMessage (msg, axis);
	_writerequested = true;
	_noreply = false;
	_mutex.Post();
	_done.Wait();
	if (r.getErrorStatus() != YARP_OK)
	{
		value = 0;
		return YARP_FAIL;
	}
	value = *((int *)(r._replyBuffer[0].data+1));
	return YARP_OK;
}
int YARPEsdCanDeviceDriver :: _readDWord ( int msg , int axis , int & value ) { EsdCanResources & r = RES ( system_resources ) ; ACE_ASSERT ( axis >= 0 && axis <= ( ESD_MAX_CARDS - 1 ) * 2 ) ; if ( ! ENABLED ( axis ) ) { value = 0 ; return YARP_OK ; } _mutex . Wait ( ) ; r . startPacket ( ) ; r . addMessage ( msg , axis ) ; _writerequested = true ; _noreply = false ; _mutex . Post ( ) ; _done . Wait ( ) ; if ( r . getErrorStatus ( ) != YARP_OK ) { value = 0 ; return YARP_FAIL ; } value = * ( ( int * ) ( r . _replyBuffer [ 0 ] . data + 1 ) ) ; return YARP_OK ; }
sends a message and gets a dword back.
sends a message and gets a dword back .