|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#7
|
|||
|
|||
|
Re: CAN Jaguar enhancements
A couple of things:
1st: The device number is set in the setTransaction method in the sendMessage call. Here is the code for that from Rev 50. Code:
byte setTransaction(int messageID, byte[] data, byte dataSize) {
int ackMessageID = LM_API_ACK | m_deviceNumber;
// Make sure we don't have more than one transaction with the same Jaguar outstanding.
synchronized (m_transactionSemaphore) {
// Throw away any stale acks.
// receiveMessage(ackMessageID, kNoData, 10.0);
// Send the message with the data.
sendMessage(messageID | m_deviceNumber, data, dataSize);
// Wait for an ack.
// dataSize = receiveMessage(ackMessageID, kNoData, 0.0);
}
return dataSize;
The trusted messages feature works because they use a bitwise AND statement to determine the messageID for comparison, so this line: Code:
if ((kFullMessageIDMask & messageID) == kTrustedMessages[i]) {
2nd: I think that you might want to include more than just the API call in the messageID. For the syncronization program I am writing for my team in C++ I include every field so that my final message ID is this: Code:
#define CAN_MSGID_MFR_BCAST 0x00000000 //Define the Broadcast manufacturer //Define the Syncronization message Header #define LM_API_SYNC CAN_MSGID_DTYPE_BCAST | CAN_MSGID_MFR_BCAST| CAN_MSGID_API_SYNC That is all that I notice right now, but with more information about what the Jaguars are doing we should be able to help more. -Ian McInerney Programmer, Team 2022 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CAN Jaguar Malfunction | PranavSathy | CAN | 4 | 21-02-2010 18:32 |
| CAN Jaguar Synchronous Updates?? | Bryscus | Programming | 3 | 30-01-2010 16:13 |
| Getting started with CAN/Jaguar | CVassos | Programming | 1 | 27-01-2010 23:43 |
| CAN bus Jaguar intermittent errors | bear1511 | Programming | 1 | 27-01-2010 22:49 |
| Black Jaguar RS232->CAN - anyone? | oddjob | C/C++ | 12 | 22-01-2010 16:25 |