--- a/src/states.c Fri May 04 13:57:54 2007 +0200
+++ b/src/states.c Thu May 10 09:33:07 2007 +0200
@@ -99,6 +99,10 @@
/*****************************************************************************/
UNS8 setState(CO_Data* d, e_nodeState newState)
{
+ UNS16 wIndex = 0x1F22;
+ const indextable *ptrTable;
+ ODCallback_t *Callback;
+ UNS32 errorCode;
while(newState != d->nodeState){
switch( newState ){
case Initialisation:
@@ -123,8 +127,17 @@
switchCommunicationState(d, &newCommunicationState);
if (!(*(d->iam_a_slave)))
{
- UNS32 res;
- res = decompo_dcf(d,0x01);
+ ptrTable =(*d->scanIndexOD)(wIndex, &errorCode, &Callback);
+
+ if (errorCode != OD_SUCCESSFUL)
+ {
+ (*d->preOperational)();
+ }
+ else
+ {
+ UNS32 res;
+ res = decompo_dcf(d,0x01);
+ }
}
else
{