Ian,
Thanks for your feedback!
Quote:
Originally Posted by imac256
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.
|
You are correct about the setTransaction() method and the kTrustedMessages statement. I just missed it. I had been staring at it for a while and was multitasking as well.
However, because the SYNC message is not destined for just one device, the device number should NOT be sent. It is a broadcast message, as you have shown below. This could cause some issues. I think my setting of the m_deviceNumber to zero before sending the SYNC message is still the best way to go. OR, one could modify setTransaction().
Quote:
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
|
You can do this, but it is redundant. Because CAN_MSGID_DTYPE_BCAST and CAN_MSGID_MFR_BCAST are both 0, there is no added information to the LM_API_SYNC other than CAN_MSGID_API_SYNC. The compiler will pre-compile with the same end result. It IS however, nicer code and more future friendly should anything change.
- Bryce