Changeset 212

Show
Ignore:
Timestamp:
03/26/09 13:17:33 (15 years ago)
Author:
bhilburn
Message:

Manually adding GetRemoteComponentType? to the shell since it doesn't
inherit from Component and therefore doesn't get the inherited function.

Location:
vtcross/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/include/vtcross/components.h

    r211 r212  
    291291            int16_t policyPort, int16_t commandPort); 
    292292 
     293        /* Ask for the component type of a remote component via sockets, or 
     294         * respond to such a query sent to the shell itself. 
     295         */ 
     296        std::string GetRemoteComponentType(int32_t socketFD); 
    293297        void SendComponentType(int32_t socketFD); 
     298 
    294299        void Shutdown(); 
    295300        void Reset(); 
  • vtcross/trunk/src/shell/CognitiveRadioShell.cpp

    r210 r212  
    1212#include <cstring> 
    1313#include <stdint.h> 
     14#include <string> 
    1415 
    1516#include <arpa/inet.h> 
     
    7576    SendMessage(socketFD, "response_shell"); 
    7677    LOG("Cognitive Radio Shell responded to GetRemoteComponentType query.\n"); 
     78} 
     79 
     80 
     81std::string  
     82CognitiveRadioShell::GetRemoteComponentType(int32_t socketFD) 
     83{ 
     84    SendMessage(socketFD, "request_component_type"); 
     85 
     86    char buffer[256]; 
     87    memset(buffer, 0, 256); 
     88    ReadMessage(socketFD, buffer); 
     89 
     90    return std::string(buffer); 
    7791} 
    7892