Changeset 233 in tmcsimulator for branches/FEPSimulator/FEPSim.cpp
- Timestamp:
- 11/13/2017 06:07:07 PM (8 years ago)
- File:
-
- 1 edited
-
branches/FEPSimulator/FEPSim.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/FEPSimulator/FEPSim.cpp
r224 r233 1 1 #include "FEPSim.h" 2 #include <time.h> 3 2 3 /** 4 * Constructor. Sets data values for RPC Client and socket server. 5 * 6 * @param ATMSHost The IP of ATMS Server 7 * @param FEP RPC program number 8 * @param FEP RPC program revision number 9 * @param Socket Server listen port 10 */ 4 11 FEPSim::FEPSim(char * ATMShost, int FEP_PROG, int FEP_REV, int SOCK_PORT) { 5 12 this->ATMSHost = ATMShost; … … 13 20 } 14 21 22 /** 23 * Destructor: closes the log file if open 24 */ 15 25 FEPSim::~FEPSim() { 16 26 FEPLogFile.close(); 17 27 } 18 28 29 /** 30 * Handler for the ATMS RPC Response (to the client RPC Call) 31 * @param response pointer to fep_reply struct 32 */ 19 33 void FEPSim::handleCallResponse(void *response) { 20 34 // Failed RPC Call … … 28 42 } 29 43 44 /** 45 * Sends an fep_reply for each station on the FEPLine. 46 * Gets highway status from recieved socket msg. 47 * 48 * @param buffer The recieved highway status msg. 49 */ 30 50 void FEPSim::sendReplys(char * buffer) { 31 51 HighwaysParser highwaysParser = HighwaysParser(buffer); … … 106 126 } 107 127 128 /** 129 * Creates an RPC Client, and on successful creation, sends fep_replys to ATMS. 130 * @param The recieved highway status msg. 131 */ 108 132 void FEPSim::manageClientConnection(char * buffer) 109 133 { … … 120 144 } 121 145 122 146 /** 147 * Creates an RPC Client to the ATMS Server. If unsuccessful, returns false 148 * @return bool success 149 */ 123 150 bool FEPSim::createClient() { 124 151 /* Create RPC Client to communicate with ATMS */ … … 137 164 } 138 165 166 /** 167 * Creates a socket server and awaits the highway status message from the 168 * ATMS Driver. Upon receipt of the highway status message, creates an RPC 169 * client and sends the fep_replys to the ATMS. 170 */ 139 171 void FEPSim::runSockServer() { 140 172 int sockfd, newsockfd, portno, clilen;
Note: See TracChangeset
for help on using the changeset viewer.
