nico@207: nico@207: nico@207: CanFestival: /home/epimerde/documents/tc11/CanFestival-3/src/states.c File Reference nico@207: nico@207: nico@207: nico@207: nico@207:
nico@207:
nico@207:
nico@207:
nico@207:

/home/epimerde/documents/tc11/CanFestival-3/src/states.c File Reference

#include "states.h"
nico@207: #include "def.h"
nico@207: #include "dcf.h"
nico@207: #include "nmtSlave.h"
nico@207: nico@207:

nico@210: Include dependency graph for states.c:

nico@210: nico@210:

nico@207: Go to the source code of this file. nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:

Defines

#define StartOrStop(CommType, FuncStart, FuncStop)
#define None

Functions

void switchCommunicationState (CO_Data *d, s_state_communication *newCommunicationState)
e_nodeState getState (CO_Data *d)
void canDispatch (CO_Data *d, Message *m)
UNS8 setState (CO_Data *d, e_nodeState newState)
UNS8 getNodeId (CO_Data *d)
void setNodeId (CO_Data *d, UNS8 nodeId)
void _initialisation ()
void _preOperational ()
void _operational ()
void _stopped ()
nico@210:


Detailed Description

nico@210:
Author:
Edouard TISSERANT and Francis DUPIN
nico@210:
Date:
Tue Jun 5 09:32:32 2007
nico@210: nico@210:

nico@210: Definition in file states.c.


Define Documentation

nico@207: nico@207:
nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207:
#define None
nico@207:
nico@207:
nico@207: nico@207:

nico@207: nico@207:

nico@210: Definition at line 112 of file states.c. nico@210:

nico@210: Referenced by switchCommunicationState(). nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
#define StartOrStop (CommType,
FuncStart,
FuncStop   ) 
nico@207:
nico@207:
nico@207: nico@207:

nico@207: Value:

if(newCommunicationState->CommType && !d->CurrentCommunicationState.CommType){\
nico@207:                 MSG_WAR(0x9999,#FuncStart, 9999);\
nico@207:                 d->CurrentCommunicationState.CommType = 1;\
nico@207:                 FuncStart;\
nico@207:         }else if(!newCommunicationState->CommType && d->CurrentCommunicationState.CommType){\
nico@207:                 MSG_WAR(0x9999,#FuncStop, 9999);\
nico@207:                 d->CurrentCommunicationState.CommType = 0;\
nico@207:                 FuncStop;\
nico@207:         }
nico@207: 
nico@207:

nico@210: Definition at line 102 of file states.c. nico@210:

nico@210: Referenced by switchCommunicationState(). nico@207:

nico@207:

nico@207:


Function Documentation

nico@207: nico@207:
nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
void _initialisation (  ) 
nico@207:
nico@207:
nico@207: nico@207:

nico@207: nico@207:

nico@210: Definition at line 285 of file states.c. nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
void _operational (  ) 
nico@207:
nico@207:
nico@207: nico@207:

nico@207: nico@207:

nico@210: Definition at line 287 of file states.c. nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
void _preOperational (  ) 
nico@207:
nico@207:
nico@207: nico@207:

nico@207: nico@207:

nico@210: Definition at line 286 of file states.c. nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
void _stopped (  ) 
nico@207:
nico@207:
nico@207: nico@207:

nico@207: nico@207:

nico@210: Definition at line 288 of file states.c. nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
void canDispatch (CO_Data *  d,
Message *  m 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210: nico@210:
d 
m 
nico@210:
nico@210: nico@210:

nico@210: case TIME_STAMP: nico@210:

nico@210: Definition at line 65 of file states.c. nico@210:

nico@210: References proceedNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), and proceedSYNC(). nico@210:

nico@210: Here is the call graph for this function:

nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@207:
nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
UNS8 getNodeId (CO_Data *  d  ) 
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210:
d 
nico@210:
nico@210:
Returns:
nico@210: nico@210:

nico@210: Definition at line 224 of file states.c. nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
e_nodeState getState (CO_Data *  d  ) 
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210:
d 
nico@210:
nico@210:
Returns:
nico@210: nico@210:

nico@210: Definition at line 54 of file states.c. nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
void setNodeId (CO_Data *  d,
UNS8  nodeId 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210: nico@210:
d 
nodeId 
nico@210:
nico@210: nico@210:

nico@210: cob_id_client = 0x600 + nodeId;

nico@210: cob_id_server = 0x580 + nodeId;

nico@210: node Id client. As we do not know the value, we put the node Id Server

nico@210: *(UNS8*)d->objdict[offset].pSubindex[3].pObject = nodeId;

nico@210: Initialize the server(s) SDO parameters Remember that only one SDO server is allowed, defined at index 0x1200

nico@210: Initialize the client(s) SDO parameters Nothing to initialize (no default values required by the DS 401) Initialize the receive PDO communication parameters. Only for 0x1400 to 0x1403

nico@210: bDeviceNodeId is defined in the object dictionary. nico@210:

nico@210: Definition at line 235 of file states.c. nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
UNS8 setState (CO_Data *  d,
e_nodeState  newState 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210: nico@210:
d 
newState 
nico@210:
nico@210:
Returns:
nico@210: nico@210:

nico@210: This will force a second loop for the state switch

nico@210: call user app related state func.

nico@210: end switch case nico@210:

nico@210: Definition at line 138 of file states.c. nico@210:

nico@210: References decompo_dcf(), ptrTable, and switchCommunicationState(). nico@210:

nico@210: Referenced by proceedNMTstateChange(). nico@210:

nico@210: Here is the call graph for this function:

nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@207:
nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
void switchCommunicationState (CO_Data *  d,
s_state_communication *  newCommunicationState 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210: nico@210:
d 
newCommunicationState 
nico@210:
nico@210: nico@210:

nico@210: Definition at line 120 of file states.c. nico@210:

nico@210: References heartbeatInit(), heartbeatStop(), None, resetSDO(), slaveSendBootUp(), StartOrStop, startSYNC(), and stopSYNC(). nico@210:

nico@210: Referenced by setState(). nico@210:

nico@210: Here is the call graph for this function:

nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210:
nico@210:

nico@210:


Generated on Tue Jun 5 18:32:10 2007 for CanFestival by  nico@207: nico@207: doxygen 1.5.1
nico@207: nico@207: