Gocator API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
GoAcceleratorMgr.h
Go to the documentation of this file.
1 /**
2  * @file GoAcceleratorMgr.h
3  * @brief Declares the GoAcceleratorMgr class public interfaces.
4  *
5  * @internal
6  * Copyright (C) 2018 by LMI Technologies Inc.
7  * Licensed under the MIT License.
8  * Redistributed files must retain the above copyright notice.
9  */
10 #ifndef GO_ACCELERATOR_MGR_H
11 #define GO_ACCELERATOR_MGR_H
12 
13 #include <GoSdk/GoSdk.h>
14 // Don't know why need to explicitly include GoSystem header file again
15 // here when GoSdk.h already includes it. If this is not done, compile fails
16 // to find GoSystem declaration!?
17 #include <GoSdk/GoSystem.h>
19 
20 /**
21  * @class GoAcceleratorMgr
22  * @extends kObject
23  * @ingroup GoSdk
24  * @brief Represents an GoAcceleratorMgr instance.
25  */
27 
28 /**
29 * @class GoAcceleratorMgr
30 * @extends kValue
31 * @ingroup GoSdk
32 * @brief Represents an GoAcceleratorMgr events passed into the acceleration
33 * update callback handler bound in by SDK client.
34 */
35 typedef enum GoAcceleratorMgrAccelEvents
36 {
37  GO_ACCELERATOR_MGR_EVENT_ACCELERATING = 0, // Sensor acceleration is in progress.
38  GO_ACCELERATOR_MGR_EVENT_ACCELERATED, // Sensor is accelerated successfully.
39  GO_ACCELERATOR_MGR_EVENT_DECELERATING, // Sensor decleration is in progress.
40  GO_ACCELERATOR_MGR_EVENT_DECELERATED // Sensor is no longer accelerated.
41 } GoAcceleratorMgrAccelEvents;
42 
43 /**
44 * @struct GoAcceleratorMgrAccelUpdate
45 * @extends kValue
46 * @ingroup GoSdk
47 * @brief Structure to hold data for the acceleration update handler.
48 */
50 {
51  k32u sensorId;
52  GoAcceleratorMgrAccelEvents accelEvent;
54 
55 /**
56 * @struct GoAcceleratorMgrSensorParam
57 * @extends kValue
58 * @ingroup GoSdk
59 * @brief Structure to hold user configuration parameters from SDK client
60 * for a sensor that is to be accelerated.
61 */
63 {
64  GoAccelSensorPortAllocPorts ports;
65  kIpAddress platformIpAddress; // Bind an accelerated sensor to this accelerator host interface IP address.
67 
68 /**
69 * @struct GoAcceleratorMgrSensorInfo
70 * @extends kValue
71 * @ingroup GoSdk
72 * @brief Structure to return accelerated sensor information to SDK client.
73 * The param field contains information received from the SDK client, except if
74 * SDK client requested automatic port selection. In this case, the ports in the
75 * param field are the ports selected by the SDK for the SDK client.
76 */
78 {
79  k32u sensorId;
80  GoSensorAccelStatus status;
83 
84 /**
85 * Constructs the accelerator manager object
86 *
87 * @public @memberof GoAcceleratorMgr
88 * @param manager Address of uninitialized manager object.
89 * @param allocator Allocator object (kNULL for fallback allocator).
90 * @return Operation status.
91 */
93 
94 /**
95 * Assigns the SDK system object to the accelerator manager object. This must be
96 * done before starting the accelerator manager.
97 *
98 * @public @memberof GoAcceleratorMgr
99 * @param manager GoAcceleratorMgr object.
100 * @param system Instance of GoSystem
101 * @return Operation status.
102 */
104 
105 /**
106  * Starts the accelerator manager object after it has been configured.
107  *
108  * @public @memberof GoAcceleratorMgr
109  * @param manager GoAcceleratorMgr object.
110  * @return Operation status.
111  */
113 
114 /**
115 * Accelerate the specified sensor.
116 *
117 * @public @memberof GoAcceleratorMgr
118 * @param manager GoAcceleratorMgr object.
119 * @param sensorId Identifier of the sensor.
120 * @param param Structure of parameters to use to accelerate the sensor.
121 * @return Operation status.
122 */
124 
125 /**
126 * Decelerate (unaccelerate) a sensor.
127 *
128 * Note that subsequent operations on the GoSensor instance will no longer be routed through the manager.
129 *
130 * @public @memberof GoAcceleratorMgr
131 * @param manager GoAcceleratorMgr object.
132 * @param sensorId Identifier of the sensor.
133 * @return Operation status.
134 */
136 
137 #if 0
138 /**
139 * Get the acceleration status of the sensor that was accelerated. If the
140 * GoAcceleratorMgr_Accelerate() API was never called for the sensor,
141 * then this API returns an kERROR_NOT_FOUND.
142 *
143 * @public @memberof GoAcceleratorMgr
144 * @param manager GoAcceleratorMgr object.
145 * @param sensorId Identifier of the sensor.
146 * @param status Acceleration status of the sensor returned to the caller.
147 * @return Operation status.
148 */
149 //GoFx(kStatus) GoAcceleratorMgr_AccelerationStatus(GoAcceleratorMgr manager, k32u sensorId, GoSensorAccelStatus* status);
150 #endif
151 
152 /**
153 * Get a list of accelerated sensors. The list is returned in an array list
154 * of GoAcceleratorMgrSensorInfo. Caller must construct the list and
155 * pass the list as an argument to this API. The API will fill this list.
156 *
157 * @public @memberof GoAcceleratorMgr
158 * @param manager GoAcceleratorMgr object.
159 * @param sensorList Array list of GoAcceleratorMgrSensorInfo for each
160 * accelerated sensor.
161 * @return Operation status.
162 */
164 
165 /**
166 * Bind an update handler with the acceleration manager to get notification
167 * of acceleration events for a sensor.
168 * Update handler is called with a pointer to GoAcceleratorMgrAccelUpdate which
169 * contains event information about a sensor.
170 * SDK client does not need to free the memory for the GoAcceleratorMgrAccelUpdate.
171 *
172 * @public @memberof GoAcceleratorMgr
173 * @param manager GoAcceleratorMgr object.
174 * @param function Update callback handler function.
175 * @param context SDK client context for the callback handler.
176 * @return Operation status.
177 */
178 GoFx(kStatus) GoAcceleratorMgr_SetAccelUpdateHandler(GoAcceleratorMgr manager, kCallbackFx function, kPointer context);
179 
180 /**
181 * Change the range of port numbers to assign to accelerated sensors.
182 * the port numbers range must be within the port range limits (see
183 * GoAcceleratorMgr_GetPortRangeLimits()).
184 *
185 * @public @memberof GoAcceleratorMgr
186 * @param manager GoAcceleratorMgr object.
187 * @param startPort Starting port number in the range
188 * @param endPort Last port number in the range.
189 * @return Operation status.
190 */
191 GoFx(kStatus) GoAcceleratorMgr_SetPortRange(GoAcceleratorMgr manager, k16u startPort, k16u endPort);
192 
193 /**
194 * Get the range of port numbers to assign to accelerated sensors.
195 *
196 * @public @memberof GoAcceleratorMgr
197 * @param manager GoAcceleratorMgr object.
198 * @param startPort Returns the starting port number in the range
199 * @param endPort Returns the last port number in the range.
200 * @return Operation status.
201 */
202 GoFx(kStatus) GoAcceleratorMgr_GetPortRange(GoAcceleratorMgr manager, k16u* startPort, k16u* endPort);
203 
204 /**
205 * Get the minimum and maximum limit values to which the port number range can
206 * be configured and the minimum number of ports that a port range must have.
207 *
208 * @public @memberof GoAcceleratorMgr
209 * @param manager GoAcceleratorMgr object.
210 * @param startLimit Returns the limit for the starting port number in the range
211 * @param endLimit Returns the limit for the last port number in the range.
212 * @param minNumPorts Returns the minimum number of ports that the range must support.
213 * @return Operation status.
214 */
215 GoFx(kStatus) GoAcceleratorMgr_GetPortRangeLimits(GoAcceleratorMgr manager, k16u* startLimit, k16u* endLimit, k16u* minNumPorts);
216 
217 #include <GoSdk/GoAcceleratorMgr.x.h>
218 
219 #endif // GO_ACCELERATOR_MGR_H
kStatus GoAcceleratorMgr_SetAccelUpdateHandler(GoAcceleratorMgr manager, kCallbackFx function, kPointer context)
Bind an update handler with the acceleration manager to get notification of acceleration events for a...
Represents a system of Gocator devices.
kStatus GoAcceleratorMgr_SetSystem(GoAcceleratorMgr manager, GoSystem system)
Assigns the SDK system object to the accelerator manager object.
Includes all Gocator SDK headers.
kStatus GoAcceleratorMgr_Construct(GoAcceleratorMgr *manager, kAlloc allocator)
Constructs the accelerator manager object.
kStatus GoAcceleratorMgr_Accelerate(GoAcceleratorMgr manager, k32u sensorId, GoAcceleratorMgrSensorParam *param)
Accelerate the specified sensor.
Declares the GoAccelSensorPortAlloc class.
kStatus GoAcceleratorMgr_ListSensors(GoAcceleratorMgr manager, kArrayList sensorList)
Get a list of accelerated sensors.
Structure to hold user configuration parameters from SDK client for a sensor that is to be accelerate...
Definition: GoAcceleratorMgr.h:62
kStatus GoAcceleratorMgr_Decelerate(GoAcceleratorMgr manager, k32u sensorId)
Decelerate (unaccelerate) a sensor.
Represents the acceleration status of a sensor that is being accelerated by the local host...
kStatus GoAcceleratorMgr_GetPortRangeLimits(GoAcceleratorMgr manager, k16u *startLimit, k16u *endLimit, k16u *minNumPorts)
Get the minimum and maximum limit values to which the port number range can be configured and the min...
kStatus GoAcceleratorMgr_SetPortRange(GoAcceleratorMgr manager, k16u startPort, k16u endPort)
Change the range of port numbers to assign to accelerated sensors.
Structure to return accelerated sensor information to SDK client. The param field contains informatio...
Definition: GoAcceleratorMgr.h:77
Structure to hold data for the acceleration update handler.
Definition: GoAcceleratorMgr.h:49
Declares the GoSystem class.
kStatus GoAcceleratorMgr_Start(GoAcceleratorMgr manager)
Starts the accelerator manager object after it has been configured.
kStatus GoAcceleratorMgr_GetPortRange(GoAcceleratorMgr manager, k16u *startPort, k16u *endPort)
Get the range of port numbers to assign to accelerated sensors.
Represents an GoAcceleratorMgr instance.