2 This file is part of CanFestival, a library implementing CanOpen Stack.
4 Copyright (C): Edouard TISSERANT and Francis DUPIN
6 See COPYING file for copyrights details.
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.
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.
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
23 /** @defgroup networkmanagement Network Management
26 /** @defgroup nmtmaster NMT Master
27 * @brief NMT master provides mechanisms that control and monitor the state of nodes and their behavior in the network.
28 * @ingroup networkmanagement
31 #ifndef __nmtMaster_h__
32 #define __nmtMaster_h__
38 * @brief Transmit a NMT message on the bus number bus_id
39 * to the slave whose node_id is ID
41 * bus_id is hardware dependant
42 * cs represents the order of state changement:
43 * - cs = NMT_Start_Node // Put the node in operational mode
44 * - cs = NMT_Stop_Node // Put the node in stopped mode
45 * - cs = NMT_Enter_PreOperational // Put the node in pre_operational mode
46 * - cs = NMT_Reset_Node // Put the node in initialization mode
47 * - cs = NMT_Reset_Comunication // Put the node in initialization mode
48 * The mode is changed according to the slave state machine mode :
49 * - initialisation ---> pre-operational (Automatic transition)
50 * - pre-operational <--> operational
51 * - pre-operational <--> stopped
52 * - pre-operational, operational, stopped -> initialisation\n
53 * @param *d Pointer on a CAN object data structure
54 * @param Node_ID Id of the slave node
55 * @param cs State changement
56 * @return canSend(bus_id,&m)
58 UNS8 masterSendNMTstateChange (CO_Data* d, UNS8 Node_ID, UNS8 cs);
62 * @brief Transmit a Node_Guard message on the bus number bus_id
63 * to the slave whose node_id is nodeId
65 * bus_id is hardware dependant
66 * @param *d Pointer on a CAN object data structure
67 * @param nodeId Id of the slave node
68 * @return canSend(bus_id,&m)
70 UNS8 masterSendNMTnodeguard (CO_Data* d, UNS8 nodeId);
74 * @brief Prepare a Node_Guard message transmission on the bus number bus_id
75 * to the slave whose node_id is nodeId
77 * Put nodeId = 0 to send an NMT broadcast.
78 * This message will ask for the slave, whose node_id is nodeId, its state
79 * bus_id is hardware dependant
80 * @param *d Pointer on a CAN object data structure
81 * @param nodeId Id of the slave node
83 void masterRequestNodeState (CO_Data* d, UNS8 nodeId);
86 #endif /* __nmtMaster_h__ */