Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+//#define DEBUG_WAR_CONSOLE_ON
+//#define DEBUG_ERR_CONSOLE_ON
+
#include "objacces.h"
#ifdef DEBUG_WAR_CONSOLE_ON
}
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;
}
{
// data must be transmited with low byte first
UNS8 i, j = 0;
- for ( i = ptrTable->pSubindex[bSubindex].size - 1 ; i >= 0 ; i--) {
- ((char*)pDestData)[j++] = ((char*)ptrTable->pSubindex[bSubindex].pObject)[i];
+ for ( i = ptrTable->pSubindex[bSubindex].size ; i > 0 ; i--) {
+ ((char*)pDestData)[j++] = ((char*)ptrTable->pSubindex[bSubindex].pObject)[i-1];
}
}
#else
accessDictionaryError(wIndex, bSubindex, 0, *pExpectedSize, OD_NO_SUCH_SUBINDEX);
return OD_NO_SUCH_SUBINDEX;
}
- if (checkAccess && !(ptrTable->pSubindex[bSubindex].bAccessType & RO)) {
+ if (checkAccess && (ptrTable->pSubindex[bSubindex].bAccessType == RO)) {
+ MSG_WAR(0x2B25, "Access Type : ", ptrTable->pSubindex[bSubindex].bAccessType);
accessDictionaryError(wIndex, bSubindex, 0, *pExpectedSize, OD_WRITE_NOT_ALLOWED);
return OD_WRITE_NOT_ALLOWED;
}
{
// data must be transmited with low byte first
UNS8 i, j = 0;
- for ( i = ptrTable->pSubindex[bSubindex].size - 1 ; i >= 0 ; i--) {
- ((char*)ptrTable->pSubindex[bSubindex].pObject)[i] = ((char*)pSourceData)[j++];
+ for ( i = ptrTable->pSubindex[bSubindex].size ; i > 0 ; i--) {
+ ((char*)ptrTable->pSubindex[bSubindex].pObject)[i - 1] = ((char*)pSourceData)[j++];
}
}
#else
return errorCode;
}
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-//#define DEBUG_WAR_CONSOLE_ON
-//#define DEBUG_ERR_CONSOLE_ON
+#define DEBUG_WAR_CONSOLE_ON
+#define DEBUG_ERR_CONSOLE_ON
#include "objacces.h"
#include "sdo.h"
UNS8 i;
UNS8 size;
UNS32 errorCode;
+ MSG_WAR(0x3A08, "Enter in SDOlineToObjdict ", line);
size = d->transfers[line].count;
errorCode = setODentry(d, d->transfers[line].index, d->transfers[line].subIndex,
(void *) d->transfers[line].data, &size, 1);
if (errorCode != OD_SUCCESSFUL)
return errorCode;
-
+ MSG_WAR(0x3A08, "exit of SDOlineToObjdict ", line);
return 0;
}
UNS8 err;
UNS8 line;
err = getSDOlineOnUse( d, nodeId, whoami, &line );
- if (!err)
+ if (!err) // If a line on use have been found.
MSG_WAR(0x3A20, "FailedSDO : line found : ", line);
if ((! err) && (whoami == SDO_SERVER)) {
resetSDOline( d, line );
MSG_WAR(0x3A21, "FailedSDO : line released : ", line);
}
- if ((! err) && (whoami == SDO_CLIENT))
- StopSDO_TIMER(line)
+ if ((! err) && (whoami == SDO_CLIENT)) {
+ StopSDO_TIMER(line);
d->transfers[line].state = SDO_ABORTED_INTERNAL;
+ }
MSG_WAR(0x3A22, "Sending SDO abort ", 0);
err = sendSDOabort(d, whoami, index, subIndex, abortCode);
if (err) {
void resetSDOline ( CO_Data* d, UNS8 line )
{
UNS8 i;
-
+ MSG_WAR(0x3A25, "reset SDO line nb : ", line);
initSDOline(d, line, 0, 0, 0, SDO_RESET);
for (i = 0 ; i < SDO_MAX_LENGTH_TRANSFERT ; i++)
d->transfers[line].data[i] = 0;
/***************************************************************************/
UNS8 initSDOline (CO_Data* d, UNS8 line, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 state)
{
+ MSG_WAR(0x3A25, "init SDO line nb : ", line);
if (state == SDO_DOWNLOAD_IN_PROGRESS || state == SDO_UPLOAD_IN_PROGRESS){
StartSDO_TIMER(line)
}else{
{
s_SDO sdo;
UNS8 ret;
- MSG_WAR(0x2A50,"Sending SDO abort", abortCode);
+ MSG_WAR(0x2A50,"Sending SDO abort ", abortCode);
sdo.nodeId = *d->bDeviceNodeId;
sdo.body.data[0] = 0x80;
// Index
* abortCode = d->transfers[line].abortCode;
return d->transfers[line].state;
}
+