Changeset 82

Show
Ignore:
Timestamp:
11/24/08 20:32:52 (16 years ago)
Author:
ahe
Message:

server get results from client

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/branches/trnewman/CR_shell/src/main_cognitive_radio.cpp

    r81 r82  
    257257} 
    258258 
    259 // Update operating settings 
    260 // This function will interact with the hardware "drivers" 
    261 void UpdateRadioSettings() { 
    262  
    263 } 
    264259 
    265260void LoadCEConfiguration(int socketfd,Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info){ 
     
    267262        char counter[55]; 
    268263        char var[50]; 
    269         int total_bytes;    
     264        //int total_bytes;    
    270265 
    271266        printf("Sending configuration to CE.\n"); 
     
    350345} 
    351346 
    352 void RequestCEOptimization() { 
    353  
    354 } 
    355  
    356 int UpdateRadioSettings(int sockfd, Utility *uList[],  
     347// Update operating settings 
     348// This function will interact with the hardware "drivers" 
     349void UpdateRadioSettings() { 
     350 
     351} 
     352 
     353int RequestCEOptimization(int sockfd, Utility *uList[],  
    357354        Parameter *pList[], Observable *oList[], 
    358355        CE_Info *ce_info) 
     
    363360    float var; 
    364361 
    365     // utility 
    366     // numUtilities 
     362    /*// utility 
    367363    for (i = 0; i < ce_info->numUtilities; i++){ 
    368364        bzero(buffer,256); 
     
    372368        printf("utility %s, value %f\n" 
    373369                , uList[i]->name.c_str(), uList[i]->value); 
    374     } 
     370    }*/ 
    375371     
    376372    // paramter 
    377     // numparameters 
    378373    for (i = 0; i < ce_info->numParameters; i++){ 
    379374        bzero(buffer,256); 
     
    385380    } 
    386381 
    387     // observable 
    388     // numObservables 
     382    /*// observable 
    389383    for (i = 0; i < ce_info->numObservables; i++){ 
    390384        bzero(buffer,256); 
     
    394388        printf("observable %s, value %f\n" 
    395389                , oList[i]->name.c_str(), oList[i]->value); 
    396     } 
     390    }*/ 
     391 
    397392    return 1; 
    398393} 
     
    406401         
    407402        // Set fake current environment params = current environment 
    408         RequestCEOptimization(); 
     403        //RequestCEOptimization(); 
     404        RequestCEOptimization(socketfd, uList, pList, oList, ce_info); 
    409405 
    410406        // Act like we are updating the hardware tranmission settings 
    411         UpdateRadioSettings(socketfd, uList, pList, oList, ce_info); 
     407        //UpdateRadioSettings(socketfd, uList, pList, oList, ce_info); 
     408        UpdateRadioSettings(); 
    412409 
    413410        // Send back fake utility values 
     
    494491        } else { 
    495492                // In parent process - open cognitive engine port. 
    496                 StartShell(30002,uList, pList, oList, &ce_info); 
     493                StartShell(30001,uList, pList, oList, &ce_info); 
    497494        }  
    498495