On 09/20/11 12:22, Bertil Bäck wrote:
> I have two of these modules. I use a CAN messages to monitor if the other > module is alive. > > This is done by a toggle bit in one message that is sent every 100ms. If the > toggle bit is not changed within 500ms. I send a alarm. > Hi Bertil, to send alternating messages with a given interval you may also use the CAN_BCM protocol that can send messages from kernelspace with hrtimer resolution, e.g. see http://svn.berlios.de/wsvn/socketcan/trunk/test/tst-bcm-cycle.c and some other test programs in trunk/test . You can put the alternating frames into msg.can_frame[0] and msg.can_frame[1] there for example. It is also possible to check for missing updates of cyclic sent messages with the timeout monitoring provided in the BCM's RX_SETUP feature. Search for txmsg.msg_head.ival1.tv_sec in http://svn.berlios.de/wsvn/socketcan/trunk/test/tst-bcm-filter.c Btw. If you need to have the alive messages directly from the application you should stay generating them in the userspace. OTOH when your application crashes the open sockets are closed anyway - which also leads to stop the BCM sending jobs created by this application. Regards, Oliver _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
