diff -r 2cb34a4ac65a -r 6b5a4c21e061 doc/doxygen/html/dcf_8c-source.html --- a/doc/doxygen/html/dcf_8c-source.html Tue Jun 05 17:34:33 2007 +0200 +++ b/doc/doxygen/html/dcf_8c-source.html Tue Jun 05 18:43:21 2007 +0200 @@ -16,118 +16,115 @@
  • Globals
  • /home/epimerde/documents/tc11/CanFestival-3/src/dcf.c

    Go to the documentation of this file.
    00001 /*
    -00002 This file is part of CanFestival, a library implementing CanOpen Stack. 
    -00003 
    -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN
    -00005 
    -00006 See COPYING file for copyrights details.
    -00007 
    -00008 This library is free software; you can redistribute it and/or
    -00009 modify it under the terms of the GNU Lesser General Public
    -00010 License as published by the Free Software Foundation; either
    -00011 version 2.1 of the License, or (at your option) any later version.
    -00012 
    -00013 This library is distributed in the hope that it will be useful,
    -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    -00016 Lesser General Public License for more details.
    -00017 
    -00018 You should have received a copy of the GNU Lesser General Public
    -00019 License along with this library; if not, write to the Free Software
    -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    -00021 */
    -00022 
    -00023 #include "objacces.h"
    -00024 #include "sdo.h"
    -00025 #include "dcf.h"
    -00026 #include "sysdep.h"
    -00027 
    -00028 
    -00029 
    -00030 extern UNS8 _writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, 
    -00031                        UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize);
    -00032 
    -00033 const indextable *ptrTable;
    -00034 
    -00035 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId)
    -00036 {
    -00037         UNS32 abortCode;
    -00038         
    -00039         if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED)
    -00040         {
    -00041                 MSG_ERR(0x1A01, "SDO error in consise DCF", abortCode);
    -00042                 MSG_WAR(0x2A02, "server node : ", nodeId);
    -00043         }
    -00044 
    -00045         closeSDOtransfer(d, nodeId, SDO_CLIENT);
    -00046         decompo_dcf(d,nodeId);
    -00047 }
    -00048 
    -00049 UNS32 decompo_dcf(CO_Data* d,UNS8 nodeId)
    -00050 {
    -00051                 UNS32 errorCode;
    -00052                 UNS16 target_Index;
    -00053                 UNS8 target_Subindex;
    -00054                 UNS32 target_Size;
    -00055                 UNS32 res;
    -00056                 ODCallback_t *Callback;
    -00057 
    -00058                 ptrTable = (*d->scanIndexOD)(0x1F22, &errorCode, &Callback);
    -00059                 if (errorCode != OD_SUCCESSFUL)
    -00060                 {
    -00061                 return errorCode;
    -00062                 }
    -00063 
    -00064                 /*Loop on all Nodes supported in DCF subindexes*/
    -00065                 while (nodeId < ptrTable->bSubCount){
    -00066                         UNS32 nb_targets;
    -00067                         
    -00068                         UNS8 szData = ptrTable->pSubindex[nodeId].size;
    -00069                         UNS8* dcfend;
    -00070                         
    -00071                         {
    -00072                                 UNS8* dcf = *((UNS8**)ptrTable->pSubindex[nodeId].pObject);
    -00073                                 dcfend = dcf + szData;
    -00074                                 if (!d->dcf_cursor)     {
    -00075                                         d->dcf_cursor = (UNS8*)dcf + 4;
    -00076                                         d->dcf_count_targets = 0;
    -00077                                 }
    -00078                                 nb_targets = UNS32_LE(*((UNS32*)dcf));
    -00079                         }
    -00080                         
    -00081                         // condition on consise DCF string for NodeID, if big enough
    -00082                         if((UNS8*)d->dcf_cursor + 7 < (UNS8*)dcfend && d->dcf_count_targets < nb_targets)
    -00083                         {
    -00084                                 // pointer to the DCF string for NodeID
    -00085                                 target_Index = UNS16_LE(*((UNS16*)(d->dcf_cursor))); d->dcf_cursor += 2;
    -00086                                 target_Subindex = *((UNS8*)(((UNS8*)d->dcf_cursor)++));
    -00087                                 target_Size = UNS32_LE(*((UNS32*)(d->dcf_cursor))); d->dcf_cursor += 4;
    -00088                                         
    -00089                                         /*printf("Master : ConfigureSlaveNode %2.2x (Concise DCF)\n",nodeId);*/
    -00090                                         res = _writeNetworkDict(d, /*CO_Data* d*/
    -00091                                                         nodeId, /*UNS8 nodeId*/
    -00092                                                         target_Index, /*UNS16 index*/
    -00093                                                         target_Subindex, /*UNS8 subindex*/
    -00094                                                         target_Size, /*UNS8 count*/
    -00095                                                         0, /*UNS8 dataType*/
    -00096                                                         d->dcf_cursor,/*void *data*/
    -00097                                                         CheckSDOAndContinue,/*SDOCallback_t Callback*/  
    -00098                                                         0); /* no endianize             */
    -00099                                         /*Push d->dcf_cursor to the end of data*/
    -00100                                         
    -00101                                         d->dcf_cursor += target_Size;
    -00102                                         d->dcf_count_targets++;
    -00103                                         
    -00104                                         return ;
    -00105                         }                       
    -00106                                 nodeId++;
    -00107                                 d->dcf_cursor = NULL;
    -00108                 }
    -00109                 /* Switch Master to preOperational state */
    -00110                 (*d->preOperational)();
    -00111                 
    -00112 }
    -

    Generated on Mon Jun 4 17:09:26 2007 for CanFestival by  +00002 This file is part of CanFestival, a library implementing CanOpen +00003 Stack. +00004 +00005 Copyright (C): Edouard TISSERANT and Francis DUPIN +00006 +00007 See COPYING file for copyrights details. +00008 +00009 This library is free software; you can redistribute it and/or +00010 modify it under the terms of the GNU Lesser General Public +00011 License as published by the Free Software Foundation; either +00012 version 2.1 of the License, or (at your option) any later version. +00013 +00014 This library is distributed in the hope that it will be useful, +00015 but WITHOUT ANY WARRANTY; without even the implied warranty of +00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +00017 Lesser General Public License for more details. +00018 +00019 You should have received a copy of the GNU Lesser General Public +00020 License along with this library; if not, write to the Free Software +00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +00022 USA +00023 */ +00024 +00025 +00035 #include "objacces.h" +00036 #include "sdo.h" +00037 #include "dcf.h" +00038 #include "sysdep.h" +00039 +00040 +00054 extern UNS8 _writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, +00055 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize); +00056 +00057 const indextable *ptrTable; +00058 +00065 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId) +00066 { +00067 UNS32 abortCode; +00068 +00069 if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED) +00070 { +00071 MSG_ERR(0x1A01, "SDO error in consise DCF", abortCode); +00072 MSG_WAR(0x2A02, "server node : ", nodeId); +00073 } +00074 +00075 closeSDOtransfer(d, nodeId, SDO_CLIENT); +00076 decompo_dcf(d,nodeId); +00077 } +00078 +00087 UNS32 decompo_dcf(CO_Data* d,UNS8 nodeId) +00088 { +00089 UNS32 errorCode; +00090 UNS16 target_Index; +00091 UNS8 target_Subindex; +00092 UNS32 target_Size; +00093 UNS32 res; +00094 ODCallback_t *Callback; +00095 +00096 ptrTable = (*d->scanIndexOD)(0x1F22, &errorCode, &Callback); +00097 if (errorCode != OD_SUCCESSFUL) +00098 { +00099 return errorCode; +00100 } +00101 +00103 while (nodeId < ptrTable->bSubCount){ +00104 UNS32 nb_targets; +00105 +00106 UNS8 szData = ptrTable->pSubindex[nodeId].size; +00107 UNS8* dcfend; +00108 +00109 { +00110 UNS8* dcf = *((UNS8**)ptrTable->pSubindex[nodeId].pObject); +00111 dcfend = dcf + szData; +00112 if (!d->dcf_cursor){ +00113 d->dcf_cursor = (UNS8*)dcf + 4; +00114 d->dcf_count_targets = 0; +00115 } +00116 nb_targets = UNS32_LE(*((UNS32*)dcf)); +00117 } +00118 +00120 if((UNS8*)d->dcf_cursor + 7 < (UNS8*)dcfend && d->dcf_count_targets < nb_targets) +00121 { +00123 target_Index = UNS16_LE(*((UNS16*)(d->dcf_cursor))); d->dcf_cursor += 2; +00124 target_Subindex = *((UNS8*)(((UNS8*)d->dcf_cursor)++)); +00125 target_Size = UNS32_LE(*((UNS32*)(d->dcf_cursor))); d->dcf_cursor += 4; +00126 +00127 /* printf("Master : ConfigureSlaveNode %2.2x (Concise +00128 DCF)\n",nodeId);*/ +00129 res = _writeNetworkDict(d, +00130 nodeId, +00131 target_Index, +00132 target_Subindex, +00133 target_Size, +00134 0, +00135 d->dcf_cursor, +00136 CheckSDOAndContinue, +00138 0); +00141 d->dcf_cursor += target_Size; +00142 d->dcf_count_targets++; +00143 +00144 return ; +00145 } +00146 nodeId++; +00147 d->dcf_cursor = NULL; +00148 } +00150 (*d->preOperational)(); +00151 +00152 } +
    Generated on Tue Jun 5 18:32:05 2007 for CanFestival by  doxygen 1.5.1