in sample_app/onvif_camera_mock/artifacts/onvif_srvd/src/ServicePTZ.cpp [82:119]
int PTZBindingService::GotoPreset(_tptz__GotoPreset *tptz__GotoPreset, _tptz__GotoPresetResponse &tptz__GotoPresetResponse)
{
UNUSED(tptz__GotoPresetResponse);
DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
std::string preset_cmd;
ServiceContext* ctx = (ServiceContext*)this->soap->user;
if (tptz__GotoPreset == NULL) {
return SOAP_OK;
}
if (tptz__GotoPreset->ProfileToken.c_str() == NULL) {
return SOAP_OK;
}
if (tptz__GotoPreset->PresetToken.c_str() == NULL) {
return SOAP_OK;
}
if (!ctx->get_ptz_node()->get_move_preset().empty()) {
preset_cmd = ctx->get_ptz_node()->get_move_preset().c_str();
} else {
return SOAP_OK;
}
std::string template_str_t("%t");
auto it_t = preset_cmd.find(template_str_t, 0);
if( it_t != std::string::npos ) {
preset_cmd.replace(it_t, template_str_t.size(), tptz__GotoPreset->PresetToken.c_str());
}
system(preset_cmd.c_str());
return SOAP_OK;
}