src/sdo.c
changeset 86 683702a46416
parent 84 19def60bd29c
child 87 074126d73842
equal deleted inserted replaced
85:6a5f4ac34396 86:683702a46416
    25 
    25 
    26 #include "objacces.h"
    26 #include "objacces.h"
    27 #include "sdo.h"
    27 #include "sdo.h"
    28 
    28 
    29 /* Uncomment if your compiler does not support inline functions */
    29 /* Uncomment if your compiler does not support inline functions */
    30  #define NO_INLINE 
    30 #define NO_INLINE 
    31 
    31 
    32 #ifdef NO_INLINE
    32 #ifdef NO_INLINE
    33   #define INLINE 
    33   #define INLINE 
    34 #else
    34 #else
    35 	#define INLINE inline
    35   #define INLINE inline
    36 #endif
    36 #endif
    37 
    37 
    38 /*Internals prototypes*/
    38 /*Internals prototypes*/
    39 
    39 
    40 /** Called by writeNetworkDict */
    40 /** Called by writeNetworkDict */
  1066   UNS8 line;
  1066   UNS8 line;
  1067   s_SDO sdo;    /* SDO to transmit */
  1067   s_SDO sdo;    /* SDO to transmit */
  1068   UNS8 i, j;
  1068   UNS8 i, j;
  1069   UNS16     lastIndex;
  1069   UNS16     lastIndex;
  1070   UNS16     offset;
  1070   UNS16     offset;
  1071   UNS8      *pNodeIdServer;
  1071   UNS32      *pNodeIdServer;
  1072   UNS8      nodeIdServer;
  1072   UNS32      nodeIdServer;
  1073 
  1073 
  1074   MSG_WAR(0x3AC0, "Send SDO to write in the dictionary of node : ", nodeId);
  1074   MSG_WAR(0x3AC0, "Send SDO to write in the dictionary of node : ", nodeId);
  1075   MSG_WAR(0x3AC1, "                                   At index : ", index);
  1075   MSG_WAR(0x3AC1, "                                   At index : ", index);
  1076   MSG_WAR(0x3AC2, "                                   subIndex : ", subIndex);
  1076   MSG_WAR(0x3AC2, "                                   subIndex : ", subIndex);
  1077   MSG_WAR(0x3AC3, "                                   nb bytes : ", count);
  1077   MSG_WAR(0x3AC3, "                                   nb bytes : ", count);
  1105      pNodeIdServer = d->objdict[offset].pSubindex[3].pObject;
  1105      pNodeIdServer = d->objdict[offset].pSubindex[3].pObject;
  1106      nodeIdServer = *pNodeIdServer;
  1106      nodeIdServer = *pNodeIdServer;
  1107      MSG_WAR(0x1AD2, "index : ", 0x1280 + i);
  1107      MSG_WAR(0x1AD2, "index : ", 0x1280 + i);
  1108      MSG_WAR(0x1AD3, "nodeIdServer : ", nodeIdServer);
  1108      MSG_WAR(0x1AD3, "nodeIdServer : ", nodeIdServer);
  1109    
  1109    
  1110     if(nodeIdServer == nodeId) {
  1110     if(nodeIdServer == (UNS32)nodeId) {
  1111       SDOfound = 1;
  1111       SDOfound = 1;
  1112       break;
  1112       break;
  1113     }
  1113     }
  1114     offset++;
  1114     offset++;
  1115     i++;
  1115     i++;
  1186   UNS8 err;
  1186   UNS8 err;
  1187   UNS8 SDOfound = 0;
  1187   UNS8 SDOfound = 0;
  1188   UNS8 i;
  1188   UNS8 i;
  1189   UNS8 line;
  1189   UNS8 line;
  1190   s_SDO sdo;    /* SDO to transmit */
  1190   s_SDO sdo;    /* SDO to transmit */
  1191   UNS8      *pNodeIdServer;
  1191   UNS32      *pNodeIdServer;
  1192   UNS8      nodeIdServer;
  1192   UNS32      nodeIdServer;
  1193   UNS16     offset;
  1193   UNS16     offset;
  1194   UNS16     lastIndex;
  1194   UNS16     lastIndex;
  1195   MSG_WAR(0x3AD5, "Send SDO to read in the dictionary of node : ", nodeId);
  1195   MSG_WAR(0x3AD5, "Send SDO to read in the dictionary of node : ", nodeId);
  1196   MSG_WAR(0x3AD6, "                                  At index : ", index);
  1196   MSG_WAR(0x3AD6, "                                  At index : ", index);
  1197   MSG_WAR(0x3AD7, "                                  subIndex : ", subIndex);
  1197   MSG_WAR(0x3AD7, "                                  subIndex : ", subIndex);
  1227      }
  1227      }
  1228      /* looking for the nodeId server */
  1228      /* looking for the nodeId server */
  1229      pNodeIdServer = d->objdict[offset].pSubindex[3].pObject;
  1229      pNodeIdServer = d->objdict[offset].pSubindex[3].pObject;
  1230      nodeIdServer = *pNodeIdServer;
  1230      nodeIdServer = *pNodeIdServer;
  1231    
  1231    
  1232     if(nodeIdServer == nodeId) {
  1232     if(nodeIdServer == (UNS32)nodeId) {
  1233       SDOfound = 1;
  1233       SDOfound = 1;
  1234       break;
  1234       break;
  1235     }
  1235     }
  1236     offset++;
  1236     offset++;
  1237     i++;
  1237     i++;