[411] | 1 | /* |
---|
| 2 | Copyright 2009 Virginia Polytechnic Institute and State University |
---|
[161] | 3 | |
---|
[411] | 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 5 | you may not use this file except in compliance with the License. |
---|
| 6 | You may obtain a copy of the License at |
---|
| 7 | |
---|
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 9 | |
---|
| 10 | Unless required by applicable law or agreed to in writing, software |
---|
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 13 | See the License for the specific language governing permissions and |
---|
| 14 | limitations under the License. |
---|
| 15 | */ |
---|
| 16 | |
---|
[518] | 17 | /*! CROSS Cognitive Radio API |
---|
[161] | 18 | * |
---|
[518] | 19 | * This header exports all public functions that comprise the CROSS function |
---|
| 20 | * library. These are the functions that are used by the host application to |
---|
| 21 | * control the CROSS radio. |
---|
[161] | 22 | * |
---|
| 23 | * PUT MORE STUFF HERE |
---|
| 24 | */ |
---|
| 25 | |
---|
[518] | 26 | #ifndef LIBCROSS_H |
---|
| 27 | #define LIBCROSS_H |
---|
[161] | 28 | |
---|
[196] | 29 | #include <stdint.h> |
---|
[498] | 30 | #include <string> |
---|
[161] | 31 | |
---|
| 32 | #include "components.h" |
---|
| 33 | #include "containers.h" |
---|
| 34 | |
---|
| 35 | |
---|
[518] | 36 | /*! \brief Tell the system where the Shell component is located. |
---|
| 37 | * |
---|
| 38 | * Sets the location of the shell component that the client code will be |
---|
[498] | 39 | * communicating with. Note that this can be a local or remote destination. |
---|
| 40 | */ |
---|
| 41 | void SetCrossShellLocation(std::string hostname, std::string port); |
---|
| 42 | |
---|
| 43 | |
---|
[518] | 44 | /*! \brief Parses XML configuration file and uses it to configure the radio. |
---|
[161] | 45 | * |
---|
| 46 | * This function *must* be called when the radio first starts up, and may be |
---|
| 47 | * called at any point after that to reconfigure the radio. |
---|
| 48 | */ |
---|
| 49 | bool ParseRadioConfiguration(); |
---|
| 50 | |
---|
[170] | 51 | |
---|
[518] | 52 | /*! \brief Lists current radio configuration options loaded from the XML. |
---|
[161] | 53 | * |
---|
| 54 | * TODO How are we listing these? Are we simply returning them to stdout? |
---|
| 55 | * Logging them? Returning strings? Need to figure this out... |
---|
| 56 | */ |
---|
| 57 | void ListCurrentRadioConfiguration(); |
---|
| 58 | |
---|
[170] | 59 | |
---|
[518] | 60 | /*! \brief View data from the current status of the radio. |
---|
[161] | 61 | * |
---|
| 62 | * This function allows client code to capture radio properties at any certain |
---|
| 63 | * instant. Note, however, that these properties could be changing at very |
---|
| 64 | * rapid rates. There is no guarantee that the return results from these |
---|
| 65 | * functions will still be valid by the time the client code receives them. |
---|
| 66 | */ |
---|
[222] | 67 | Observable* GetRadioObservables(); |
---|
| 68 | Parameter* GetRadioParameters(); |
---|
| 69 | Utility* GetRadioUtilities(); |
---|
[161] | 70 | |
---|
[170] | 71 | |
---|
[518] | 72 | /*! \brief View components currently connected to the radio by id. |
---|
[161] | 73 | * |
---|
| 74 | * TODO Should there be another way to list components? If you have 10 cognitive |
---|
| 75 | * engines, how are you going to know which is which just by id? |
---|
| 76 | */ |
---|
| 77 | uint32_t* GetConnectedCognitiveEngines(); |
---|
| 78 | uint32_t* GetConnectedPolicyEngines(); |
---|
| 79 | uint32_t* GetConnectedManagementServiceLayers(); |
---|
| 80 | uint32_t* GetConnectedComponents(); |
---|
| 81 | |
---|
[170] | 82 | |
---|
[518] | 83 | /*! \brief Look up component information by id. |
---|
[161] | 84 | * |
---|
| 85 | * Note that the return type is of abstract base class component, which can then |
---|
| 86 | * be used to reference whatever sub-component type was referenced by the id. |
---|
| 87 | */ |
---|
| 88 | Component* GetComponentInformation(uint32_t id); |
---|
| 89 | |
---|
[170] | 90 | |
---|
[518] | 91 | /*! \brief Given a certain set of observables, ask the radio to find the |
---|
| 92 | * optimum radio parameters and return them. |
---|
[161] | 93 | * |
---|
| 94 | * TODO I'm a little confused about this function... why would anyone need to |
---|
| 95 | * use this? Shouldn't this be internal to the radio operation? |
---|
| 96 | */ |
---|
[228] | 97 | Parameter* GetOptimalParameters(Observable *radioObservables, uint32_t numObservables, |
---|
| 98 | Parameter *currentParameters, uint32_t numCurrentParameters); |
---|
[161] | 99 | |
---|
[170] | 100 | |
---|
[518] | 101 | /*! \brief Update the radio regarding its performance. |
---|
[161] | 102 | * |
---|
[518] | 103 | * TODO |
---|
[161] | 104 | */ |
---|
[230] | 105 | bool UpdateParameterPerformance(Parameter *p, uint32_t numParameters, Observable *o, \ |
---|
| 106 | uint32_t numObservables); |
---|
[161] | 107 | |
---|
[518] | 108 | /*! \brief Deactivate/Activate/Disconnect a component by id. |
---|
[161] | 109 | */ |
---|
[196] | 110 | bool ActivateComponent(uint32_t id); |
---|
| 111 | bool DeactivateComponent(uint32_t id); |
---|
| 112 | bool DisconnectComponent(uint32_t id); |
---|
[161] | 113 | |
---|
[518] | 114 | /*! \brief Set the active mission of the CROSS radio. |
---|
| 115 | */ |
---|
[284] | 116 | uint32_t SetActiveMission(char * activeMission); |
---|
[170] | 117 | |
---|
[518] | 118 | /*! \brief Shut down the radio. |
---|
[161] | 119 | * |
---|
| 120 | * This function will deactivate and disconnect all radio components before |
---|
| 121 | * finally shutting down the shell and stopping radio operations. |
---|
| 122 | */ |
---|
| 123 | bool Shutdown(); |
---|
| 124 | |
---|
[518] | 125 | /*! \brief Return total number of currently recognized transmission parameters. |
---|
[228] | 126 | */ |
---|
| 127 | uint32_t GetNumParameters(); |
---|
[230] | 128 | uint32_t GetNumObservables(); |
---|
| 129 | uint32_t GetNumUtilities(); |
---|
[228] | 130 | |
---|
| 131 | |
---|
[161] | 132 | #endif |
---|