Reputation: 136865
Devices which communicate via CAN bus have to send their identifier before they start sending anything else. The protocol defines that devices with lower identifiers have priority. The protocol has a "dominant 0", that means if one device puts a 0 on the bus and another one puts a 1 on the bus, the 0 is on the bus. Devices listen all the time, including when they are sending. That means a device which puts its identifier on the bus which has a 1 at some position, but reads a 0 it knows that a higher priority device also wants to use the bus and it has to stop.
Who defines the ID of the devices within cars? Is it just random? Do the manufacturers enforce identifiers? (How do they do that if the device was not built by themselves, e.g. the cars radio?)
Upvotes: 2
Views: 316
Reputation: 194
As my understanding goes, the identifier field in a CAN frame is not actually the ID of the device sending it, but an identifier for that particular message type. This field is then used by receiving devices to determine whether or not they need to respond to the message (I believe this filtering is commonly implemented using bit masks).
For example, a manufacturer might use the identifier 00000001100 for all messages relating to the door locks. The CAN devices controlling the locking mechanisms then need only listen to messages with this particular identifier and can ignore all the other messages as their only function is to lock/unlock the doors.
As far as who determines the identifiers when third party equipment is involved, I'm sure that a large car manufacturer can sway a radio manufacturer to use custom identifiers to fit their uses if need be. However, 11 bits for the identifier should offer plenty of room for the car manufacturer to prioritize their system around whatever was used by the radio manufacturer (assuming the radio manufacturer didn't set all message identifiers to 11111111111 or something stupid like that).
Upvotes: 4