[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 | |
---|
[161] | 17 | /* VTCROSS Cognitive Radio API |
---|
| 18 | * |
---|
| 19 | * This header exports all public functions that comprise the VTCROSS function |
---|
| 20 | * library. |
---|
| 21 | * |
---|
| 22 | * PUT MORE STUFF HERE |
---|
| 23 | */ |
---|
| 24 | |
---|
| 25 | #ifndef LIBVTCROSS_H |
---|
| 26 | #define LIBVTCROSS_H |
---|
| 27 | |
---|
[196] | 28 | #include <stdint.h> |
---|
[498] | 29 | #include <string> |
---|
[161] | 30 | |
---|
| 31 | #include "components.h" |
---|
| 32 | #include "containers.h" |
---|
| 33 | |
---|
| 34 | |
---|
[498] | 35 | /* Sets the location of the shell component that the client code will be |
---|
| 36 | * communicating with. Note that this can be a local or remote destination. |
---|
| 37 | */ |
---|
| 38 | void SetCrossShellLocation(std::string hostname, std::string port); |
---|
| 39 | |
---|
| 40 | |
---|
[161] | 41 | /* Parses VTCROSS XML configuration file and uses it to configure the radio. |
---|
| 42 | * |
---|
| 43 | * This function *must* be called when the radio first starts up, and may be |
---|
| 44 | * called at any point after that to reconfigure the radio. |
---|
| 45 | */ |
---|
| 46 | bool ParseRadioConfiguration(); |
---|
| 47 | |
---|
[170] | 48 | |
---|
[161] | 49 | /* Lists current radio configuration options loaded from the configuration XML |
---|
| 50 | * file. |
---|
| 51 | * |
---|
| 52 | * TODO How are we listing these? Are we simply returning them to stdout? |
---|
| 53 | * Logging them? Returning strings? Need to figure this out... |
---|
| 54 | */ |
---|
| 55 | void ListCurrentRadioConfiguration(); |
---|
| 56 | |
---|
[170] | 57 | |
---|
[161] | 58 | /* View data from the current status of the radio. |
---|
| 59 | * |
---|
| 60 | * This function allows client code to capture radio properties at any certain |
---|
| 61 | * instant. Note, however, that these properties could be changing at very |
---|
| 62 | * rapid rates. There is no guarantee that the return results from these |
---|
| 63 | * functions will still be valid by the time the client code receives them. |
---|
| 64 | */ |
---|
[222] | 65 | Observable* GetRadioObservables(); |
---|
| 66 | Parameter* GetRadioParameters(); |
---|
| 67 | Utility* GetRadioUtilities(); |
---|
[161] | 68 | |
---|
[170] | 69 | |
---|
[161] | 70 | /* View components currently connected to the radio by id. |
---|
| 71 | * |
---|
| 72 | * TODO Should there be another way to list components? If you have 10 cognitive |
---|
| 73 | * engines, how are you going to know which is which just by id? |
---|
| 74 | */ |
---|
| 75 | uint32_t* GetConnectedCognitiveEngines(); |
---|
| 76 | uint32_t* GetConnectedPolicyEngines(); |
---|
| 77 | uint32_t* GetConnectedManagementServiceLayers(); |
---|
| 78 | uint32_t* GetConnectedComponents(); |
---|
| 79 | |
---|
[170] | 80 | |
---|
[161] | 81 | /* Look up component information by id. |
---|
| 82 | * |
---|
| 83 | * Note that the return type is of abstract base class component, which can then |
---|
| 84 | * be used to reference whatever sub-component type was referenced by the id. |
---|
| 85 | */ |
---|
| 86 | Component* GetComponentInformation(uint32_t id); |
---|
| 87 | |
---|
[170] | 88 | |
---|
[161] | 89 | /* Given a certain set of observables, ask the radio to find the optimum radio |
---|
| 90 | * parameters and return them. |
---|
| 91 | * |
---|
| 92 | * TODO I'm a little confused about this function... why would anyone need to |
---|
| 93 | * use this? Shouldn't this be internal to the radio operation? |
---|
| 94 | */ |
---|
[228] | 95 | Parameter* GetOptimalParameters(Observable *radioObservables, uint32_t numObservables, |
---|
| 96 | Parameter *currentParameters, uint32_t numCurrentParameters); |
---|
[161] | 97 | |
---|
[170] | 98 | |
---|
[161] | 99 | /* Update the radio regarding its performance for a certain set of transmission |
---|
| 100 | * parameters, observables, and utilities. |
---|
| 101 | * |
---|
| 102 | * TODO Where in the function parameters are we accurately representing the |
---|
| 103 | * radio's performance? |
---|
| 104 | */ |
---|
[230] | 105 | bool UpdateParameterPerformance(Parameter *p, uint32_t numParameters, Observable *o, \ |
---|
| 106 | uint32_t numObservables); |
---|
[161] | 107 | |
---|
| 108 | /* Deactivate/Activate/Disconnect a component by id. |
---|
| 109 | */ |
---|
[196] | 110 | bool ActivateComponent(uint32_t id); |
---|
| 111 | bool DeactivateComponent(uint32_t id); |
---|
| 112 | bool DisconnectComponent(uint32_t id); |
---|
[161] | 113 | |
---|
[284] | 114 | uint32_t SetActiveMission(char * activeMission); |
---|
[170] | 115 | |
---|
[161] | 116 | /* Shut down the radio. |
---|
| 117 | * |
---|
| 118 | * This function will deactivate and disconnect all radio components before |
---|
| 119 | * finally shutting down the shell and stopping radio operations. |
---|
| 120 | */ |
---|
| 121 | bool Shutdown(); |
---|
| 122 | |
---|
[228] | 123 | /* Return total number of currently recognized transmission parameters. |
---|
| 124 | */ |
---|
| 125 | uint32_t GetNumParameters(); |
---|
[230] | 126 | uint32_t GetNumObservables(); |
---|
| 127 | uint32_t GetNumUtilities(); |
---|
[228] | 128 | |
---|
| 129 | |
---|
[161] | 130 | #endif |
---|