author | Christian Taedcke |
Wed, 10 Nov 2010 13:08:26 +0100 | |
changeset 655 | ea1ddcc77acf |
parent 631 | 08b6b903f84a |
permissions | -rwxr-xr-x |
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 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
23 |
/** @defgroup networkmanagement Network Management |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
24 |
* @ingroup userapi |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
25 |
*/ |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
26 |
/** @defgroup nmtmaster NMT Master |
529
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
27 |
* @brief NMT master provides mechanisms that control and monitor the state of nodes and their behavior in the network. |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
28 |
* @ingroup networkmanagement |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
29 |
*/ |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
30 |
|
0 | 31 |
#ifndef __nmtMaster_h__ |
32 |
#define __nmtMaster_h__ |
|
33 |
||
34 |
#include "data.h" |
|
35 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
36 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
37 |
* @ingroup nmtmaster |
561 | 38 |
* @brief Transmit a NMT message on the network to the slave whose nodeId is node ID. |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
39 |
* |
561 | 40 |
* @param *d Pointer to a CAN object data structure |
41 |
* @param nodeId Id of the slave node |
|
42 |
* @param cs The order of state changement \n\n |
|
43 |
* |
|
44 |
* Allowed states : |
|
45 |
* - cs = NMT_Start_Node // Put the node in operational mode |
|
46 |
* - cs = NMT_Stop_Node // Put the node in stopped mode |
|
47 |
* - cs = NMT_Enter_PreOperational // Put the node in pre_operational mode |
|
48 |
* - cs = NMT_Reset_Node // Put the node in initialization mode |
|
49 |
* - cs = NMT_Reset_Comunication // Put the node in initialization mode |
|
50 |
* |
|
0 | 51 |
* The mode is changed according to the slave state machine mode : |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
52 |
* - initialisation ---> pre-operational (Automatic transition) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
53 |
* - pre-operational <--> operational |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
54 |
* - pre-operational <--> stopped |
561 | 55 |
* - pre-operational, operational, stopped -> initialisation |
56 |
* \n\n |
|
57 |
* @return errorcode |
|
58 |
* - 0 if the NMT message was send |
|
59 |
* - 1 if an error occurs |
|
0 | 60 |
*/ |
561 | 61 |
UNS8 masterSendNMTstateChange (CO_Data* d, UNS8 nodeId, UNS8 cs); |
0 | 62 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
63 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
64 |
* @ingroup nmtmaster |
561 | 65 |
* @brief Transmit a NodeGuard message on the network to the slave whose nodeId is node ID |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
66 |
* |
561 | 67 |
* @param *d Pointer to a CAN object data structure |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
68 |
* @param nodeId Id of the slave node |
561 | 69 |
* @return |
70 |
* - 0 is returned if the NodeGuard message was send. |
|
71 |
* - 1 is returned if an error occurs. |
|
0 | 72 |
*/ |
73 |
UNS8 masterSendNMTnodeguard (CO_Data* d, UNS8 nodeId); |
|
74 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
75 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
76 |
* @ingroup nmtmaster |
561 | 77 |
* @brief Ask the state of the slave node whose nodeId is node Id. |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
78 |
* |
561 | 79 |
* To ask states of all nodes on the network (NMT broadcast), nodeId must be equal to 0 |
80 |
* @param *d Pointer to a CAN object data structure |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
81 |
* @param nodeId Id of the slave node |
0 | 82 |
*/ |
631 | 83 |
UNS8 masterRequestNodeState (CO_Data* d, UNS8 nodeId); |
0 | 84 |
|
85 |
||
71 | 86 |
#endif /* __nmtMaster_h__ */ |