code/WPILib/CANJaguar.cpp
/**
 * Execute a transaction with a Jaguar that gets some property.
 * 
 * Jaguar always generates a message with the same message ID when replying.
 * 
 * @param messageID The messageID to read from the CAN bus (device number is added internally)
 * @param data The up to 8 bytes of data that was received with the message
 * @param dataSize Indicates how much data was received
 */
Execute a transaction with a Jaguar that gets some property.

Jaguar always generates a message with the same message ID when replying.

@param messageID The messageID to read from the CAN bus (device number is added internally)
@param data The up to 8 bytes of data that was received with the message
@param dataSize Indicates how much data was received
Execute a transaction with a Jaguar that gets some property . Jaguar always generates a message with the same message ID when replying . @param messageID The messageID to read from the CAN bus ( device number is added internally ) @param data The up to 8 bytes of data that was received with the message @param dataSize Indicates how much data was received
void CANJaguar::getTransaction(UINT32 messageID, UINT8 *data, UINT8 *dataSize)
{
	UINT32 targetedMessageID = messageID | m_deviceNumber;
	INT32 status = 0;
	semTake(m_transactionSemaphore, WAIT_FOREVER);
	status = sendMessage(targetedMessageID, NULL, 0);
	wpi_assertCleanStatus(status);
	targetedMessageID &= 0x1FFFFFFF;
	status = receiveMessage(&targetedMessageID, data, dataSize);
	wpi_assertCleanStatus(status);
	semGive(m_transactionSemaphore);
}
void CANJaguar :: getTransaction ( UINT32 messageID , UINT8 * data , UINT8 * dataSize ) { UINT32 targetedMessageID = messageID | m_deviceNumber ; INT32 status = 0 ; semTake ( m_transactionSemaphore , WAIT_FOREVER ) ; status = sendMessage ( targetedMessageID , NULL , 0 ) ; wpi_assertCleanStatus ( status ) ; targetedMessageID &= 0x1FFFFFFF ; status = receiveMessage ( & targetedMessageID , data , dataSize ) ; wpi_assertCleanStatus ( status ) ; semGive ( m_transactionSemaphore ) ; }
Execute a transaction with a Jaguar that gets some property.
Execute a transaction with a Jaguar that gets some property .
// Make sure we don't have more than one transaction with the same Jaguar outstanding. // Send the message requesting data. // Caller may have set bit31 for remote frame transmission so clear invalid bits[31-29] // Wait for the data. // Transaction complete.