I have been assigned a task to implement a protocol understanding with some nodes in car. for example, in a car the driver pressed AC on/off or fan on/off from a a button module this information has to go the HVAC controller and status need to be delivered back to the Button module and also may be the display module.
I am trying to implement it in CAN. The problem is even if I have worked on CAN and tested the CAN frames using tools. I never gave thought on why a particular can id is given to a particular frame. Generally any node can listen to any CAN id and the Controller side of the CAN RX decides which can ids it should accept with message filter and mask sometimes it can be single message id like 0x123 or a range of message id 0x120 - 0x128
When I am trying to do that myself the questions like should I assign lower ID value or should i assign a high ID value ? How do I know which sign is of priority ? Can I use IDs lower than 100 ?
How to frame the can id ? Can you give an example of the frame or CAN ID structure ? or share any documents.
One approach I came up with is to only make use of J1939 Identifier structure(J1939 address claiming concept are not used ) along with can 2.0B, where out of 29bit I am setting PGN from 0000 to FFFF are used to identifies the meaning of the message, and finally the source Address to tell which button module is being pressed or which application ECU is sending request.So we can uniquely identifies each node in communication. Assume that source address will not be used by other module in the current network. With this approach I am thinking lot of PGN range are unused.
Is this approach correct ? How do I do the same with 11 bit identifier?