src/dcf.c
author fbeaulier
Tue, 16 Aug 2011 14:15:52 +0200
changeset 663 70fc3603e36f
parent 609 c59dce78bbad
child 668 ba53613e94e4
permissions -rw-r--r--
timers_unix.c : remove sigint and sigterm catch
sdo : Allow multiple servers
The sdo transfer struct is not anymore referenced by server's node id but by
client or server number in the OD. Node id is not relevant in SDO transfert.
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
     1
/*
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
     2
  This file is part of CanFestival, a library implementing CanOpen
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
     3
  Stack.
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
     4
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
     5
  Copyright (C): Edouard TISSERANT and Francis DUPIN
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
     6
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
     7
  See COPYING file for copyrights details.
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
     8
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
     9
  This library is free software; you can redistribute it and/or
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    10
  modify it under the terms of the GNU Lesser General Public
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    11
  License as published by the Free Software Foundation; either
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    12
  version 2.1 of the License, or (at your option) any later version.
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    13
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    14
  This library is distributed in the hope that it will be useful,
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    15
  but WITHOUT ANY WARRANTY; without even the implied warranty of
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    16
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    17
  Lesser General Public License for more details.
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    18
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    19
  You should have received a copy of the GNU Lesser General Public
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    20
  License along with this library; if not, write to the Free Software
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    21
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    22
  USA
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    23
*/
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    24
210
6b5a4c21e061 Manual and Documentation finish
nico
parents: 208
diff changeset
    25
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 207
diff changeset
    26
/**
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    27
** @file   dcf.c
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    28
** @author Edouard TISSERANT and Francis DUPIN
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    29
** @date   Mon Jun  4 17:06:12 2007
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    30
**
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 207
diff changeset
    31
** @brief EXEMPLE OF SOMMARY
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    32
**
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    33
**
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    34
*/
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
    35
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
    36
378
d2abf6c8c27b As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents: 368
diff changeset
    37
#include "data.h"
200
930be51ddc24 Big Endian fixes.
etisserant
parents: 191
diff changeset
    38
#include "sysdep.h"
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    39
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    40
extern UNS8 _writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index,
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    41
                               UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize);
204
44ce74232ccb Some fixes for visual studio C compiler compatiblity.
etisserant
parents: 202
diff changeset
    42
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    43
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
    44
static void send_consise_dcf_loop(CO_Data* d,UNS8 nodeId);
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
    45
478
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    46
/* Seek to next NodeID's DCF */
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    47
#define SEEK_NEXT_DCF() \
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    48
   	nodeId=(nodeId+1) % d->dcf_odentry->bSubCount; \
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    49
   	if(nodeId==0) nodeId=1; \
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    50
   	d->dcf_cursor = NULL;
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    51
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 207
diff changeset
    52
/**
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    53
**
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    54
**
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    55
** @param d
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    56
** @param nodeId
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 207
diff changeset
    57
*/
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    58
static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId)
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    59
{
478
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    60
  UNS32 abortCode = 0;
191
1e6e3d261b8f CleanUp and minor fixes
etisserant
parents: 178
diff changeset
    61
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    62
  if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED)
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    63
    {
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    64
      MSG_ERR(0x1A01, "SDO error in consise DCF", abortCode);
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    65
      MSG_WAR(0x2A02, "server node : ", nodeId);
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    66
    }
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    67
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    68
  closeSDOtransfer(d, nodeId, SDO_CLIENT);
478
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    69
  /* Timedout ? */
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    70
  if(abortCode == SDOABT_TIMED_OUT){
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    71
    /* Node may not be ready, try another one */
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    72
    /* Warning, this might leed to endless attempts */
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    73
    /* if node does never answer */
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    74
	SEEK_NEXT_DCF()
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
    75
  }
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
    76
  send_consise_dcf_loop(d,nodeId);
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    77
}
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    78
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
    79
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 207
diff changeset
    80
/**
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    81
**
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    82
**
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    83
** @param d
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    84
** @param nodeId
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    85
**
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
    86
** @return
208
05d95c45b388 Manual convertion -> latex -> pdf
nico
parents: 207
diff changeset
    87
*/
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
    88
UNS8 send_consise_dcf(CO_Data* d,UNS8 nodeId)
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
    89
{
587
c175351a6994 fix warnings with msvc compiler
greg
parents: 478
diff changeset
    90
  UNS32 szData;
320
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    91
  /* Fetch DCF OD entry, if not already done */
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    92
  if(!d->dcf_odentry)
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    93
  {
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    94
    UNS32 errorCode;
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    95
    ODCallback_t *Callback;
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    96
    d->dcf_odentry = (*d->scanIndexOD)(0x1F22, &errorCode, &Callback);
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    97
    /* If DCF entry do not exist... Nothing to do.*/
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    98
    if (errorCode != OD_SUCCESSFUL) goto DCF_finish;
f82e758840bd Some fixes suggested by Luis Jim?nez, plus some minor enhancements in DCF.
etisserant
parents: 251
diff changeset
    99
  }
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
   100
361
2220813498f2 Added FastScan support to the LSS services.
groke6
parents: 353
diff changeset
   101
  szData = d->dcf_odentry->pSubindex[nodeId].size;
2220813498f2 Added FastScan support to the LSS services.
groke6
parents: 353
diff changeset
   102
  
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   103
  /* if the entry for the nodeId is not empty. */
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   104
  if(szData!=0){
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   105
  	/* if the entry for the nodeId is already been processing, quit.*/
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   106
  	if(d->dcf_odentry->pSubindex[nodeId].bAccessType & DCF_TO_SEND) return 1;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   107
  	
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   108
  	d->dcf_odentry->pSubindex[nodeId].bAccessType|=DCF_TO_SEND;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   109
  	d->dcf_request++;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   110
  	if(d->dcf_request==1)
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   111
  		send_consise_dcf_loop(d,nodeId);
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   112
  	return 1;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   113
  }
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   114
  
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   115
  DCF_finish:
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   116
  return 0;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   117
}
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
   118
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   119
static void send_consise_dcf_loop(CO_Data* d,UNS8 nodeId)
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   120
{
609
c59dce78bbad Verify if nodeId is strictly lesser than subindex entries count at the beginning of send_consise_dcf_loop function
greg
parents: 587
diff changeset
   121
  if(nodeId > d->dcf_odentry->bSubCount) return;
c59dce78bbad Verify if nodeId is strictly lesser than subindex entries count at the beginning of send_consise_dcf_loop function
greg
parents: 587
diff changeset
   122
/* Loop on all DCF subindexes, corresponding to node ID until there is no request*/
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   123
  //while (nodeId < d->dcf_odentry->bSubCount){
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   124
  while (d->dcf_request>0){
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   125
  	if(d->dcf_odentry->pSubindex[nodeId].bAccessType & DCF_TO_SEND){   	 
368
7b51757bfc81 changed order of declaration/initialization of variables to prevent some warnings
etisserant
parents: 361
diff changeset
   126
        UNS8* dcfend;
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   127
  		UNS32 nb_entries;
587
c175351a6994 fix warnings with msvc compiler
greg
parents: 478
diff changeset
   128
  		UNS32 szData = d->dcf_odentry->pSubindex[nodeId].size;
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   129
      	 
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   130
   		{
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   131
	   		UNS8* dcf = *((UNS8**)d->dcf_odentry->pSubindex[nodeId].pObject);
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   132
   			dcfend = dcf + szData;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   133
	   		if (!d->dcf_cursor){
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   134
    	  		d->dcf_cursor = (UNS8*)dcf + 4;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   135
       			d->dcf_entries_count = 0;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   136
   			}
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   137
   			nb_entries = UNS32_LE(*((UNS32*)dcf));
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   138
   		}
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
   139
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   140
    	/* condition on consise DCF string for NodeID, if big enough */
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   141
    	if((UNS8*)d->dcf_cursor + 7 < (UNS8*)dcfend && d->dcf_entries_count < nb_entries){
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   142
    	
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   143
        	UNS16 target_Index;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   144
        	UNS8 target_Subindex;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   145
        	UNS32 target_Size;
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
   146
474
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   147
			/* DCF data may not be 32/16b aligned, 
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   148
			 * we cannot directly dereference d->dcf_cursor 
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   149
			 * as UNS16 or UNS32 
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   150
			 * Do it byte per byte taking care on endianess*/
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   151
#ifdef CANOPEN_BIG_ENDIAN
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   152
        	target_Index = *(d->dcf_cursor++) << 8 | 
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   153
        	               *(d->dcf_cursor++);
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   154
#else
476
08cdcb021beb serious typo in dcf.c
etisserant
parents: 474
diff changeset
   155
        	memcpy(&target_Index, d->dcf_cursor,2);
474
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   156
        	d->dcf_cursor+=2;
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   157
#endif
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   158
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   159
        	target_Subindex = *(d->dcf_cursor++);
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   160
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   161
#ifdef CANOPEN_BIG_ENDIAN
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   162
        	target_Size = *(d->dcf_cursor++) << 24 | 
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   163
        	              *(d->dcf_cursor++) << 16 | 
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   164
        	              *(d->dcf_cursor++) << 8 | 
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   165
        	              *(d->dcf_cursor++);
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   166
#else
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   167
        	memcpy(&target_Size, d->dcf_cursor,4);
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   168
        	d->dcf_cursor+=4;
09c8c4b6c7df Fixed alignments problems on some 32bit target such as ARM or Xscale.
etisserant
parents: 378
diff changeset
   169
#endif
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   170
	
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   171
    	    _writeNetworkDict(d, /* CO_Data* d*/
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
   172
                                nodeId, /* UNS8 nodeId*/
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
   173
                                target_Index, /* UNS16 index*/
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
   174
                                target_Subindex, /* UNS8 subindex*/
587
c175351a6994 fix warnings with msvc compiler
greg
parents: 478
diff changeset
   175
                                (UNS8)target_Size, /* UNS8 count*/
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
   176
                                0, /* UNS8 dataType*/
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
   177
                                d->dcf_cursor,/* void *data*/
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
   178
                                CheckSDOAndContinue,/* SDOCallback_t
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
   179
                                                      Callback*/
215
f49e5a6b7804 Manual and Documentation finish
nico
parents: 212
diff changeset
   180
                                0); /* no endianize*/
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   181
        	/* Push d->dcf_cursor to the end of data*/
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
   182
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   183
        	d->dcf_cursor += target_Size;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   184
        	d->dcf_entries_count++;
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
   185
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   186
        	/* send_consise_dcf_loop will be called by CheckSDOAndContinue for next DCF entry*/
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   187
        	return;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   188
      	}
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   189
      	else
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   190
      	{
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   191
      		/* We have finished with the dcf entry. Change the flag, decrement the request
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   192
      		 *  and execute the bootup callback. */
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   193
      		d->dcf_odentry->pSubindex[nodeId].bAccessType&=~DCF_TO_SEND;
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   194
      		d->dcf_request--;
378
d2abf6c8c27b As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents: 368
diff changeset
   195
      		(*d->post_SlaveBootup)(d, nodeId);
349
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   196
      	}
1e6dd4ef46b9 fixed the DCF-LSS conflict
groke6
parents: 320
diff changeset
   197
 	}
353
ee08ce0366a7 fixed a bug in consise_dcf_loop() in dcf.c
groke6
parents: 349
diff changeset
   198
 	
478
4306e851d95c Implemented retry on SDO timeout in dcf.c.
etisserant
parents: 476
diff changeset
   199
	SEEK_NEXT_DCF()
207
b6572d0336c3 First doxygen implementation
nico
parents: 204
diff changeset
   200
  }
378
d2abf6c8c27b As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents: 368
diff changeset
   201
178
01d81faa3350 Add concise DCF support
greg
parents:
diff changeset
   202
}