include/nmtMaster.h
changeset 528 0a30e161d63c
parent 71 95cd3376cc9f
child 529 c171e11707c5
equal deleted inserted replaced
527:7d5c74cc8f91 528:0a30e161d63c
    18 You should have received a copy of the GNU Lesser General Public
    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
    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
    20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    21 */
    21 */
    22 
    22 
       
    23 /** @defgroup networkmanagement Network Management
       
    24  *  @ingroup userapi
       
    25  */
       
    26 /** @defgroup nmtmaster NMT Master
       
    27  *  @ingroup networkmanagement
       
    28  */
       
    29  
    23 #ifndef __nmtMaster_h__
    30 #ifndef __nmtMaster_h__
    24 #define __nmtMaster_h__
    31 #define __nmtMaster_h__
    25 
    32 
    26 #include "data.h"
    33 #include "data.h"
    27 
    34 
    28 /** Transmit a NMT message on the bus number bus_id
    35 /** 
       
    36  * @ingroup nmtmaster
       
    37  * @brief Transmit a NMT message on the bus number bus_id
    29  * to the slave whose node_id is ID
    38  * to the slave whose node_id is ID
       
    39  * 
    30  * bus_id is hardware dependant
    40  * bus_id is hardware dependant
    31  * cs represents the order of state changement:
    41  * cs represents the order of state changement:
    32  * cs =  NMT_Start_Node            // Put the node in operational mode             
    42  *  - cs =  NMT_Start_Node            // Put the node in operational mode             
    33  * cs =	 NMT_Stop_Node		   // Put the node in stopped mode
    43  *  - cs =	 NMT_Stop_Node		   // Put the node in stopped mode
    34  * cs =	 NMT_Enter_PreOperational  // Put the node in pre_operational mode  
    44  *  - cs =	 NMT_Enter_PreOperational  // Put the node in pre_operational mode  
    35  * cs =  NMT_Reset_Node		   // Put the node in initialization mode 
    45  *  - cs =  NMT_Reset_Node		   // Put the node in initialization mode 
    36  * cs =  NMT_Reset_Comunication	   // Put the node in initialization mode 
    46  *  - cs =  NMT_Reset_Comunication	   // Put the node in initialization mode 
    37  * The mode is changed according to the slave state machine mode :
    47  * The mode is changed according to the slave state machine mode :
    38  *        initialisation  ---> pre-operational (Automatic transition)
    48  *  - initialisation  ---> pre-operational (Automatic transition)
    39  *        pre-operational <--> operational
    49  *  - pre-operational <--> operational
    40  *        pre-operational <--> stopped
    50  *  - pre-operational <--> stopped
    41  *        pre-operational, operational, stopped -> initialisation
    51  *  - pre-operational, operational, stopped -> initialisation
    42  *
    52  * @param *d Pointer on a CAN object data structure
    43  * return canSend(bus_id,&m)               
    53  * @param Node_ID Id of the slave node
       
    54  * @param cs State changement
       
    55  * @return canSend(bus_id,&m)               
    44  */
    56  */
    45 UNS8 masterSendNMTstateChange (CO_Data* d, UNS8 Node_ID, UNS8 cs);
    57 UNS8 masterSendNMTstateChange (CO_Data* d, UNS8 Node_ID, UNS8 cs);
    46 
    58 
    47 /** Transmit a Node_Guard message on the bus number bus_id
    59 /**
       
    60  * @ingroup nmtmaster 
       
    61  * @brief Transmit a Node_Guard message on the bus number bus_id
    48  * to the slave whose node_id is nodeId
    62  * to the slave whose node_id is nodeId
       
    63  * 
    49  * bus_id is hardware dependant
    64  * bus_id is hardware dependant
    50  * return canSend(bus_id,&m)
    65  * @param *d Pointer on a CAN object data structure
       
    66  * @param nodeId Id of the slave node
       
    67  * @return canSend(bus_id,&m)
    51  */
    68  */
    52 UNS8 masterSendNMTnodeguard (CO_Data* d, UNS8 nodeId);
    69 UNS8 masterSendNMTnodeguard (CO_Data* d, UNS8 nodeId);
    53 
    70 
    54 
    71 /** 
    55 /** Prepare a Node_Guard message transmission on the bus number bus_id
    72  * @ingroup nmtmaster
       
    73  * @brief Prepare a Node_Guard message transmission on the bus number bus_id
    56  * to the slave whose node_id is nodeId
    74  * to the slave whose node_id is nodeId
       
    75  * 
    57  * Put nodeId = 0 to send an NMT broadcast.
    76  * Put nodeId = 0 to send an NMT broadcast.
    58  * This message will ask for the slave, whose node_id is nodeId, its state
    77  * This message will ask for the slave, whose node_id is nodeId, its state
    59  * bus_id is hardware dependant
    78  * bus_id is hardware dependant
       
    79  * @param *d Pointer on a CAN object data structure
       
    80  * @param nodeId Id of the slave node
    60  */
    81  */
    61 void masterRequestNodeState (CO_Data* d, UNS8 nodeId);
    82 void masterRequestNodeState (CO_Data* d, UNS8 nodeId);
    62 
    83 
    63 
    84 
    64 #endif /* __nmtMaster_h__ */
    85 #endif /* __nmtMaster_h__ */