@@ -139,15 +139,15 @@ std::shared_ptr<Camera> initCamera(std::string * arguments)
139
139
return camera;
140
140
}
141
141
142
- void getAvailableFrameTypes (
143
- const std::shared_ptr<aditof::Camera> & camera, std::vector<std::string > & availableFrameTypes )
142
+ void getAvailableModes (
143
+ const std::shared_ptr<aditof::Camera> & camera, std::vector<uint8_t > & availableModes )
144
144
{
145
- // get available frae types of camera
145
+ // get available modes of camera
146
146
aditof::Status status = aditof::Status::OK;
147
147
148
- status = camera->getAvailableFrameTypes (availableFrameTypes );
148
+ status = camera->getAvailableModes (availableModes );
149
149
if (status != Status::OK) {
150
- LOG (ERROR) << " Couldn't get available frame types " ;
150
+ LOG (ERROR) << " Couldn't get available modes " ;
151
151
return ;
152
152
}
153
153
}
@@ -192,36 +192,11 @@ void stopCamera(const std::shared_ptr<aditof::Camera> & camera)
192
192
return ;
193
193
}
194
194
195
- void setFrameType (const std::shared_ptr<aditof::Camera> & camera, const std::string & type)
195
+ void getAvailableMode (
196
+ const std::shared_ptr<aditof::Camera> & camera, std::vector<uint8_t > & availableModes)
196
197
{
197
- std::vector<std::string> frameTypes;
198
- camera->getAvailableFrameTypes (frameTypes);
199
- if (frameTypes.empty ()) {
200
- LOG (ERROR) << " No frame type available!" ;
201
- return ;
202
- }
203
-
204
- std::vector<std::string>::iterator it = std::find (frameTypes.begin (), frameTypes.end (), type);
205
- if (it == frameTypes.end ()) {
206
- LOG (ERROR) << " Requested frame type is not available" ;
207
- return ;
208
- }
209
-
210
- Status status = Status::OK;
211
- status = camera->setFrameType (type);
212
- if (status != Status::OK) {
213
- LOG (ERROR) << " Could not set camera frame type!" ;
214
- return ;
215
- } else {
216
- LOG (INFO) << " Frame type set: " << type;
217
- }
218
- }
219
-
220
- void getAvailableFrameType (
221
- const std::shared_ptr<aditof::Camera> & camera, std::vector<std::string> & availableFrameTypes)
222
- {
223
- camera->getAvailableFrameTypes (availableFrameTypes);
224
- if (availableFrameTypes.empty ()) {
198
+ camera->getAvailableModes (availableModes);
199
+ if (availableModes.empty ()) {
225
200
LOG (ERROR) << " No frame type available!" ;
226
201
return ;
227
202
}
@@ -237,16 +212,16 @@ void getCameraDataDetails(
237
212
}
238
213
}
239
214
240
- void setMode (const std::shared_ptr<aditof::Camera> & camera, const std::string & mode)
215
+ void setCameraMode (const std::shared_ptr<aditof::Camera> & camera, const uint8_t & mode)
241
216
{
242
- std::vector<std::string > modes;
217
+ std::vector<uint8_t > modes;
243
218
camera->getAvailableModes (modes);
244
219
if (modes.empty ()) {
245
220
LOG (ERROR) << " No camera modes available!" ;
246
221
return ;
247
222
}
248
223
249
- std::vector<std::string >::iterator it = std::find (modes.begin (), modes.end (), mode);
224
+ std::vector<uint8_t >::iterator it = std::find (modes.begin (), modes.end (), mode);
250
225
if (it == modes.end ()) {
251
226
LOG (ERROR) << " Requested mode is not available" ;
252
227
return ;
0 commit comments