diff -r 2cb34a4ac65a -r 6b5a4c21e061 doc/doxygen/html/nmtSlave_8c-source.html --- a/doc/doxygen/html/nmtSlave_8c-source.html Tue Jun 05 17:34:33 2007 +0200 +++ b/doc/doxygen/html/nmtSlave_8c-source.html Tue Jun 05 18:43:21 2007 +0200 @@ -16,96 +16,89 @@
  • Globals
  • /home/epimerde/documents/tc11/CanFestival-3/src/nmtSlave.c

    Go to the documentation of this file.
    00001 /*
    -00002 This file is part of CanFestival, a library implementing CanOpen Stack. 
    -00003 
    -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN
    -00005 
    -00006 See COPYING file for copyrights details.
    -00007 
    -00008 This library is free software; you can redistribute it and/or
    -00009 modify it under the terms of the GNU Lesser General Public
    -00010 License as published by the Free Software Foundation; either
    -00011 version 2.1 of the License, or (at your option) any later version.
    -00012 
    -00013 This library is distributed in the hope that it will be useful,
    -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    -00016 Lesser General Public License for more details.
    -00017 
    -00018 You should have received a copy of the GNU Lesser General Public
    -00019 License along with this library; if not, write to the Free Software
    -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    -00021 */
    -00022 
    -00023 #include "nmtSlave.h"
    -00024 #include "states.h"
    -00025 #include "canfestival.h"
    -00026 
    -00027 /*******************************************************************)*********/
    -00028 /* put the slave in the state wanted by the master */   
    -00029 void proceedNMTstateChange(CO_Data* d, Message *m)
    -00030 {
    -00031   if( d->nodeState == Pre_operational ||
    -00032       d->nodeState == Operational ||
    -00033       d->nodeState == Stopped ) {
    -00034     
    -00035     MSG_WAR(0x3400, "NMT received. for node :  ", (*m).data[1]);
    -00036     
    -00037     /* Check if this NMT-message is for this node */
    -00038     /* byte 1 = 0 : all the nodes are concerned (broadcast) */
    -00039         
    -00040     if( ( (*m).data[1] == 0 ) || ( (*m).data[1] == *d->bDeviceNodeId ) ){
    -00041       
    -00042       switch( (*m).data[0]){ /* command specifier (cs) */                       
    -00043       case NMT_Start_Node:
    -00044         if ( (d->nodeState == Pre_operational) || (d->nodeState == Stopped) )
    -00045           setState(d,Operational);
    -00046         break; 
    -00047         
    -00048       case NMT_Stop_Node:
    -00049         if ( d->nodeState == Pre_operational ||
    -00050              d->nodeState == Operational )
    -00051           setState(d,Stopped);
    -00052         break;
    -00053         
    -00054       case NMT_Enter_PreOperational:
    -00055         if ( d->nodeState == Operational || 
    -00056              d->nodeState == Stopped )
    -00057           setState(d,Pre_operational);
    -00058         break;
    -00059         
    -00060       case NMT_Reset_Node:
    -00061           setState(d,Initialisation);
    -00062         break;
    -00063         
    -00064       case NMT_Reset_Comunication:
    -00065           setState(d,Initialisation);
    +00002   This file is part of CanFestival, a library implementing CanOpen
    +00003   Stack.
    +00004 
    +00005   Copyright (C): Edouard TISSERANT and Francis DUPIN
    +00006 
    +00007   See COPYING file for copyrights details.
    +00008 
    +00009   This library is free software; you can redistribute it and/or
    +00010   modify it under the terms of the GNU Lesser General Public
    +00011   License as published by the Free Software Foundation; either
    +00012   version 2.1 of the License, or (at your option) any later version.
    +00013 
    +00014   This library is distributed in the hope that it will be useful,
    +00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
    +00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    +00017   Lesser General Public License for more details.
    +00018 
    +00019   You should have received a copy of the GNU Lesser General Public
    +00020   License along with this library; if not, write to the Free Software
    +00021   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
    +00022   USA
    +00023 */
    +00033 #include "nmtSlave.h"
    +00034 #include "states.h"
    +00035 #include "canfestival.h"
    +00036 
    +00043 void proceedNMTstateChange(CO_Data* d, Message *m)
    +00044 {
    +00045   if( d->nodeState == Pre_operational ||
    +00046       d->nodeState == Operational ||
    +00047       d->nodeState == Stopped ) {
    +00048 
    +00049     MSG_WAR(0x3400, "NMT received. for node :  ", (*m).data[1]);
    +00050 
    +00054     if( ( (*m).data[1] == 0 ) || ( (*m).data[1] == *d->bDeviceNodeId ) ){
    +00055 
    +00056       switch( (*m).data[0]){ 
    +00057       case NMT_Start_Node:
    +00058         if ( (d->nodeState == Pre_operational) || (d->nodeState == Stopped) )
    +00059           setState(d,Operational);
    +00060         break;
    +00061 
    +00062       case NMT_Stop_Node:
    +00063         if ( d->nodeState == Pre_operational ||
    +00064              d->nodeState == Operational )
    +00065           setState(d,Stopped);
     00066         break;
    -00067         
    -00068       }/* end switch */
    -00069       
    -00070     }/* end if( ( (*m).data[1] == 0 ) || ( (*m).data[1] == bDeviceNodeId ) ) */
    -00071   }
    -00072 }
    +00067 
    +00068       case NMT_Enter_PreOperational:
    +00069         if ( d->nodeState == Operational ||
    +00070              d->nodeState == Stopped )
    +00071           setState(d,Pre_operational);
    +00072         break;
     00073 
    -00074 
    -00075 /*****************************************************************************/
    -00076 UNS8 slaveSendBootUp(CO_Data* d)
    -00077 {
    -00078   Message m;
    -00079         
    -00080   MSG_WAR(0x3407, "Send a Boot-Up msg ", 0);
    -00081         
    -00082   /* message configuration */
    -00083   m.cob_id.w = NODE_GUARD << 7 | *d->bDeviceNodeId;
    -00084   m.rtr = NOT_A_REQUEST;
    -00085   m.len = 1;
    -00086   m.data[0] = 0x00;
    -00087     
    -00088   return canSend(d->canHandle,&m);
    -00089 }
    -00090 
    -

    Generated on Mon Jun 4 17:09:26 2007 for CanFestival by  +00074 case NMT_Reset_Node: +00075 setState(d,Initialisation); +00076 break; +00077 +00078 case NMT_Reset_Comunication: +00079 setState(d,Initialisation); +00080 break; +00081 +00082 } +00084 } +00086 } +00087 } +00088 +00089 +00097 UNS8 slaveSendBootUp(CO_Data* d) +00098 { +00099 Message m; +00100 +00101 MSG_WAR(0x3407, "Send a Boot-Up msg ", 0); +00102 +00104 m.cob_id.w = NODE_GUARD << 7 | *d->bDeviceNodeId; +00105 m.rtr = NOT_A_REQUEST; +00106 m.len = 1; +00107 m.data[0] = 0x00; +00108 +00109 return canSend(d->canHandle,&m); +00110 } +00111 +
    Generated on Tue Jun 5 18:32:05 2007 for CanFestival by  doxygen 1.5.1