equal
deleted
inserted
replaced
18 You should have received a copy of the GNU Lesser General Public |
18 You should have received a copy of the GNU Lesser General Public |
19 License along with this library; if not, write to the Free Software |
19 License along with this library; if not, write to the Free Software |
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 */ |
21 */ |
22 |
22 |
23 /* #define DEBUG_WAR_CONSOLE_ON */ |
23 #define DEBUG_WAR_CONSOLE_ON |
24 /* #define DEBUG_ERR_CONSOLE_ON */ |
24 #define DEBUG_ERR_CONSOLE_ON |
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 */ |
351 UNS8 found = 0; |
351 UNS8 found = 0; |
352 Message m; |
352 Message m; |
353 UNS8 i; |
353 UNS8 i; |
354 UNS32 * pwCobId = NULL; |
354 UNS32 * pwCobId = NULL; |
355 UNS8 * pwNodeId = NULL; |
355 UNS8 * pwNodeId = NULL; |
356 UNS8 * pSize; |
|
357 UNS8 size; |
|
358 pSize = &size; |
|
359 |
356 |
360 MSG_WAR(0x3A38, "sendSDO",0); |
357 MSG_WAR(0x3A38, "sendSDO",0); |
361 if( !((d->nodeState == Operational) || (d->nodeState == Pre_operational ))) { |
358 if( !((d->nodeState == Operational) || (d->nodeState == Pre_operational ))) { |
362 MSG_WAR(0x2A39, "unable to send the SDO (not in op or pre-op mode", d->nodeState); |
359 MSG_WAR(0x2A39, "unable to send the SDO (not in op or pre-op mode", d->nodeState); |
363 return 0xFF; |
360 return 0xFF; |
453 UNS16 index; |
450 UNS16 index; |
454 UNS8 subIndex; |
451 UNS8 subIndex; |
455 UNS32 abortCode; |
452 UNS32 abortCode; |
456 UNS8 i,j; |
453 UNS8 i,j; |
457 UNS32 * pCobId = NULL; |
454 UNS32 * pCobId = NULL; |
458 UNS8 * pSize; |
|
459 UNS8 size; |
|
460 UNS16 offset; |
455 UNS16 offset; |
461 UNS16 lastIndex; |
456 UNS16 lastIndex; |
462 |
|
463 pSize = &size; |
|
464 |
457 |
465 MSG_WAR(0x3A60, "proceedSDO ", 0); |
458 MSG_WAR(0x3A60, "proceedSDO ", 0); |
466 whoami = SDO_UNKNOWN; |
459 whoami = SDO_UNKNOWN; |
467 /* Looking for the cobId in the object dictionary. */ |
460 /* Looking for the cobId in the object dictionary. */ |
468 /* Am-I a server ? */ |
461 /* Am-I a server ? */ |
1023 sendSDO(d, whoami, sdo); |
1016 sendSDO(d, whoami, sdo); |
1024 |
1017 |
1025 } /* end if I am a CLIENT */ |
1018 } /* end if I am a CLIENT */ |
1026 break; |
1019 break; |
1027 |
1020 |
1028 case 4: |
1021 case 4: |
1029 abortCode = (*m).data[3] | |
1022 abortCode = (*m).data[3] | |
1030 (m->data[5] << 8) | |
1023 ((UNS32)m->data[5] << 8) | |
1031 (m->data[6] << 16) | |
1024 ((UNS32)m->data[6] << 16) | |
1032 (m->data[7] << 24); |
1025 ((UNS32)m->data[7] << 24); |
1033 /* Received SDO abort. */ |
1026 /* Received SDO abort. */ |
1034 /* Looking for the line concerned. */ |
1027 /* Looking for the line concerned. */ |
1035 if (whoami == SDO_SERVER) { |
1028 if (whoami == SDO_SERVER) { |
1036 err = getSDOlineOnUse( d, nodeId, whoami, &line ); |
1029 err = getSDOlineOnUse( d, nodeId, whoami, &line ); |
1037 if (!err) { |
1030 if (!err) { |
1071 UNS8 err; |
1064 UNS8 err; |
1072 UNS8 SDOfound = 0; |
1065 UNS8 SDOfound = 0; |
1073 UNS8 line; |
1066 UNS8 line; |
1074 s_SDO sdo; /* SDO to transmit */ |
1067 s_SDO sdo; /* SDO to transmit */ |
1075 UNS8 i, j; |
1068 UNS8 i, j; |
1076 UNS8 * pSize; |
|
1077 UNS8 size; |
|
1078 UNS16 lastIndex; |
1069 UNS16 lastIndex; |
1079 UNS16 offset; |
1070 UNS16 offset; |
1080 UNS8 *pNodeIdServer; |
1071 UNS8 *pNodeIdServer; |
1081 UNS8 nodeIdServer; |
1072 UNS8 nodeIdServer; |
1082 pSize = &size; |
|
1083 |
1073 |
1084 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); |
1085 MSG_WAR(0x3AC1, " At index : ", index); |
1075 MSG_WAR(0x3AC1, " At index : ", index); |
1086 MSG_WAR(0x3AC2, " subIndex : ", subIndex); |
1076 MSG_WAR(0x3AC2, " subIndex : ", subIndex); |
1087 MSG_WAR(0x3AC3, " nb bytes : ", count); |
1077 MSG_WAR(0x3AC3, " nb bytes : ", count); |
1195 { |
1185 { |
1196 UNS8 err; |
1186 UNS8 err; |
1197 UNS8 SDOfound = 0; |
1187 UNS8 SDOfound = 0; |
1198 UNS8 i; |
1188 UNS8 i; |
1199 UNS8 line; |
1189 UNS8 line; |
1200 UNS8 * pSize; |
|
1201 UNS8 size; |
|
1202 s_SDO sdo; /* SDO to transmit */ |
1190 s_SDO sdo; /* SDO to transmit */ |
1203 UNS8 *pNodeIdServer; |
1191 UNS8 *pNodeIdServer; |
1204 UNS8 nodeIdServer; |
1192 UNS8 nodeIdServer; |
1205 UNS16 offset; |
1193 UNS16 offset; |
1206 UNS16 lastIndex; |
1194 UNS16 lastIndex; |
1207 pSize = &size; |
|
1208 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); |
1209 MSG_WAR(0x3AD6, " At index : ", index); |
1196 MSG_WAR(0x3AD6, " At index : ", index); |
1210 MSG_WAR(0x3AD7, " subIndex : ", subIndex); |
1197 MSG_WAR(0x3AD7, " subIndex : ", subIndex); |
1211 |
1198 |
1212 |
1199 |