]> rtime.felk.cvut.cz Git - CanFestival-3.git/blob - include/lifegrd.h
Commit a new cvs repo.
[CanFestival-3.git] / include / lifegrd.h
1 /*
2 This file is part of CanFestival, a library implementing CanOpen Stack. 
3
4 Copyright (C): Edouard TISSERANT and Francis DUPIN
5
6 See COPYING file for copyrights details.
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 */
22
23 #ifndef __lifegrd_h__
24 #define __lifegrd_h__
25
26
27 #include <applicfg.h>
28
29 typedef void (*heartbeatError_t)(UNS8);
30
31 #include "data.h"
32
33 //*************************************************************************/
34 //Functions
35 //*************************************************************************/
36
37
38 /** To read the state of a node
39  *  This can be used by the master after having sent a life guard request,
40  *  of by any node if it is waiting for heartbeat.
41  */
42 e_nodeState getNodeState (CO_Data* d, UNS8 nodeId);
43
44 /** Start heartbeat consumer and producer
45  *  with respect to 0x1016 and 0x1017
46  *  object dictionary entries
47  */
48 void heartbeatInit(CO_Data* d);
49
50 /** Stop heartbeat consumer and producer
51  */
52 void heartbeatStop(CO_Data* d);
53
54 /** This function is responsible to process a canopen-message which seams to be an NMT Error Control
55  *  Messages. At them moment we assume that every NMT error control message
56  *  is a heartbeat message.
57  *  \param Message The CAN-message which has to be analysed.
58  *  If a BootUp message is detected, it will return the nodeId of the Slave who booted up
59  */
60 void proceedNODE_GUARD (CO_Data* d, Message* m);
61
62 #endif //__lifegrd_h__