nico@215: nico@215: nico@215: CanFestival: examples/TestMasterSlave/Slave.c Source File nico@215: nico@215: nico@215: nico@215: nico@215:
nico@215:
nico@215:
nico@215:
nico@215: nico@215:

Slave.c

Go to the documentation of this file.
00001 /*
nico@215: 00002 This file is part of CanFestival, a library implementing CanOpen Stack. 
nico@215: 00003 
nico@215: 00004 Copyright (C): Edouard TISSERANT and Francis DUPIN
nico@215: 00005 
nico@215: 00006 See COPYING file for copyrights details.
nico@215: 00007 
nico@215: 00008 This library is free software; you can redistribute it and/or
nico@215: 00009 modify it under the terms of the GNU Lesser General Public
nico@215: 00010 License as published by the Free Software Foundation; either
nico@215: 00011 version 2.1 of the License, or (at your option) any later version.
nico@215: 00012 
nico@215: 00013 This library is distributed in the hope that it will be useful,
nico@215: 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
nico@215: 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
nico@215: 00016 Lesser General Public License for more details.
nico@215: 00017 
nico@215: 00018 You should have received a copy of the GNU Lesser General Public
nico@215: 00019 License along with this library; if not, write to the Free Software
nico@215: 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
nico@215: 00021 */
nico@215: 00022 
nico@215: 00023 #include "Slave.h"
nico@215: 00024 #include "Master.h"
nico@215: 00025 #include "TestMasterSlave.h"
nico@215: 00026 
nico@215: 00027 /*****************************************************************************/
etisserant@240: 00028 void TestSlave_heartbeatError(UNS8 heartbeatID)
nico@215: 00029 {
etisserant@240: 00030         eprintf("TestSlave_heartbeatError %d\n", heartbeatID);
nico@215: 00031 }
nico@215: 00032 
etisserant@240: 00033 void TestSlave_initialisation()
nico@215: 00034 {
etisserant@240: 00035         eprintf("TestSlave_initialisation\n");
nico@215: 00036 }
nico@215: 00037 
etisserant@240: 00038 void TestSlave_preOperational()
nico@215: 00039 {
etisserant@240: 00040         eprintf("TestSlave_preOperational\n");
nico@215: 00041 }
nico@215: 00042 
etisserant@240: 00043 void TestSlave_operational()
nico@215: 00044 {
etisserant@240: 00045         eprintf("TestSlave_operational\n");
nico@215: 00046 }
nico@215: 00047 
etisserant@240: 00048 void TestSlave_stopped()
nico@215: 00049 {
etisserant@240: 00050         eprintf("TestSlave_stopped\n");
nico@215: 00051 }
nico@215: 00052 
etisserant@240: 00053 void TestSlave_post_sync()
nico@215: 00054 {
etisserant@240: 00055       eprintf("TestSlave_post_sync\n");
nico@215: 00056       
etisserant@240: 00057       SlaveMap1=1;
etisserant@240: 00058       SlaveMap2=1;
etisserant@240: 00059       SlaveMap3=0;
etisserant@240: 00060       SlaveMap4=0;
etisserant@240: 00061       SlaveMap5=1;
etisserant@240: 00062       SlaveMap6=0;
etisserant@240: 00063       SlaveMap7=1;
etisserant@240: 00064       SlaveMap8=0;
etisserant@240: 00065       SlaveMap9=16;
etisserant@240: 00066       SlaveMap10 = 0xff00ff00;
etisserant@240: 00067       SlaveMap11 = 0xabcd;
etisserant@240: 00068       SlaveMap12 += SlaveMap12 > 0x80 ? 0 : 1;
etisserant@240: 00069       eprintf("Slave: %d %d %d %d %d %d %d %d %d %x %x %d %d \n",
etisserant@240: 00070         SlaveMap1, 
etisserant@240: 00071         SlaveMap2, 
etisserant@240: 00072         SlaveMap3, 
etisserant@240: 00073         SlaveMap4, 
etisserant@240: 00074         SlaveMap5, 
etisserant@240: 00075         SlaveMap6, 
etisserant@240: 00076         SlaveMap7, 
etisserant@240: 00077         SlaveMap8, 
etisserant@240: 00078         SlaveMap9, 
etisserant@240: 00079         SlaveMap10,
etisserant@240: 00080         SlaveMap11, 
etisserant@240: 00081         SlaveMap12,
etisserant@240: 00082         SlaveMap13);
etisserant@240: 00083 }
etisserant@240: 00084 
etisserant@240: 00085 void TestSlave_post_TPDO()
etisserant@240: 00086 {
etisserant@240: 00087         SlaveMap13 += 1;
etisserant@240: 00088         eprintf("TestSlave_post_TPDO\n");
etisserant@240: 00089 }
etisserant@240: 00090 
etisserant@240: 00091 void TestSlave_storeODSubIndex(UNS16 wIndex, UNS8 bSubindex)
etisserant@240: 00092 {
etisserant@240: 00093         /*TODO : 
etisserant@240: 00094          * - call getODEntry for index and subindex, 
etisserant@240: 00095          * - save content to file, database, flash, nvram, ...
etisserant@240: 00096          * 
etisserant@240: 00097          * To ease flash organisation, index of variable to store
etisserant@240: 00098          * can be established by scanning d->objdict[d->ObjdictSize]
etisserant@240: 00099          * for variables to store.
etisserant@240: 00100          * 
etisserant@240: 00101          * */
etisserant@240: 00102         eprintf("TestSlave_storeODSubIndex : %4.4x %2.2x\n", wIndex,  bSubindex);
etisserant@240: 00103 }
etisserant@240: 

Generated on Mon Jul 2 19:10:16 2007 for CanFestival by  nico@215: nico@215: doxygen 1.5.1
nico@215: nico@215: