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

#include "states.h"
#include "def.h"
#include "dcf.h"
#include "nmtSlave.h"

Include dependency graph for states.c:

Go to the source code of this file.

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 ()


Detailed Description

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

Definition in file states.c.


Define Documentation

#define None

Definition at line 112 of file states.c.

Referenced by switchCommunicationState().

#define StartOrStop ( CommType,
FuncStart,
FuncStop   ) 

Value:

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

Definition at line 102 of file states.c.

Referenced by switchCommunicationState().


Function Documentation

void _initialisation (  ) 

Definition at line 285 of file states.c.

void _operational (  ) 

Definition at line 287 of file states.c.

void _preOperational (  ) 

Definition at line 286 of file states.c.

void _stopped (  ) 

Definition at line 288 of file states.c.

void canDispatch ( CO_Data *  d,
Message *  m 
)

Parameters:
d 
m 

case TIME_STAMP:

Definition at line 65 of file states.c.

References proceedNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), and proceedSYNC().

Here is the call graph for this function:

UNS8 getNodeId ( CO_Data *  d  ) 

Parameters:
d 
Returns:

Definition at line 224 of file states.c.

e_nodeState getState ( CO_Data *  d  ) 

Parameters:
d 
Returns:

Definition at line 54 of file states.c.

void setNodeId ( CO_Data *  d,
UNS8  nodeId 
)

Parameters:
d 
nodeId 

cob_id_client = 0x600 + nodeId;

cob_id_server = 0x580 + nodeId;

node Id client. As we do not know the value, we put the node Id Server

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

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

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

bDeviceNodeId is defined in the object dictionary.

Definition at line 235 of file states.c.

UNS8 setState ( CO_Data *  d,
e_nodeState  newState 
)

Parameters:
d 
newState 
Returns:

This will force a second loop for the state switch

call user app related state func.

end switch case

Definition at line 138 of file states.c.

References decompo_dcf(), ptrTable, and switchCommunicationState().

Referenced by proceedNMTstateChange().

Here is the call graph for this function:

void switchCommunicationState ( CO_Data *  d,
s_state_communication *  newCommunicationState 
)

Parameters:
d 
newCommunicationState 

Definition at line 120 of file states.c.

References heartbeatInit(), heartbeatStop(), None, resetSDO(), slaveSendBootUp(), StartOrStop, startSYNC(), and stopSYNC().

Referenced by setState().

Here is the call graph for this function:


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