author | greg |
Mon, 02 Mar 2009 09:30:33 +0100 | |
changeset 532 | 1ca55c717660 |
parent 529 | c171e11707c5 |
child 635 | 30a0e926bb2e |
permissions | -rw-r--r-- |
0 | 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 |
||
529
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
23 |
/** @defgroup heartbeato Heartbeat Object |
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
24 |
* The heartbeat mechanism for a device is established through cyclically transmitting a message by a |
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
25 |
* heartbeat producer. One or more devices in the network are aware of this heartbeat message. If the |
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
26 |
* heartbeat cycle fails for the heartbeat producer the local application on the heartbeat consumer will be |
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
27 |
* informed about that event. |
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
28 |
* @ingroup comobj |
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
29 |
*/ |
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
30 |
|
0 | 31 |
#ifndef __lifegrd_h__ |
32 |
#define __lifegrd_h__ |
|
33 |
||
34 |
||
35 |
#include <applicfg.h> |
|
36 |
||
378
d2abf6c8c27b
As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents:
343
diff
changeset
|
37 |
typedef void (*heartbeatError_t)(CO_Data*, UNS8); |
d2abf6c8c27b
As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents:
343
diff
changeset
|
38 |
void _heartbeatError(CO_Data* d, UNS8 heartbeatID); |
0 | 39 |
|
378
d2abf6c8c27b
As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents:
343
diff
changeset
|
40 |
typedef void (*post_SlaveBootup_t)(CO_Data*, UNS8); |
d2abf6c8c27b
As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents:
343
diff
changeset
|
41 |
void _post_SlaveBootup(CO_Data* d, UNS8 SlaveID); |
343 | 42 |
|
0 | 43 |
#include "data.h" |
44 |
||
71 | 45 |
/************************************************************************* |
46 |
* Functions |
|
74 | 47 |
*************************************************************************/ |
0 | 48 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
49 |
/** |
529
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
50 |
* @ingroup statemachine |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
51 |
* @brief To read the state of a node |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
52 |
* This can be used by the master after having sent a life guard request, |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
53 |
* of by any node if it is waiting for heartbeat. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
54 |
* @param *d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
55 |
* @param nodeId Id of a node |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
56 |
* @return e_nodeState State of the node corresponding to the nodeId |
0 | 57 |
*/ |
58 |
e_nodeState getNodeState (CO_Data* d, UNS8 nodeId); |
|
59 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
60 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
61 |
* @brief Start heartbeat consumer and producer |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
62 |
* with respect to 0x1016 and 0x1017 |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
63 |
* object dictionary entries |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
64 |
* @param *d Pointer on a CAN object data structure |
0 | 65 |
*/ |
66 |
void heartbeatInit(CO_Data* d); |
|
67 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
68 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
69 |
* @brief Stop heartbeat consumer and producer |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
70 |
* @param *d Pointer on a CAN object data structure |
0 | 71 |
*/ |
72 |
void heartbeatStop(CO_Data* d); |
|
73 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
74 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
75 |
* @brief This function is responsible to process a canopen-message which seams to be an NMT Error Control |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
76 |
* Messages. At them moment we assume that every NMT error control message |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
77 |
* is a heartbeat message. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
78 |
* If a BootUp message is detected, it will return the nodeId of the Slave who booted up |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
79 |
* @param *d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
378
diff
changeset
|
80 |
* @param *m Pointer on the CAN-message which has to be analysed. |
0 | 81 |
*/ |
82 |
void proceedNODE_GUARD (CO_Data* d, Message* m); |
|
83 |
||
71 | 84 |
#endif /*__lifegrd_h__ */ |