#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 () |
Definition in file states.c.
#define None |
#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().
void canDispatch | ( | CO_Data * | d, | |
Message * | m | |||
) |
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:
void setNodeId | ( | CO_Data * | d, | |
UNS8 | nodeId | |||
) |
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.
UNS8 setState | ( | CO_Data * | d, | |
e_nodeState | newState | |||
) |
d | ||
newState |
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 | |||
) |
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: