]> rtime.felk.cvut.cz Git - CanFestival-3.git/blob - examples/TestMasterSlaveLSS/SlaveB.c
added canChangeBaudRate to the driver interface
[CanFestival-3.git] / examples / TestMasterSlaveLSS / SlaveB.c
1 /*
2 This file is part of CanFestival, a library implementing CanOpen Stack. 
3
4 Copyright (C): Edouard TISSERANT and Francis DUPIN
5
6 See COPYING file for copyrights details.
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 */
22
23 #include "SlaveB.h"
24 #include "Master.h"
25 #include "TestMasterSlaveLSS.h"
26
27 /*****************************************************************************/
28 void TestSlaveB_heartbeatError(CO_Data* d, UNS8 heartbeatID)
29 {
30         eprintf("TestSlaveB_heartbeatError %d\n", heartbeatID);
31 }
32
33 void TestSlaveB_initialisation(CO_Data* d)
34 {
35         eprintf("TestSlaveB_initialisation\n");
36 }
37
38 void TestSlaveB_preOperational(CO_Data* d)
39 {
40         eprintf("TestSlaveB_preOperational\n");
41 }
42
43 void TestSlaveB_operational(CO_Data* d)
44 {
45         eprintf("TestSlaveB_operational\n");
46 }
47
48 void TestSlaveB_stopped(CO_Data* d)
49 {
50         eprintf("TestSlaveB_stopped\n");
51 }
52
53 void TestSlaveB_post_sync(CO_Data* d)
54 {
55       eprintf("TestSlaveB_post_sync\n");
56 }
57
58 void TestSlaveB_post_TPDO(CO_Data* d)
59 {
60         eprintf("TestSlaveB_post_TPDO\n");      
61         SlaveBMap1+=16;
62 }
63
64 void TestSlaveB_storeODSubIndex(CO_Data* d, UNS16 wIndex, UNS8 bSubindex)
65 {
66         /*TODO : 
67          * - call getODEntry for index and subindex, 
68          * - save content to file, database, flash, nvram, ...
69          * 
70          * To ease flash organisation, index of variable to store
71          * can be established by scanning d->objdict[d->ObjdictSize]
72          * for variables to store.
73          * 
74          * */
75         eprintf("TestSlaveB_storeODSubIndex : %4.4x %2.2x\n", wIndex,  bSubindex);
76 }
77
78 void TestSlaveB_post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg)
79 {
80         eprintf("SlaveB received EMCY message. Node: %2.2x  ErrorCode: %4.4x  ErrorRegister: %2.2x\n", nodeID, errCode, errReg);
81 }
82
83 void TestSlaveB_StoreConfiguration(CO_Data* d, UNS8 *error, UNS8 *spec_error)
84 {
85         printf("TestSlaveB_StoreConfiguration\n");
86 }
87