src/objacces.c
author etisserant
Mon, 02 Jul 2007 18:22:58 +0200
changeset 236 905677ed00f3
parent 215 f49e5a6b7804
child 378 d2abf6c8c27b
permissions -rw-r--r--
Full preliminary implementation of TPDO transmit type:
- SYNC (N) (1-240)
- RTR only + SYNC (252)
- RTR only (253)
- EVENT, with timer and inhibit time (254 and 255)

User app have to call sendPDOevent(d) to eventually signal mapped data changes.
Callbacks added to 0x140N, TPDO comm parameters for on the fly timers values change.
TestMasterSlave updated.
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
/*
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
     2
  This file is part of CanFestival, a library implementing CanOpen
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
     3
  Stack.
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
     4
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
     5
  Copyright (C): Edouard TISSERANT and Francis DUPIN
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
     6
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
     7
  See COPYING file for copyrights details.
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
     8
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
     9
  This library is free software; you can redistribute it and/or
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    10
  modify it under the terms of the GNU Lesser General Public
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    11
  License as published by the Free Software Foundation; either
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    12
  version 2.1 of the License, or (at your option) any later version.
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    13
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    14
  This library is distributed in the hope that it will be useful,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    15
  but WITHOUT ANY WARRANTY; without even the implied warranty of
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    16
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    17
  Lesser General Public License for more details.
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    18
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    19
  You should have received a copy of the GNU Lesser General Public
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    20
  License along with this library; if not, write to the Free Software
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    21
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    22
  USA
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
*/
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    24
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    25
** @file   objacces.c
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    26
** @author Edouard TISSERANT and Francis DUPIN
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    27
** @date   Tue Jun  5 08:55:23 2007
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    28
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    29
** @brief
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    30
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    31
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    32
*/
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    33
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    34
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    35
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
71
95cd3376cc9f compilator compatitibility
frdupin
parents: 55
diff changeset
    37
/* #define DEBUG_WAR_CONSOLE_ON */
95cd3376cc9f compilator compatitibility
frdupin
parents: 55
diff changeset
    38
/* #define DEBUG_ERR_CONSOLE_ON */
11
64ed038bdc74 Bogue:big endian
dejoigny
parents: 10
diff changeset
    39
1
b3dc740b4b04 Commit some Fix from Francis on sdo.c and abjacces.c. Fix endianisation problems while accessing OD. Also fix SDO abord handling bug.
etisserant
parents: 0
diff changeset
    40
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
#include "objacces.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
8
eee2b0c89213 correction bogue pour BIG_ENDIAN
dejoigny
parents: 2
diff changeset
    43
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    44
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    45
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    46
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    47
** @param index
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    48
** @param subIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    49
** @param sizeDataDict
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    50
** @param sizeDataGiven
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    51
** @param code
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    52
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    53
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    54
**/
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    55
UNS8 accessDictionaryError(UNS16 index, UNS8 subIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    56
                           UNS8 sizeDataDict, UNS8 sizeDataGiven, UNS32 code)
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
{
75
debc68b124b7 compiler compatibility : accessDictionaryError contains nothing out of debogue mode
frdupin
parents: 71
diff changeset
    58
#ifdef DEBUG_WAR_CONSOLE_ON
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
  MSG_WAR(0x2B09,"Dictionary index : ", index);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
  MSG_WAR(0X2B10,"           subindex : ", subIndex);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
  switch (code) {
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    62
  case  OD_NO_SUCH_OBJECT:
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    63
    MSG_WAR(0x2B11,"Index not found ", index);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    64
    break;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    65
  case OD_NO_SUCH_SUBINDEX :
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    66
    MSG_WAR(0x2B12,"SubIndex not found ", subIndex);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    67
    break;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    68
  case OD_WRITE_NOT_ALLOWED :
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    69
    MSG_WAR(0x2B13,"Write not allowed, data is read only ", index);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    70
    break;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    71
  case OD_LENGTH_DATA_INVALID :
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    72
    MSG_WAR(0x2B14,"Conflict size data. Should be (bytes)  : ", sizeDataDict);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    73
    MSG_WAR(0x2B15,"But you have given the size  : ", sizeDataGiven);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    74
    break;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    75
  case OD_NOT_MAPPABLE :
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    76
    MSG_WAR(0x2B16,"Not mappable data in a PDO at index    : ", index);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    77
    break;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    78
  case OD_VALUE_TOO_LOW :
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    79
    MSG_WAR(0x2B17,"Value range error : value too low. SDOabort : ", code);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    80
    break;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    81
  case OD_VALUE_TOO_HIGH :
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    82
    MSG_WAR(0x2B18,"Value range error : value too high. SDOabort : ", code);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    83
    break;
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
  default :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
    MSG_WAR(0x2B20, "Unknown error code : ", code);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
  }
75
debc68b124b7 compiler compatibility : accessDictionaryError contains nothing out of debogue mode
frdupin
parents: 71
diff changeset
    87
#endif
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    88
  return 0;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    89
}
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    90
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    91
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    92
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    93
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    94
** @param d
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    95
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    96
** @param bSubindex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    97
** @param pDestData
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    98
** @param pExpectedSize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
    99
** @param pDataType
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   100
** @param checkAccess
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   101
** @param endianize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   102
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   103
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   104
**/
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   105
UNS32 _getODentry( CO_Data* d,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   106
                   UNS16 wIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   107
                   UNS8 bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   108
                   void * pDestData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   109
                   UNS8 * pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   110
                   UNS8 * pDataType,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   111
                   UNS8 checkAccess,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   112
                   UNS8 endianize)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   113
{ /* DO NOT USE MSG_ERR because the macro may send a PDO -> infinite
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   114
    loop if it fails. */
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   115
  UNS32 errorCode;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   116
  UNS8 szData;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   117
  const indextable *ptrTable;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   118
  ODCallback_t *Callback;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   119
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   120
  ptrTable = (*d->scanIndexOD)(wIndex, &errorCode, &Callback);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   121
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   122
  if (errorCode != OD_SUCCESSFUL)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   123
    return errorCode;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   124
  if( ptrTable->bSubCount <= bSubindex ) {
71
95cd3376cc9f compilator compatitibility
frdupin
parents: 55
diff changeset
   125
    /* Subindex not found */
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   126
    accessDictionaryError(wIndex, bSubindex, 0, 0, OD_NO_SUCH_SUBINDEX);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   127
    return OD_NO_SUCH_SUBINDEX;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   128
  }
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   129
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   130
  if (checkAccess && !(ptrTable->pSubindex[bSubindex].bAccessType & WO)) {
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   131
    MSG_WAR(0x2B30, "Access Type : ", ptrTable->pSubindex[bSubindex].bAccessType);
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   132
    accessDictionaryError(wIndex, bSubindex, 0, 0, OD_WRITE_NOT_ALLOWED);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   133
    return OD_READ_NOT_ALLOWED;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   134
  }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   135
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   136
  *pDataType = ptrTable->pSubindex[bSubindex].bDataType;
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   137
  szData = ptrTable->pSubindex[bSubindex].size;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   138
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   139
  if(*pExpectedSize == 0 ||
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   140
     *pExpectedSize == szData ||
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   141
     (*pDataType == visible_string && *pExpectedSize < szData)) {
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   142
    /* We
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   143
      allow to fetch a shorter string than expected */
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   144
12
1d3b9ad366c8 CANOPEN_BIG_ENDIAN :
dejoigny
parents: 11
diff changeset
   145
#  ifdef CANOPEN_BIG_ENDIAN
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   146
    if(endianize && *pDataType > boolean && *pDataType < visible_string) {
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   147
      /* data must be transmited with low byte first */
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   148
      UNS8 i, j = 0;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   149
      MSG_WAR(boolean, "data type ", *pDataType);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   150
      MSG_WAR(visible_string, "data type ", *pDataType);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   151
      for ( i = szData ; i > 0 ; i--) {
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   152
        MSG_WAR(i," ", j);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   153
        ((UNS8*)pDestData)[j++] =
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   154
          ((UNS8*)ptrTable->pSubindex[bSubindex].pObject)[i-1];
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   155
      }
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   156
    }
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   157
    else /* It it is a visible string no endianisation to perform */
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   158
      memcpy(pDestData, ptrTable->pSubindex[bSubindex].pObject,szData);
12
1d3b9ad366c8 CANOPEN_BIG_ENDIAN :
dejoigny
parents: 11
diff changeset
   159
#  else
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   160
    memcpy(pDestData, ptrTable->pSubindex[bSubindex].pObject,szData);
12
1d3b9ad366c8 CANOPEN_BIG_ENDIAN :
dejoigny
parents: 11
diff changeset
   161
#  endif
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   162
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   163
    *pExpectedSize = szData;
12
1d3b9ad366c8 CANOPEN_BIG_ENDIAN :
dejoigny
parents: 11
diff changeset
   164
#if 0
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   165
    /* Me laisser a, please ! (FD) */
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   166
    {
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   167
      UNS8 i;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   168
      for (i = 0 ; i < 10 ; i++) {
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   169
        MSG_WAR(*pExpectedSize, "dic data= ",
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   170
                *(UNS8 *)(ptrTable->pSubindex[bSubindex].pObject + i));
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   171
      }
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   172
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   173
    }
12
1d3b9ad366c8 CANOPEN_BIG_ENDIAN :
dejoigny
parents: 11
diff changeset
   174
#endif
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   175
    return OD_SUCCESSFUL;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   176
  }
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   177
  else { /* Error ! */
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   178
    *pExpectedSize = szData;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   179
    accessDictionaryError(wIndex, bSubindex, szData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   180
                          *pExpectedSize, OD_LENGTH_DATA_INVALID);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   181
    return OD_LENGTH_DATA_INVALID;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   182
  }
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   183
}
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   184
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   185
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   186
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   187
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   188
** @param d
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   189
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   190
** @param bSubindex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   191
** @param pDestData
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   192
** @param pExpectedSize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   193
** @param pDataType
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   194
** @param checkAccess
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   195
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   196
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   197
**/
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   198
UNS32 getODentry( CO_Data* d,
175
e255529b6f7d Added writeLocalDict and readLocalDict, that have to be called from application instead of getODEntry and setODEntry. Fix potential endianization problem.
etisserant
parents: 161
diff changeset
   199
                  UNS16 wIndex,
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   200
                  UNS8 bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   201
                  void * pDestData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   202
                  UNS8 * pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   203
                  UNS8 * pDataType,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   204
                  UNS8 checkAccess)
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   205
{
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   206
  return _getODentry( d,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   207
                      wIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   208
                      bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   209
                      pDestData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   210
                      pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   211
                      pDataType,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   212
                      checkAccess,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   213
                      1);//endianize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   214
}
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   215
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   216
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   217
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   218
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   219
** @param d
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   220
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   221
** @param bSubindex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   222
** @param pDestData
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   223
** @param pExpectedSize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   224
** @param pDataType
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   225
** @param checkAccess
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   226
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   227
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   228
**/
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   229
UNS32 readLocalDict( CO_Data* d,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   230
                     UNS16 wIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   231
                     UNS8 bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   232
                     void * pDestData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   233
                     UNS8 * pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   234
                     UNS8 * pDataType,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   235
                     UNS8 checkAccess)
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   236
{
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   237
  return _getODentry( d,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   238
                      wIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   239
                      bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   240
                      pDestData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   241
                      pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   242
                      pDataType,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   243
                      checkAccess,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   244
                      0);//do not endianize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   245
}
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   246
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   247
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   248
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   249
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   250
** @param d
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   251
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   252
** @param bSubindex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   253
** @param pSourceData
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   254
** @param pExpectedSize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   255
** @param checkAccess
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   256
** @param endianize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   257
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   258
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   259
**/
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   260
UNS32 _setODentry( CO_Data* d,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   261
                   UNS16 wIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   262
                   UNS8 bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   263
                   void * pSourceData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   264
                   UNS8 * pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   265
                   UNS8 checkAccess,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   266
                   UNS8 endianize)
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   267
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   268
  UNS8 szData;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   269
  UNS8 dataType;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   270
  UNS32 errorCode;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   271
  const indextable *ptrTable;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   272
  ODCallback_t *Callback;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   273
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   274
  ptrTable =(*d->scanIndexOD)(wIndex, &errorCode, &Callback);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   275
  if (errorCode != OD_SUCCESSFUL)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   276
    return errorCode;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   277
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   278
  if( ptrTable->bSubCount <= bSubindex ) {
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   279
    /* Subindex not found */
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   280
    accessDictionaryError(wIndex, bSubindex, 0, *pExpectedSize, OD_NO_SUCH_SUBINDEX);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   281
    return OD_NO_SUCH_SUBINDEX;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   282
  }
1
b3dc740b4b04 Commit some Fix from Francis on sdo.c and abjacces.c. Fix endianisation problems while accessing OD. Also fix SDO abord handling bug.
etisserant
parents: 0
diff changeset
   283
  if (checkAccess && (ptrTable->pSubindex[bSubindex].bAccessType == RO)) {
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   284
    MSG_WAR(0x2B25, "Access Type : ", ptrTable->pSubindex[bSubindex].bAccessType);
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   285
    accessDictionaryError(wIndex, bSubindex, 0, *pExpectedSize, OD_WRITE_NOT_ALLOWED);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   286
    return OD_WRITE_NOT_ALLOWED;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   287
  }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   288
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   289
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   290
  dataType = ptrTable->pSubindex[bSubindex].bDataType;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   291
  szData = ptrTable->pSubindex[bSubindex].size;
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   292
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   293
  if( *pExpectedSize == 0 ||
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   294
      *pExpectedSize == szData ||
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   295
      (dataType == visible_string && *pExpectedSize < szData)) /* We
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   296
                                                                  allow to store a shorter string than entry size */
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   297
    {
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   298
#ifdef CANOPEN_BIG_ENDIAN
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   299
      if(endianize && dataType > boolean && dataType < visible_string)
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   300
        {
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   301
          /* we invert the data source directly. This let us do range
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   302
            testing without */
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   303
          /* additional temp variable */
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   304
          UNS8 i;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   305
          for ( i = 0 ; i < ( ptrTable->pSubindex[bSubindex].size >> 1)  ; i++)
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   306
            {
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   307
              UNS8 tmp =((UNS8 *)pSourceData) [(ptrTable->pSubindex[bSubindex].size - 1) - i];
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   308
              ((UNS8 *)pSourceData) [(ptrTable->pSubindex[bSubindex].size - 1) - i] = ((UNS8 *)pSourceData)[i];
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   309
              ((UNS8 *)pSourceData)[i] = tmp;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   310
            }
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   311
        }
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   312
#endif
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   313
      errorCode = (*d->valueRangeTest)(dataType, pSourceData);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   314
      if (errorCode) {
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   315
        accessDictionaryError(wIndex, bSubindex, szData, *pExpectedSize, errorCode);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   316
        return errorCode;
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   317
      }
2
8d4a822f95e4 Fixed Endianisation/ValueRange order in SetODentry
etisserant
parents: 1
diff changeset
   318
      memcpy(ptrTable->pSubindex[bSubindex].pObject,pSourceData, *pExpectedSize);
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   319
      *pExpectedSize = szData;
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   320
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   321
      /* Callbacks */
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   322
      if(Callback && Callback[bSubindex]){
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   323
        (*Callback[bSubindex])(d, ptrTable, bSubindex);
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   324
      }
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   325
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 208
diff changeset
   326
      /* TODO : Store dans NVRAM */
161
c4908cc776a9 SetODEntry now call CO_data->storeODSubEntry(Index,SubIndex) for variables to be Stored (when column Save==True in GUI)
etisserant
parents: 75
diff changeset
   327
      if (ptrTable->pSubindex[bSubindex].bAccessType & TO_BE_SAVE){
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   328
        (*d->storeODSubIndex)(wIndex, bSubindex);
161
c4908cc776a9 SetODEntry now call CO_data->storeODSubEntry(Index,SubIndex) for variables to be Stored (when column Save==True in GUI)
etisserant
parents: 75
diff changeset
   329
      }
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   330
      return OD_SUCCESSFUL;
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   331
    }else{
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   332
      *pExpectedSize = szData;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   333
      accessDictionaryError(wIndex, bSubindex, szData, *pExpectedSize, OD_LENGTH_DATA_INVALID);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   334
      return OD_LENGTH_DATA_INVALID;
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   335
    }
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   336
}
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   337
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   338
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   339
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   340
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   341
** @param d
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   342
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   343
** @param bSubindex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   344
** @param pSourceData
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   345
** @param pExpectedSize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   346
** @param checkAccess
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   347
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   348
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   349
**/
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   350
UNS32 setODentry( CO_Data* d,
175
e255529b6f7d Added writeLocalDict and readLocalDict, that have to be called from application instead of getODEntry and setODEntry. Fix potential endianization problem.
etisserant
parents: 161
diff changeset
   351
                  UNS16 wIndex,
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   352
                  UNS8 bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   353
                  void * pSourceData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   354
                  UNS8 * pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   355
                  UNS8 checkAccess)
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   356
{
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   357
  return _setODentry( d,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   358
                      wIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   359
                      bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   360
                      pSourceData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   361
                      pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   362
                      checkAccess,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   363
                      1);//endianize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   364
}
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   365
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   366
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   367
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   368
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   369
** @param d
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   370
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   371
** @param bSubindex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   372
** @param pSourceData
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   373
** @param pExpectedSize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   374
** @param checkAccess
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   375
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   376
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   377
**/
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   378
UNS32 writeLocalDict( CO_Data* d,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   379
                      UNS16 wIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   380
                      UNS8 bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   381
                      void * pSourceData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   382
                      UNS8 * pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   383
                      UNS8 checkAccess)
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   384
{
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   385
  return _setODentry( d,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   386
                      wIndex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   387
                      bSubindex,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   388
                      pSourceData,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   389
                      pExpectedSize,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   390
                      checkAccess,
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   391
                      0);//do not endianize
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   392
}
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   393
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   394
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   395
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   396
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   397
** @param d
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   398
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   399
** @param errorCode
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   400
** @param Callback
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   401
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   402
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   403
**/
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   404
const indextable * scanIndexOD (CO_Data* d, UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   405
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   406
  return (*d->scanIndexOD)(wIndex, errorCode, Callback);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   407
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   408
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   409
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   410
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   411
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   412
** @param d
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   413
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   414
** @param bSubindex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   415
** @param Callback
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   416
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   417
** @return
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   418
**/
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   419
UNS32 RegisterSetODentryCallBack(CO_Data* d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   420
{
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   421
  UNS32 errorCode;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   422
  ODCallback_t *CallbackList;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   423
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   424
  scanIndexOD (d, wIndex, &errorCode, &CallbackList);
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   425
  if(errorCode == OD_SUCCESSFUL && CallbackList)
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   426
    CallbackList[bSubindex] = Callback;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   427
  return errorCode;
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   428
}
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   429
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   430
/*!
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   431
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   432
**
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   433
** @param wIndex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   434
** @param bSubindex
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 175
diff changeset
   435
**/
161
c4908cc776a9 SetODEntry now call CO_data->storeODSubEntry(Index,SubIndex) for variables to be Stored (when column Save==True in GUI)
etisserant
parents: 75
diff changeset
   436
void _storeODSubIndex (UNS16 wIndex, UNS8 bSubindex){}