I am working on some CAN communication project which allows us to control some external device attached to one node from some other node. The CAN bus is a broadcast network and hence a message sent by a node will be received by every other CAN node on the bus.
My requirement is that I need to implement a filtration mechanism for the nodes so that a node will only act upon those received messages for which it is configured (using some GUI utility). So I need to implement this filter mechanism in my code. I am using an STM8SAF52Ax microcontroller with IAR Embedded Workbench as my development environment.
How could I implement this filter process of CAN messages? I also did web search and read many other tutorials, but still I am unable to figure out what is to be done. There are use of CAN filter ID and filter mask, but I am unable to decide what value to be loaded in these and how to calculate these values.