etisserant@0: /* etisserant@0: This file is part of CanFestival, a library implementing CanOpen Stack. etisserant@0: etisserant@0: Copyright (C): Edouard TISSERANT and Francis DUPIN etisserant@0: etisserant@0: See COPYING file for copyrights details. etisserant@0: etisserant@0: This library is free software; you can redistribute it and/or etisserant@0: modify it under the terms of the GNU Lesser General Public etisserant@0: License as published by the Free Software Foundation; either etisserant@0: version 2.1 of the License, or (at your option) any later version. etisserant@0: etisserant@0: This library is distributed in the hope that it will be useful, etisserant@0: but WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU etisserant@0: Lesser General Public License for more details. etisserant@0: etisserant@0: You should have received a copy of the GNU Lesser General Public etisserant@0: License along with this library; if not, write to the Free Software etisserant@0: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA etisserant@0: */ etisserant@0: etisserant@0: #ifndef __lifegrd_h__ etisserant@0: #define __lifegrd_h__ etisserant@0: etisserant@0: etisserant@0: #include etisserant@0: etisserant@0: typedef void (*heartbeatError_t)(UNS8); etisserant@0: etisserant@0: #include "data.h" etisserant@0: etisserant@0: //*************************************************************************/ etisserant@0: //Functions etisserant@0: //*************************************************************************/ etisserant@0: etisserant@0: etisserant@0: /** To read the state of a node etisserant@0: * This can be used by the master after having sent a life guard request, etisserant@0: * of by any node if it is waiting for heartbeat. etisserant@0: */ etisserant@0: e_nodeState getNodeState (CO_Data* d, UNS8 nodeId); etisserant@0: etisserant@0: /** Start heartbeat consumer and producer etisserant@0: * with respect to 0x1016 and 0x1017 etisserant@0: * object dictionary entries etisserant@0: */ etisserant@0: void heartbeatInit(CO_Data* d); etisserant@0: etisserant@0: /** Stop heartbeat consumer and producer etisserant@0: */ etisserant@0: void heartbeatStop(CO_Data* d); etisserant@0: etisserant@0: /** This function is responsible to process a canopen-message which seams to be an NMT Error Control etisserant@0: * Messages. At them moment we assume that every NMT error control message etisserant@0: * is a heartbeat message. etisserant@0: * \param Message The CAN-message which has to be analysed. etisserant@0: * If a BootUp message is detected, it will return the nodeId of the Slave who booted up etisserant@0: */ etisserant@0: void proceedNODE_GUARD (CO_Data* d, Message* m); etisserant@0: etisserant@0: #endif //__lifegrd_h__