Changeset 255 for vtcross/trunk

Show
Ignore:
Timestamp:
05/15/09 11:47:36 (15 years ago)
Author:
wrodgers
Message:

Implemented service DB, transfer methods

Location:
vtcross/trunk/src
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/cognitive_engines/CognitiveEngine.cpp

    r231 r255  
    8181 
    8282    if(SML) { 
     83        RegisterServices(); 
    8384        RegisterComponent(); 
    84         RegisterServices(); 
    8585        LOG("Cognitive Engine connected to SML at %s.\n", serverName); 
    8686        ReceiveRadioConfiguration(); 
     
    339339{ 
    340340    if(SML_present) { 
    341         DeregisterServices(); 
     341        //DeregisterServices(); 
    342342        DeregisterComponent(); 
    343343    }  
     
    363363} 
    364364 
     365        RegisterServices(); 
    365366 
    366367void 
     
    402403} 
    403404 
    404  
    405 void  
     405//Combined with deregister component since those two things must happen togeather 
     406/*void  
    406407CognitiveEngine::DeregisterServices() 
    407408{ 
     
    420421    SendMessage(commandSocketFD, "jam_bluetooth"); 
    421422 
    422 } 
     423}*/ 
    423424 
    424425void  
  • vtcross/trunk/src/include/vtcross/components.h

    r247 r255  
    121121        void ConnectToShell(const char* serverName, \ 
    122122                const char* serverPort); 
    123  
    124123        void SendComponentType(); 
    125         void WaitForSignal(); 
     124        void ShellSignalHandler(); 
     125        void CESignalHandler(int32_t ID); 
    126126        void Shutdown(); 
    127127        void Reset(); 
     
    133133         * on to another component. 
    134134         */ 
    135         void TransferRadioConfiguration(); 
     135        void TransferRadioConfiguration(int32_t ID); 
    136136 
    137137        /* Receive information regarding a completed 'experience' and pass it on 
    138138         * to the appropriate cognitive engine. 
    139139         */ 
    140         void TransferExperience(); 
     140        void TransferExperience(int32_t ID); 
    141141         
    142142        /* Listen for other components registering their available services with 
    143143         * the SML.  
    144144         */ 
    145         void ReceiveServices(); 
     145        void ReceiveServices(int32_t ID); 
     146        void DeregisterServices(int32_t ID); 
    146147 
    147148        /* Change the active mission of the radio to a new one and adjust radio 
     
    150151        void SetActiveMission(); 
    151152 
     153        void RegisterCognitiveEngine(int32_t ID); 
     154        void DeregisterCognitiveEngine(int32_t ID); 
     155 
    152156        /* List all services provided to the radio by registered components. 
    153157         */ 
     
    159163        void LoadConfiguration(); 
    160164 
     165        /* Create and initialize the DB to hold the services 
     166         */ 
     167        void CreateServicesDB(); 
     168 
     169        /* Starts the SML Server and watches it for incoming messages 
     170         */ 
     171        void StartSMLServer(); 
     172 
    161173        /* The socket file descriptor information for the shell which this SML 
    162174         * is connected to. 
    163175         */ 
    164176        int32_t shellSocketFD; 
    165         CE_Reg *CEList; 
    166         int32_t cogEngServ; 
     177        CE_Reg *CE_List; 
     178        int32_t cogEngSrv; 
    167179        int16_t CEPort; 
     180        uint16_t numberOfCognitiveEngines; 
     181        uint32_t Current_ID;  
     182        bool CE_Present; 
    168183}; 
    169184 
  • vtcross/trunk/src/include/vtcross/containers.h

    r247 r255  
    100100 */ 
    101101struct CE_Reg { 
    102     uint32_t IDnum; 
     102    int32_t ID_num; 
    103103    sockaddr_in *sock_ptr; 
     104    socklen_t sock_len; 
    104105}; 
    105106 
  • vtcross/trunk/src/include/vtcross/socketcomm.h

    r231 r255  
    1313#include <stdint.h> 
    1414 
    15 #include "vtcross/containers.h" 
     15#include "containers.h" 
    1616 
    1717