Changeset 1138 for trunk/MagicSoft/Cosy/candrv/network.cc
- Timestamp:
- 12/21/01 11:59:50 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/candrv/network.cc
r1109 r1138 1 /* ======================================================================== *\ 2 ! 3 ! * 4 ! * This file is part of Stesy, the MAGIC Steering System 5 ! * Software. It is distributed to you in the hope that it can be a useful 6 ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. 7 ! * It is distributed WITHOUT ANY WARRANTY. 8 ! * 9 ! * Permission to use, copy, modify and distribute this software and its 10 ! * documentation for any purpose is hereby granted without fee, 11 ! * provided that the above copyright notice appear in all copies and 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 14 ! * or implied warranty. 15 ! * 16 ! 17 ! 18 ! Author(s): Thomas Bretz, 2001 <mailto:tbretz@uni-sw.gwdg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2001 21 ! 22 ! 23 \* ======================================================================== */ 24 25 /////////////////////////////////////////////////////////////////////// 26 // 27 // Network 28 // 29 // is a collection of nodes which coordinates the network 30 // 31 /////////////////////////////////////////////////////////////////////// 1 32 #include "network.h" 2 33 … … 6 37 ClassImp(Network); 7 38 39 // -------------------------------------------------------------------------- 40 // 41 // Start the canopen module 42 // Initialize all nodes (calling NodeDrv::Init() 43 // 8 44 void Network::Start() 9 45 { … … 16 52 } 17 53 54 // -------------------------------------------------------------------------- 55 // 56 // Stop all nodes, stop the can module 57 // 18 58 void Network::Stop() 19 59 { … … 26 66 } 27 67 68 // -------------------------------------------------------------------------- 69 // 70 // Initialize the network, set all nodes to NULL (n/a) 71 // 28 72 Network::Network(const char *dev, const int baud, MLog &out) : CanOpen(dev, baud, out) 29 73 { … … 32 76 } 33 77 78 // -------------------------------------------------------------------------- 79 // 80 // Distributes the received SDO messages to the addressed nodes. 81 // Depending on the received command either HandleSDO, HandleSDOOK or 82 // HandleSDOError called. 83 // HandleSDO: Handles a received value 84 // HandleSDOOK: Handles the acknoledgment of a trasmitted SDO 85 // HandleSDOError: Handles error occursion (see CanOpen standard) 86 // 34 87 void Network::HandleSDO(BYTE_t node, BYTE_t cmd, WORD_t idx, BYTE_t subidx, LWORD_t data, struct timeval *tv) 35 88 { … … 82 135 } 83 136 137 // -------------------------------------------------------------------------- 138 // 139 // Distributes PDO1 messages to the correspoding node calling HandlePDO1 140 // 84 141 void Network::HandlePDO1(BYTE_t node, BYTE_t *data, struct timeval *tv) 85 142 { … … 96 153 } 97 154 155 // -------------------------------------------------------------------------- 156 // 157 // Distributes PDO2 messages to the correspoding node calling HandlePDO2 158 // 98 159 void Network::HandlePDO2(BYTE_t node, BYTE_t *data, struct timeval *tv) 99 160 { … … 110 171 } 111 172 173 // -------------------------------------------------------------------------- 174 // 175 // Distributes PDO3 messages to the correspoding node calling HandlePDO3 176 // 112 177 void Network::HandlePDO3(BYTE_t node, BYTE_t *data, struct timeval *tv) 113 178 { … … 124 189 } 125 190 191 // -------------------------------------------------------------------------- 192 // 193 // Distributes PDO4 messages to the correspoding node calling HandlePDO4 194 // 126 195 void Network::HandlePDO4(BYTE_t node, BYTE_t *data, struct timeval *tv) 127 196 { … … 138 207 } 139 208 209 // -------------------------------------------------------------------------- 210 // 211 // Sets a node to a given nodedrv. The id is requested from the drv object. 212 // 140 213 void Network::SetNode(NodeDrv *drv) 141 214 { … … 151 224 } 152 225 226 // -------------------------------------------------------------------------- 227 // 228 // Initializes all nodes calling InitDevice 229 // 153 230 void Network::InitNodes() 154 231 { … … 163 240 } 164 241 242 // -------------------------------------------------------------------------- 243 // 244 // Stop all nodes calling StopDevice 245 // 165 246 void Network::StopNodes() 166 247 { … … 174 255 } 175 256 257 // -------------------------------------------------------------------------- 258 // 259 // returns true if one of the nodes has the error-flag set (HasError). 260 // 176 261 bool Network::HasError() const 177 262 {
Note:
See TracChangeset
for help on using the changeset viewer.