Changeset 435
- Timestamp:
- 08/25/09 13:35:50 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/shell/CognitiveRadioShell.cpp
r433 r435 116 116 CognitiveRadioShell::Shutdown() 117 117 { 118 // TODO should something else be happening here?118 LOG("Shutting down Cognitive Radio Shell.\n"); 119 119 } 120 120 … … 127 127 128 128 129 // TODO what is the point of always returning a 1?130 129 bool 131 130 CognitiveRadioShell::SendRadioConfiguration(int32_t socketFD) … … 189 188 if(strcmp(buffer, "receive_config_ack") != 0) { 190 189 LOG("Cognitive Radio Shell:: Unexpected response: %s\n", buffer); 191 return 0;192 } 193 194 return 1;190 return false; 191 } 192 193 return true; 195 194 } 196 195 … … 204 203 205 204 sprintf(numberExpString, "%d", numberExp); 206 SendMessage(socketFD, "test"); //TODO modified205 SendMessage(socketFD, "test"); 207 206 208 207 char buffer[256]; … … 210 209 ReadMessage(socketFD, buffer); 211 210 if(strcmp(buffer, "receive_exp_ack") != 0) { 212 // TODO perhaps this should be a WARNING instead of a LOG? 213 LOG("Cognitive Radio Shell:: Unexpected response: %s\n", buffer); 214 return 0; 215 } 216 //printf("done sending exp \n"); 217 return 1; 211 WARNING("Cognitive Radio Shell:: Unexpected response: %s\n", buffer); 212 return false; 213 } 214 return true; 218 215 } 219 216 … … 222 219 CognitiveRadioShell::RegisterCognitiveEngine(int32_t socketFD) 223 220 { 224 LOG("Cognitive Radio Shell:: Received registration message from Cognitive Engine.\n"); 221 LOG("Cognitive Radio Shell:: Received registration from Cognitive Engine on socket %d.\n" \ 222 socketFD); 225 223 226 224 SendMessage(socketFD, "register_ack"); … … 229 227 230 228 numberOfCognitiveEngines++; 229 230 /* More efficient to always set to true than add a conditional branch to the 231 * code. */ 231 232 CE_present = true; 232 233 } … … 245 246 shutdown(socketFD, 2); 246 247 close(socketFD); 247 LOG("Cognitive Radio Shell:: Socket closed.\n");248 LOG("Cognitive Radio Shell:: Socket %d closed.\n", socketFD); 248 249 } 249 250 … … 252 253 CognitiveRadioShell::RegisterPolicyEngine(int32_t socketFD) 253 254 { 254 LOG("Cognitive Radio Shell:: Received registration message from Policy Engine.\n"); 255 LOG("Cognitive Radio Shell:: Received registration from Policy Engine on socket %d.\n", \ 256 socketFD); 257 255 258 PE_present = true; 256 259 } … … 267 270 shutdown(socketFD, 2); 268 271 close(socketFD); 269 LOG("Cognitive Radio Shell:: Socket closed.\n");272 LOG("Cognitive Radio Shell:: Socket %d closed.\n", socketFD); 270 273 } 271 274 … … 274 277 CognitiveRadioShell::RegisterSML(int32_t socketFD) 275 278 { 276 LOG("Cognitive Radio Shell:: Received registration message from SML.\n"); 279 LOG("Cognitive Radio Shell:: Received registration from SML on socket %d.\n", \ 280 socketFD); 277 281 278 282 SML_present = true; … … 290 294 shutdown(socketFD, 2); 291 295 close(socketFD); 292 LOG("Cognitive Radio Shell:: Socket closed.\n");296 LOG("Cognitive Radio Shell:: Socket %d closed.\n", socketFD); 293 297 } 294 298