Fixed faulty read access checking on OD access. Added read acces s checking in SDO (was disabled)
--- a/src/objacces.c Tue Feb 19 14:52:40 2008 +0100
+++ b/src/objacces.c Tue Feb 19 14:53:39 2008 +0100
@@ -127,7 +127,7 @@
return OD_NO_SUCH_SUBINDEX;
}
- if (checkAccess && !(ptrTable->pSubindex[bSubindex].bAccessType & WO)) {
+ if (checkAccess && (ptrTable->pSubindex[bSubindex].bAccessType & WO)) {
MSG_WAR(0x2B30, "Access Type : ", ptrTable->pSubindex[bSubindex].bAccessType);
accessDictionaryError(wIndex, bSubindex, 0, 0, OD_WRITE_NOT_ALLOWED);
return OD_READ_NOT_ALLOWED;
@@ -161,17 +161,7 @@
# endif
*pExpectedSize = szData;
-#if 0
- /* Me laisser a, please ! (FD) */
- {
- UNS8 i;
- for (i = 0 ; i < 10 ; i++) {
- MSG_WAR(*pExpectedSize, "dic data= ",
- *(UNS8 *)(ptrTable->pSubindex[bSubindex].pObject + i));
- }
-
- }
-#endif
+
return OD_SUCCESSFUL;
}
else { /* Error ! */
--- a/src/sdo.c Tue Feb 19 14:52:40 2008 +0100
+++ b/src/sdo.c Tue Feb 19 14:53:39 2008 +0100
@@ -217,22 +217,14 @@
errorCode = getODentry(d, d->transfers[line].index,
d->transfers[line].subIndex,
(void *)d->transfers[line].data,
- &size, &dataType, 0);
+ &size, &dataType, 1);
if (errorCode != OD_SUCCESSFUL)
return errorCode;
d->transfers[line].count = size;
d->transfers[line].offset = 0;
-#if 0
- /*Me laisser a, please ! (FD)*/
- {
- UNS8 i;
- for (i = 0 ; i < 10 ; i++) {
- MSG_WAR(i, "data= ", d->transfers[line].data[i]);
- }
- }
-#endif
+
return 0;
}