The message above shows the J1939 name of one specific ECU. The challenge now is
to decide which parts of the name are relevant for the display to recognize this ECU on
the bus.
Masks are used to ignore those parts of the J1939 name which change from ECU
instance to ECU instance while evaluating the rest. Masks are applied via a bit-wise
AND so that a bit set to 0 on the masks means to ignore the respective bit of the name.
ECU is recognized as the one configured in the dialog
if ( (ECU_name_on_CAN AND configured_mask) ==
(configured_ECU_name AND configured_mask) )
By default every bit of the configured name is considered - with the exception of the
"Identity Number" field which should be derived from the ECU's serial number.
Note: It seems the default mask for "Function" is 0x01 and not 0xFF as it should be.
As mentioned above we mainly configured the J1939 ECUs because they own some
variables whose values we want to show and/or modify on display.
Before we can use these variables we have to do two things:
1. Create the variables and use one of the J1939 ECUs as owner.
2. Define the PGNs we want to use to send and receive the variables.
Creating dedicated variable groups for variables owned by J1939 ECUs
Knowing that we could end up with a lot of variables per ECU it's a good idea to create
one variable group per ECU. Of course you are free to organize variables in groups
however you prefer.