Now, SetNodeId will change 1200h SDO server params to new defaul values only if already set to appropriate default values.
authoretisserant
Tue, 02 Oct 2007 17:58:31 +0200
changeset 303 340348f0193f
parent 302 7ba4302a9999
child 304 32d93e0c6e64
Now, SetNodeId will change 1200h SDO server params to new defaul values only if already set to appropriate default values.
src/states.c
--- a/src/states.c	Tue Oct 02 17:57:16 2007 +0200
+++ b/src/states.c	Tue Oct 02 17:58:31 2007 +0200
@@ -242,12 +242,16 @@
 {
   UNS16 offset = d->firstIndex->SDO_SVR;
   if(offset){
+    /* Adjust COB-ID Client->Server (rx) only id already set to default value*/
+    if(*(UNS32*)d->objdict[offset].pSubindex[1].pObject = 0x600 + *d->bDeviceNodeId){
       /* cob_id_client = 0x600 + nodeId; */
       *(UNS32*)d->objdict[offset].pSubindex[1].pObject = 0x600 + nodeId;
+    }
+    /* Adjust COB-ID Server -> Client (tx) only id already set to default value*/
+    if(*(UNS32*)d->objdict[offset].pSubindex[2].pObject = 0x580 + *d->bDeviceNodeId){
       /* cob_id_server = 0x580 + nodeId; */
       *(UNS32*)d->objdict[offset].pSubindex[2].pObject = 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; */
+    }
   }
 
   /*