1 | /* |
---|
2 | Copyright 2009 Virginia Polytechnic Institute and State University |
---|
3 | |
---|
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 | |
---|
17 | /*! CROSS Cognitive Radio API |
---|
18 | * |
---|
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. |
---|
22 | * |
---|
23 | * PUT MORE STUFF HERE |
---|
24 | */ |
---|
25 | |
---|
26 | #ifndef LIBCROSS_H |
---|
27 | #define LIBCROSS_H |
---|
28 | |
---|
29 | #include <stdint.h> |
---|
30 | #include <string> |
---|
31 | |
---|
32 | #include "components.h" |
---|
33 | #include "containers.h" |
---|
34 | |
---|
35 | |
---|
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 |
---|
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 | |
---|
44 | /*! \brief Parses XML configuration file and uses it to configure the radio. |
---|
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 | |
---|
51 | |
---|
52 | /*! \brief Lists current radio configuration options loaded from the XML. |
---|
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 | |
---|
59 | |
---|
60 | /*! \brief View data from the current status of the radio. |
---|
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 | */ |
---|
67 | Observable* GetRadioObservables(); |
---|
68 | Parameter* GetRadioParameters(); |
---|
69 | Utility* GetRadioUtilities(); |
---|
70 | |
---|
71 | |
---|
72 | /*! \brief View components currently connected to the radio by id. |
---|
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 | |
---|
82 | |
---|
83 | /*! \brief Look up component information by id. |
---|
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 | |
---|
90 | |
---|
91 | /*! \brief Given a certain set of observables, ask the radio to find the |
---|
92 | * optimum radio parameters and return them. |
---|
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 | */ |
---|
97 | Parameter* GetOptimalParameters(Observable *radioObservables, uint32_t numObservables, |
---|
98 | Parameter *currentParameters, uint32_t numCurrentParameters); |
---|
99 | |
---|
100 | |
---|
101 | /*! \brief Update the radio regarding its performance. |
---|
102 | * |
---|
103 | * TODO |
---|
104 | */ |
---|
105 | bool UpdateParameterPerformance(Parameter *p, uint32_t numParameters, Observable *o, \ |
---|
106 | uint32_t numObservables); |
---|
107 | |
---|
108 | /*! \brief Deactivate/Activate/Disconnect a component by id. |
---|
109 | */ |
---|
110 | bool ActivateComponent(uint32_t id); |
---|
111 | bool DeactivateComponent(uint32_t id); |
---|
112 | bool DisconnectComponent(uint32_t id); |
---|
113 | |
---|
114 | /*! \brief Set the active mission of the CROSS radio. |
---|
115 | */ |
---|
116 | uint32_t SetActiveMission(char * activeMission); |
---|
117 | |
---|
118 | /*! \brief Shut down the radio. |
---|
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 | |
---|
125 | /*! \brief Return total number of currently recognized transmission parameters. |
---|
126 | */ |
---|
127 | uint32_t GetNumParameters(); |
---|
128 | uint32_t GetNumObservables(); |
---|
129 | uint32_t GetNumUtilities(); |
---|
130 | |
---|
131 | |
---|
132 | #endif |
---|